{ "cells": [ { "cell_type": "markdown", "id": "reverse-ghost", "metadata": {}, "source": [ "# What's new in Lightkurve 2?" ] }, { "cell_type": "markdown", "id": "f1d76519-525c-4fb0-9e12-5baeacda626e", "metadata": {}, "source": [ "This page shows you what is new in Lightkurve v2. If you'd like to see our changelog, which tracks minor version changes and patches, you can [click here](https://docs.lightkurve.org/about/changelog.html)." ] }, { "cell_type": "markdown", "id": "racial-dispute", "metadata": {}, "source": [ "## Lightkurve 2 offers improved support for TESS\n", "\n", "Lightkurve v1 has been a tremendous success. Owing to the efforts of [67 contributors](https://github.com/KeplerGO/lightkurve/blob/master/AUTHORS.rst), Lightkurve grew into a popular tool to analyze the data archive of NASA's Kepler space telescope. The package has been cited by nearly [200 scientific publications](https://ui.adsabs.harvard.edu/search/q=full%3A\"Lightkurve\") to date.\n", "\n", "In recent years, the success revealed a shortcoming: Lightkurve 1 was too focused on supporting Kepler data products. Over the past two years, our community has evolved in important ways:\n", "\n", "* NASA successfully launched TESS, adding a significant new data set which requires Lightkurve-like tools.\n", "* The TESS data archive started hosting numerous [community light curve databases](https://heasarc.gsfc.nasa.gov/docs/tess/community.html#high-level-science-products) created using specialized pipelines.\n", "* Many new time domain missions are on the horizon, including NASA's Roman Space Telescope.\n", "\n", "In response to these changes, the [TESS GI Office](https://heasarc.gsfc.nasa.gov/docs/tess/) at NASA Goddard and the [TESS Data Archive](https://archive.stsci.edu/tess/) at STScI/MAST supported the modification of Lightkurve and its tutorials to better support TESS and other data sets in three important ways:\n", "\n", "\n", "1. LightCurve objects are now specialized kinds of AstroPy Table objects, making it a more generic container for light curves from any telescope.\n", "2. Data search and download functions now support all TESS and Kepler light curve available at MAST, including those created by community pipelines.\n", "3. The noise removal tools now allow users to perform custom corrections in a way that is very similar to the official TESS pipeline. \n", "\n", "The remainder of this page briefly demonstrates these new features.\n", "They are explained in more detail in a new set of entry-level tutorials which are avaiable in the online documentation at [docs.lightkurve.org/tutorials](https://docs.lightkurve.org/tutorials).\n", "\n", "\n", "## 1. LightCurve objects are now specialized kinds of AstroPy Tables\n", "\n", "The most important change in Lightkurve 2 is that light curves are now extensions of AstroPy [TimeSeries](https://docs.astropy.org/en/stable/timeseries/) objects, which in turn are a sub-class of AstroPy Table.\n", "Compared to a generic table, the key difference is that each `LightCurve` object is guaranteed to have `time`, `flux`, and `flux_err` columns. This allows Lightkurve to extend AstroPy with tools that are specific to the analysis of TESS-like time series photometry.\n", "\n", "### ✨ New: LightCurve objects behave like tables\n", "\n", "Light curves can still be created as before, but now look and act like tables:" ] }, { "cell_type": "code", "execution_count": 1, "id": "quiet-heading", "metadata": { "execution": { "iopub.execute_input": "2023-11-03T14:28:33.906652Z", "iopub.status.busy": "2023-11-03T14:28:33.906141Z", "iopub.status.idle": "2023-11-03T14:28:35.206361Z", "shell.execute_reply": "2023-11-03T14:28:35.206030Z" } }, "outputs": [ { "data": { "text/html": [ "
LightCurve length=3\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
timefluxflux_err
Timefloat64float64
2000.01.00.1
2000.11.00.1
2000.21.00.1
" ], "text/plain": [ "\n", " time flux flux_err\n", " \n", " Time float64 float64 \n", "------ ------- --------\n", "2000.0 1.0 0.1\n", "2000.1 1.0 0.1\n", "2000.2 1.0 0.1" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from lightkurve import LightCurve\n", "lc = LightCurve(time=[2000.0, 2000.1, 2000.2],\n", " flux=[1.0, 1.0, 1.0],\n", " flux_err=[0.1, 0.1, 0.1],\n", " time_format=\"btjd\")\n", "lc" ] }, { "cell_type": "markdown", "id": "tutorial-program", "metadata": {}, "source": [ "### ✨ New: Light curves support user-defined columns\n", "\n", "Because light curves are now tables, they can contain arbitrary user-defined columns:" ] }, { "cell_type": "code", "execution_count": 2, "id": "premium-conversion", "metadata": { "execution": { "iopub.execute_input": "2023-11-03T14:28:35.208212Z", "iopub.status.busy": "2023-11-03T14:28:35.208033Z", "iopub.status.idle": "2023-11-03T14:28:35.211292Z", "shell.execute_reply": "2023-11-03T14:28:35.210949Z" } }, "outputs": [ { "data": { "text/html": [ "
LightCurve length=3\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
timefluxflux_errcolor
Timefloat64float64str5
2000.01.00.1red
2000.11.00.1green
2000.21.00.1blue
" ], "text/plain": [ "\n", " time flux flux_err color\n", " \n", " Time float64 float64 str5\n", "------ ------- -------- -----\n", "2000.0 1.0 0.1 red\n", "2000.1 1.0 0.1 green\n", "2000.2 1.0 0.1 blue" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "lc['color'] = ['red', 'green', 'blue']\n", "lc" ] }, { "cell_type": "markdown", "id": "adjustable-christianity", "metadata": {}, "source": [ "### ✨ New: Columns and rows can be accessed using index notation\n", "\n", "Just like Table objects, columns and rows can be accessed using index notation:" ] }, { "cell_type": "code", "execution_count": 3, "id": "planned-separation", "metadata": { "execution": { "iopub.execute_input": "2023-11-03T14:28:35.213085Z", "iopub.status.busy": "2023-11-03T14:28:35.212953Z", "iopub.status.idle": "2023-11-03T14:28:35.216587Z", "shell.execute_reply": "2023-11-03T14:28:35.216292Z" } }, "outputs": [ { "data": { "text/html": [ "
LightCurve length=2\n", "\n", "\n", "\n", "\n", "\n", "\n", "
timefluxflux_errcolor
Timefloat64float64str5
2000.11.00.1green
2000.21.00.1blue
" ], "text/plain": [ "\n", " time flux flux_err color\n", " \n", " Time float64 float64 str5\n", "------ ------- -------- -----\n", "2000.1 1.0 0.1 green\n", "2000.2 1.0 0.1 blue" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "lc[1:3]" ] }, { "cell_type": "code", "execution_count": 4, "id": "known-literacy", "metadata": { "execution": { "iopub.execute_input": "2023-11-03T14:28:35.218206Z", "iopub.status.busy": "2023-11-03T14:28:35.218092Z", "iopub.status.idle": "2023-11-03T14:28:35.220873Z", "shell.execute_reply": "2023-11-03T14:28:35.220369Z" } }, "outputs": [ { "data": { "text/latex": [ "$[1,~1,~1] \\; \\mathrm{}$" ], "text/plain": [ "" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "lc['flux']" ] }, { "cell_type": "markdown", "id": "endless-trout", "metadata": {}, "source": [ "### ✨ New: Times are stored as an AstroPy Time object\n", "\n", "\n" ] }, { "cell_type": "markdown", "id": "parental-rwanda", "metadata": {}, "source": [ "Lightkurve 2 extends [AstroPy Time](https://docs.astropy.org/en/stable/time/) by adding support for the TESS and Kepler time formats (\"BTJD\" and \"BKJD\"). As a result, the time column is now always a Time object, which enables user to leverage this standard AstroPy feature:" ] }, { "cell_type": "code", "execution_count": 5, "id": "gothic-consumer", "metadata": { "execution": { "iopub.execute_input": "2023-11-03T14:28:35.223154Z", "iopub.status.busy": "2023-11-03T14:28:35.223005Z", "iopub.status.idle": "2023-11-03T14:28:35.225515Z", "shell.execute_reply": "2023-11-03T14:28:35.225276Z" } }, "outputs": [ { "data": { "text/plain": [ "