{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# An introduction into the Lightkurve Corrector Class - Noise removal for TESS light curves\n", "Welcome everyone to our *TESS* Lightkurve splinter session!" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Authors\n", "\n", "[Rebekah Hounsell](https://heasarc.gsfc.nasa.gov/docs/tess/helpdesk.html) - Support scientist for *TESS* in the NASA GSFC GI Office. \n", "\n", "" ] }, { "cell_type": "markdown", "metadata": { "id": "p2yAwPl-XENV" }, "source": [ "## Learning Goals\n", "\n", "In this tutorial, we will teach the user how to remove scattered light and noise from a *TESS* light curve. \n", "\n", "The splinter session assumes a basic knowledge of python and astronomy, and will walk the user through several of the concepts outlined below,\n", "\n", "1. How to use *Lightkurve* to access the various data products and create time series.\n", "2. How to account for instrumental and noise effects within your data using the Corrector class.\n", "\n", "This tutorial is designed for users that have previous experience with *Lightkurve*." ] }, { "cell_type": "markdown", "metadata": { "id": "wnTUKQjlYHeh" }, "source": [ "## Imports\n", "\n", "This tutorial requires the use of specific packages:\n", "- [**Lightkurve**](https://docs.lightkurve.org/index.html) to work with *TESS* data (v2.0.1)\n", "- [**Matplotlib**](https://matplotlib.org/) for plotting.\n", "- [**Numpy**](https://numpy.org) for manipulating the data." ] }, { "cell_type": "markdown", "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "MrmknoO9jt5F", "outputId": "048c1e1b-f1b3-4d37-fd4d-3214d1bda24b" }, "source": [ "## First time users\n", "\n", "If you are not that experienced with *Python*, or cannot download *Lightkurve*, you can run this notebook as a [Colab notebook](https://colab.research.google.com/notebooks/intro.ipynb?utm_source=scs-index). Colaboratory allows users to write and execute *Python* in your browser with zero configuration required. \n", "\n", "All you need is a Google account and to copy and paste in the following command at the top of your colab notebook:\n", "\n", "`!pip install lightkurve`\n", "\n", "This downloads the *Lightkurve* package." ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "id": "dS_W-DWjoEu0" }, "outputs": [], "source": [ "import lightkurve as lk\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "%matplotlib inline " ] }, { "cell_type": "markdown", "metadata": { "id": "yLzQXfvBYUTL" }, "source": [ "## Introduction to the Corrector Class\n", "\n", "*TESS* light curves can often have systematic trends caused by noise sources such as scattered light and instrumental effects. Only the [LightCurve objects](https://docs.lightkurve.org/tutorials/1-getting-started/what-are-lightcurve-objects.html) which have been fully processed, have had these effects removed. Data derived from either [TargetPixelFiles](https://docs.lightkurve.org/tutorials/1-getting-started/what-are-targetpixelfile-objects.html) or Full Frame Images must undergo further processing by the user to remove these sources of noise. \n", "\n", "To aid the user in this process, there exist several different tools within the \n", "*Lightkurve* package. These are known as the [Corrector class](https://docs.lightkurve.org/reference/api/lightkurve.correctors.corrector.Corrector.html?highlight=corrector%20class#lightkurve-correctors-corrector-corrector). We briefly describe each of these corrector classes below,\n", "\n", "- [**CBVCorrector**](https://docs.lightkurve.org/reference/api/lightkurve.correctors.CBVCorrector.html?highlight=cbvcorrector): Cotrending Basis Vectors (CBVs) are generated from the most common systematic trends observed in each Sector. Each *TESS* CCD and Camera has its own set of CBVs. There are three basic types of CBVs, \n", " - **Single-Scale**: Contains all systematic trends combined in a single set of basis vectors. Generally speaking, a single-scale CBV performs better at preserving longer period signals.\n", " - **Multi-Scale**: Contains systematic trends in specific wavelet-based band passes. There are usually three sets of multi-scale basis vectors in three bands. This type of correction performs better when the periods are close to the transiting planet durations, and help to preserve the signal.\n", " - **Spike**: Contains only short impulsive spike systematics. This correction is applied to remove short impulsive systematic signals.\n", " \n", "\n", "- [**RegressionCorrector**](https://docs.lightkurve.org/reference/api/lightkurve.correctors.RegressionCorrector.html?highlight=regressioncorrector): Here the light curve is de-trended against vectors that we think are predictive of the systematic noise. For FFI data, we have to select/define an aperture for our object of interest. Pixels outside of this aperture are used to create vectors that are predictive of the noise. These vectors are then removed from the data.\n", "\n", "- [**PLDCorrector**](https://docs.lightkurve.org/reference/api/lightkurve.correctors.PLDCorrector.html?highlight=pldcorrector): Pixel Level De-correlation (PLD) works by identifying a set of trends in the pixels surrounding the target star, and performing linear regression to create a combination of these trends that effectively models the systematic noise introduced by spacecraft motion/scattered light. This noise model is then subtracted from the uncorrected light curve. It is similar to the RegressionCorrector.\n", "\n", "In this tutorial, we will apply each of these methods to our data and compare the results. First, we need to obtain the data to test our various Corrector functions." ] }, { "cell_type": "markdown", "metadata": { "id": "5NAo0xYmnf8f" }, "source": [ "## 1. How to use *Lightkurve* to access the various data products and create a time series\n", "\n", "\n", "[*Lightkurve*](https://docs.lightkurve.org/tutorials/index.html) offers a user-friendly way to analyze time series data obtained by telescopes, in particular *TESS*. You can search for the various data products for *TESS* on MAST using the following *Lightkurve* functions.\n", "\n", "- To look for your object in a full frame image: [`search_tesscut()`](https://docs.lightkurve.org/reference/api/lightkurve.search_tesscut.html?highlight=search_tesscut)\n", "\n", "- To look for target pixel files: [`search_targetpixelfile()`](https://docs.lightkurve.org/reference/api/lightkurve.search_targetpixelfile.html?highlight=search_targetpixelfile) \n", "\n", "- To obtain light curve files for your object of interest: [`search_lightcurve()`](https://docs.lightkurve.org/reference/api/lightkurve.search_lightcurve.html?highlight=search_lightcurve) \n", "\n", "For the purpose of this tutorial, we will be examining [KT Eri](https://en.wikipedia.org/wiki/KT_Eridani), a bright nova in the constellation Eridanus that underwent an eruption in 2009.\n", "\n", "To test our various methods of noise removal, we will be looking at FFI data for this object. We can search [MAST](https://mast.stsci.edu) for TESS FFI data on this object using the [search_tesscut()](https://docs.lightkurve.org/reference/api/lightkurve.search_tesscut.html?highlight=search_tesscut#lightkurve.search_tesscut) function." ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 120 }, "id": "a_KEML4eojAA", "outputId": "eed270a7-8e68-43ca-cd48-e59148ad58ef" }, "outputs": [ { "data": { "text/html": [ "SearchResult containing 2 data products.\n", "\n", "
# | mission | year | author | exptime | target_name | distance |
---|---|---|---|---|---|---|
s | arcsec | |||||
0 | TESS Sector 05 | 2018 | TESScut | 1426 | KT Eri | 0.0 |
1 | TESS Sector 32 | 2020 | TESScut | 475 | KT Eri | 0.0 |