{ "cells": [ { "cell_type": "markdown", "metadata": { "id": "qE_5PymnFBZz" }, "source": [ "# Searching & downloading *Kepler*, *K2*, and *TESS* data" ] }, { "cell_type": "markdown", "metadata": { "id": "D-g6vz-uFMVD" }, "source": [ "## Learning Goals\n", "\n", "By the end of this tutorial, you will:\n", "\n", "* Understand the data products available to query and download.\n", "* Be able to use [Lightkurve](https://lightkurve.github.io/lightkurve/index.html) to search for *Kepler*/*K2* and *TESS* data products.\n", "* Know how to download *TESS* Full Frame Image cutouts.\n", "* Be able to perform a cone search." ] }, { "cell_type": "markdown", "metadata": { "id": "vGflbvyHli8Q" }, "source": [ "## Introduction\n", "\n", "The [Lightkurve](https://lightkurve.github.io/lightkurve/index.html) Python package has functions to search for and download observations from *Kepler*/*K2* and *TESS*. These tools are built to make accessing space telescope data clear and straightforward, with intuitive method and keyword names.\n", "\n", "This tutorial outlines what data products are available to query with Lightkurve, and gives examples of how to use the functions to search for and download space telescope observations." ] }, { "cell_type": "markdown", "metadata": { "id": "3AA7PoEqAATc" }, "source": [ "## Imports\n", "\n", "This tutorial requires the [**Lightkurve**](https://lightkurve.github.io/lightkurve/index.html) package, which uses [**Matplotlib**](https://matplotlib.org/) for plotting." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "ZMIzRLKq__r3" }, "outputs": [], "source": [ "%matplotlib inline\n", "import lightkurve as lk\n", "import matplotlib.pyplot as plt" ] }, { "cell_type": "markdown", "metadata": { "id": "eXchpYqCah_6" }, "source": [ "---" ] }, { "cell_type": "markdown", "metadata": { "id": "ikT4RjNeFmQ3" }, "source": [ "## 1. What Data Products are Available?" ] }, { "cell_type": "markdown", "metadata": { "id": "oA8fDj8hVToR" }, "source": [ "*Kepler*/*K2* and *TESS* data products are stored on the Mikulski Archive for Space Telescopes (MAST) in two main forms:\n", "\n", "* **Light curve products**: tables containing the measured flux at each observation time.\n", "* **Target pixel file products**: stacks of images with the pixel-level observation at each observation time.\n", "\n", "There are also the following additional products available to query and download using Lightkurve:\n", "\n", "* **High Level Science Products (HLSPs)**: data products produced by a community-created analysis or photometry pipelines. Lightkurve has access to Kepler, K2, and TESS HLSPs. For more information about HLSPs, please see [this article](https://archive.stsci.edu/hlsp/) on the Space Telescope Science Institute's archive.\n", "* **Full Frame Images (FFIs)**: a file containing all active detector pixels at once. FFIs are currently not available for download through lightkurve, but custom cutouts of *TESS* FFIs can be [queried and downloaded](https://lightkurve.github.io/lightkurve/reference/search.html) by lightkurve using [MAST's tesscut](https://mast.stsci.edu/tesscut/) service.\n", "\n", "Lightkurve allows you to query and download each of these data products. The following sections contain examples of how to use the search functions in Lightkurve." ] }, { "cell_type": "markdown", "metadata": { "id": "6_iqt-ogFtFi" }, "source": [ "## 2. Searching for Light Curves" ] }, { "cell_type": "markdown", "metadata": { "id": "vQfYRdgZoCDh" }, "source": [ "Lightkurve uses [Astroquery](https://astroquery.readthedocs.io/en/latest/) to search for data products. Astroquery allows searches based on a target's coordinates, catalog ID number, or name.\n", "\n", "This is passed into the search function using the `target` keyword, and all valid inputs for identifying a target include:\n", " \n", " * The name of the object as a string, for example, \"Kepler-10.\"\n", " * The KIC or EPIC identifier as an integer, for example, \"11904151.\"\n", " * A coordinate string in decimal format, for example, \"285.67942179 +50.24130576.\"\n", " * A coordinate string in sexagesimal format, for example, \"19:02:43.1 +50:14:28.7.\"\n", " * An `astropy.coordinates.SkyCoord` object.\n", "\n", "You can also specify which mission you would like to retrieve data from using the `mission` keyword, which takes \"Kepler,\" \"K2,\" or \"TESS.\" By default, all available missions will be returned.\n", "\n", "We will start with the case of searching for a *Kepler* target using its Kepler Input Catalog (KIC) ID number. Below, we search for [KIC 3733346](https://arxiv.org/pdf/1001.0417.pdf), an [RR Lyrae star](https://en.wikipedia.org/wiki/RR_Lyrae_variable), using the [search_lightcurve](https://lightkurve.github.io/lightkurve/reference/api/lightkurve.search_lightcurve.html#lightkurve.search_lightcurve) function." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 414 }, "executionInfo": { "elapsed": 13019, "status": "ok", "timestamp": 1601395593892, "user": { "displayName": "Geert Barentsen", "photoUrl": "https://lh3.googleusercontent.com/a-/AOh14Gj8sjdnDeqdejfe7OoouYPIclAQV0KSTpsU469Jyeo=s64", "userId": "05704237875861987058" }, "user_tz": 420 }, "id": "8H_AXH_Z_9AN", "outputId": "97a6378c-a9b1-4d94-ec50-f379bb0ebcf4" }, "outputs": [], "source": [ "search_result = lk.search_lightcurve('KIC 3733346', author='Kepler')\n", "search_result" ] }, { "cell_type": "markdown", "metadata": { "id": "4tPVyNq4XIVl" }, "source": [ "`search_lightcurve` returns a `SearchResult` table, which contains information about the data products available to download. This search result tells us that KIC 3733346 was observed in *Kepler* Quarters 1–17. \n", "\n", "You can select an individual entry in this search result by indexing the search result." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 78 }, "executionInfo": { "elapsed": 677, "status": "ok", "timestamp": 1601395614370, "user": { "displayName": "Geert Barentsen", "photoUrl": "https://lh3.googleusercontent.com/a-/AOh14Gj8sjdnDeqdejfe7OoouYPIclAQV0KSTpsU469Jyeo=s64", "userId": "05704237875861987058" }, "user_tz": 420 }, "id": "XMM1L6pdCeb6", "outputId": "86dcdd6c-7e3f-4bbe-c3b4-e6488735f4e4" }, "outputs": [], "source": [ "search_result[0]" ] }, { "cell_type": "markdown", "metadata": { "id": "ifplaj3TXJlt" }, "source": [ "For more information about the available data products, the `SearchResult` has a full table accessible by calling [.table](https://lightkurve.github.io/lightkurve/reference/api/lightkurve.SearchResult.table.html). This full table contains the columns listed below. Definitions of each of these terms can be found [here](https://mast.stsci.edu/api/v0/_c_a_o_mfields.html)." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 918 }, "executionInfo": { "elapsed": 557, "status": "ok", "timestamp": 1601395619279, "user": { "displayName": "Geert Barentsen", "photoUrl": "https://lh3.googleusercontent.com/a-/AOh14Gj8sjdnDeqdejfe7OoouYPIclAQV0KSTpsU469Jyeo=s64", "userId": "05704237875861987058" }, "user_tz": 420 }, "id": "Aw5LPjVoXApj", "outputId": "c3e6bbca-1a2a-4bcd-ca23-73358dabf3ed" }, "outputs": [], "source": [ "for column in search_result.table.columns:\n", " print(column)" ] }, { "cell_type": "markdown", "metadata": { "id": "_Uju7EiNXK6_" }, "source": [ "These column names can also be used to search for specific entries in the table." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 78 }, "executionInfo": { "elapsed": 1588, "status": "ok", "timestamp": 1601395631133, "user": { "displayName": "Geert Barentsen", "photoUrl": "https://lh3.googleusercontent.com/a-/AOh14Gj8sjdnDeqdejfe7OoouYPIclAQV0KSTpsU469Jyeo=s64", "userId": "05704237875861987058" }, "user_tz": 420 }, "id": "n4pTlC3oBgWg", "outputId": "f2fffe3a-e8f8-4305-e772-2afeb1750575" }, "outputs": [], "source": [ "# import numpy, which we will use to find the desired index in the table\n", "import numpy as np\n", "quarter2_index = np.where(search_result.table['mission'] == 'Kepler Quarter 02')[0]\n", "search_result[quarter2_index]" ] }, { "cell_type": "markdown", "metadata": { "id": "y6F89JKOWB_2" }, "source": [ "You can also narrow down the list of observations when you make the search using the following mission-specific keywords: \n", "* *Kepler*: `quarter` \n", "* *K2*: `campaign`\n", "* *TESS*: `sector`\n", "\n", "Let's perform the search for KIC 3733346 again, this time specifying that we only want data from *Kepler* Quarter 2." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 78 }, "executionInfo": { "elapsed": 981, "status": "ok", "timestamp": 1601395644616, "user": { "displayName": "Geert Barentsen", "photoUrl": "https://lh3.googleusercontent.com/a-/AOh14Gj8sjdnDeqdejfe7OoouYPIclAQV0KSTpsU469Jyeo=s64", "userId": "05704237875861987058" }, "user_tz": 420 }, "id": "Bhhfl1-SWmYN", "outputId": "5fdf1f5f-b037-4f48-a020-86a566e576dc" }, "outputs": [], "source": [ "search_result_q2 = lk.search_lightcurve('KIC 3733346', author='Kepler', quarter=2)\n", "search_result_q2" ] }, { "cell_type": "markdown", "metadata": { "id": "xoAyHGkYw2X0" }, "source": [ "### 2.1 Downloading a single light curve\n", "\n", "A light curve can be downloaded by calling [.download()](https://lightkurve.github.io/lightkurve/reference/api/lightkurve.SearchResult.download.html). " ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 862 }, "executionInfo": { "elapsed": 1933, "status": "ok", "timestamp": 1601395652144, "user": { "displayName": "Geert Barentsen", "photoUrl": "https://lh3.googleusercontent.com/a-/AOh14Gj8sjdnDeqdejfe7OoouYPIclAQV0KSTpsU469Jyeo=s64", "userId": "05704237875861987058" }, "user_tz": 420 }, "id": "I2OURe-g_Pr-", "outputId": "9284356e-acd0-466f-802e-f6450536e5d4" }, "outputs": [], "source": [ "lc = search_result_q2.download()\n", "lc" ] }, { "cell_type": "markdown", "metadata": { "id": "GvAtPMp3Uzf5" }, "source": [ "This returns a single `KeplerLightCurve` object, which is shown above in the form of an `astropy` table. We can examine the light curve using the `plot` method." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 387 }, "executionInfo": { "elapsed": 1772, "status": "ok", "timestamp": 1601395664348, "user": { "displayName": "Geert Barentsen", "photoUrl": "https://lh3.googleusercontent.com/a-/AOh14Gj8sjdnDeqdejfe7OoouYPIclAQV0KSTpsU469Jyeo=s64", "userId": "05704237875861987058" }, "user_tz": 420 }, "id": "V2iL8sdMWwlf", "outputId": "f54f24cf-f716-4d20-d765-f09b206738b5" }, "outputs": [], "source": [ "lc.plot();" ] }, { "cell_type": "markdown", "metadata": { "id": "o2If_kcUUtlk" }, "source": [ "### 2.2 Downloading a collection of light curves" ] }, { "cell_type": "markdown", "metadata": { "id": "VuZWE6_ntflE" }, "source": [ "The `SearchResult` object also has a [download_all](https://lightkurve.github.io/lightkurve/reference/api/lightkurve.SearchResult.download_all.html) method, allowing you to download multiple light curves. This returns a `LightCurveCollection`, a convenient container for `LightCurve` objects." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 51 }, "executionInfo": { "elapsed": 7723, "status": "ok", "timestamp": 1601395678921, "user": { "displayName": "Geert Barentsen", "photoUrl": "https://lh3.googleusercontent.com/a-/AOh14Gj8sjdnDeqdejfe7OoouYPIclAQV0KSTpsU469Jyeo=s64", "userId": "05704237875861987058" }, "user_tz": 420 }, "id": "DA649B6V_UI1", "outputId": "877bdd89-b73f-4179-844a-ec44213cbaea" }, "outputs": [], "source": [ "lc_collection = search_result[:5].download_all()\n", "lc_collection" ] }, { "cell_type": "markdown", "metadata": { "id": "G9E4BtLlt7HR" }, "source": [ "The `LightCurveCollection` has a number of useful functions for plotting and manipulating the light curves. For more information about how to combine multiple light curves, please see the tutorial on combining multiple quarters of *Kepler* observations.\n", "\n", "One of the methods the collection enables you to use is `plot`, making it possible to quickly visualize all observations in your collection." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 334 }, "executionInfo": { "elapsed": 39157, "status": "ok", "timestamp": 1601337359521, "user": { "displayName": "Nicholas Saunders", "photoUrl": "https://lh3.googleusercontent.com/a-/AOh14GjSXMxzXNcbu4xk4fZvZM6Vk8p23Q3yBn7WvZmx=s64", "userId": "15005070089368591907" }, "user_tz": 600 }, "id": "QNVs5HtXp3xw", "outputId": "36327af0-fac0-4601-ea56-d02d50818616" }, "outputs": [], "source": [ "# Create a larger figure for clarity\n", "fig, ax = plt.subplots(figsize=(20,5))\n", "# Plot the light curve collection\n", "lc_collection.plot(ax=ax);" ] }, { "cell_type": "markdown", "metadata": { "id": "uJq8_ihJu1ZB" }, "source": [ "You can also iterate through a collection to label them more clearly and to perform additional actions like normalization." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 334 }, "executionInfo": { "elapsed": 1535, "status": "ok", "timestamp": 1601395708670, "user": { "displayName": "Geert Barentsen", "photoUrl": "https://lh3.googleusercontent.com/a-/AOh14Gj8sjdnDeqdejfe7OoouYPIclAQV0KSTpsU469Jyeo=s64", "userId": "05704237875861987058" }, "user_tz": 420 }, "id": "ilYHBtHLqweP", "outputId": "9b9824fb-a257-4659-b476-541b48e0a1bb" }, "outputs": [], "source": [ "fig, ax = plt.subplots(figsize=(20,5))\n", "for lc in lc_collection:\n", " lc.normalize().plot(ax=ax, label=f'Quarter {lc.quarter}');" ] }, { "cell_type": "markdown", "metadata": { "id": "oplWEgfiFwRA" }, "source": [ "## 3. Searching for Target Pixel Files" ] }, { "cell_type": "markdown", "metadata": { "id": "xr4IX0RMosdq" }, "source": [ "The other primary data product used by Lightkurve is the [TargetPixelFile](https://lightkurve.github.io/lightkurve/reference/targetpixelfile.html), or TPF. A TPF is a stack of images containing the flux in each pixel at each cadence.\n", "\n", "Similar to the approach above, we can use the [search_targetpixelfile](https://lightkurve.github.io/lightkurve/reference/api/lightkurve.search_targetpixelfile.html) method to identify available observations." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 99 }, "executionInfo": { "elapsed": 2924, "status": "ok", "timestamp": 1601395740887, "user": { "displayName": "Geert Barentsen", "photoUrl": "https://lh3.googleusercontent.com/a-/AOh14Gj8sjdnDeqdejfe7OoouYPIclAQV0KSTpsU469Jyeo=s64", "userId": "05704237875861987058" }, "user_tz": 420 }, "id": "KLIjggDiFset", "outputId": "593486aa-8d2a-4205-dd1f-2df5b322466a" }, "outputs": [], "source": [ "search_result = lk.search_targetpixelfile('K2-199', exptime=1800)\n", "search_result" ] }, { "cell_type": "markdown", "metadata": { "id": "I5-zRd6BvKmy" }, "source": [ "This returns a table which contains the same information as a light curve search result." ] }, { "cell_type": "markdown", "metadata": { "id": "UaPyp9en_IeU" }, "source": [ "### 3.1 Downloading a single target pixel file" ] }, { "cell_type": "markdown", "metadata": { "id": "WclFUweD_YPF" }, "source": [ "When you call `download` on a search result containing more than one entry, it will download only the first entry in the search result. Lightkurve will raise a friendly warning to let you know when this occurs." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 71 }, "executionInfo": { "elapsed": 9140, "status": "ok", "timestamp": 1601395822342, "user": { "displayName": "Geert Barentsen", "photoUrl": "https://lh3.googleusercontent.com/a-/AOh14Gj8sjdnDeqdejfe7OoouYPIclAQV0KSTpsU469Jyeo=s64", "userId": "05704237875861987058" }, "user_tz": 420 }, "id": "0y_QYNg0_E1X", "outputId": "09e82c3f-3534-4288-9913-e2c2275491ae" }, "outputs": [], "source": [ "tpf = search_result.download()" ] }, { "cell_type": "markdown", "metadata": { "id": "CQr55y9D_FRE" }, "source": [ "We can view a single cadence of the TPF using the `plot` method." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 420 }, "executionInfo": { "elapsed": 6768, "status": "ok", "timestamp": 1601395822804, "user": { "displayName": "Geert Barentsen", "photoUrl": "https://lh3.googleusercontent.com/a-/AOh14Gj8sjdnDeqdejfe7OoouYPIclAQV0KSTpsU469Jyeo=s64", "userId": "05704237875861987058" }, "user_tz": 420 }, "id": "wuvgk03nDMR6", "outputId": "bd4c35c5-8d2e-4814-dca5-79f5ce015c58" }, "outputs": [], "source": [ "tpf.plot();" ] }, { "cell_type": "markdown", "metadata": { "id": "7XStcoyLDNi3" }, "source": [ "If we want to turn the TPF into a light curve, there is a [to_lightcurve](https://docs.lightkurve.org/reference/api/lightkurve.KeplerTargetPixelFile.to_lightcurve.html?highlight=to_lightcurve) method. " ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 387 }, "executionInfo": { "elapsed": 51839, "status": "ok", "timestamp": 1601337372246, "user": { "displayName": "Nicholas Saunders", "photoUrl": "https://lh3.googleusercontent.com/a-/AOh14GjSXMxzXNcbu4xk4fZvZM6Vk8p23Q3yBn7WvZmx=s64", "userId": "15005070089368591907" }, "user_tz": 600 }, "id": "25utCe_FDwu9", "outputId": "0b928ae2-8e4a-422c-e4b0-6e45803dd843" }, "outputs": [], "source": [ "lc = tpf.to_lightcurve()\n", "lc.plot();" ] }, { "cell_type": "markdown", "metadata": { "id": "IvJxaTJmDxCU" }, "source": [ "For more information about using and plotting TPFs, please see the tutorials on using *Kepler* target pixel file products with Lightkurve and plotting *Kepler* target pixel file products with Lightkurve." ] }, { "cell_type": "markdown", "metadata": { "id": "Qr51Gejh_O3f" }, "source": [ "### 3.2 Downloading a collection of target pixel files" ] }, { "cell_type": "markdown", "metadata": { "id": "5BhutATc_Uhp" }, "source": [ "As with the lightcurve collection introduced in Section 2.2, you can also download multiple TPFs at a time using the `download_all` method, which returns a `TargetPixelFileCollection`." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 51 }, "executionInfo": { "elapsed": 58263, "status": "ok", "timestamp": 1601337378676, "user": { "displayName": "Nicholas Saunders", "photoUrl": "https://lh3.googleusercontent.com/a-/AOh14GjSXMxzXNcbu4xk4fZvZM6Vk8p23Q3yBn7WvZmx=s64", "userId": "15005070089368591907" }, "user_tz": 600 }, "id": "El3vttnI_U4p", "outputId": "087339f9-6ec2-45b5-e4f6-28e993684277" }, "outputs": [], "source": [ "tpf_collection = search_result.download_all()\n", "tpf_collection" ] }, { "cell_type": "markdown", "metadata": { "id": "SIYFDcamEHP3" }, "source": [ "A single cadence of each of these TPFs can be inspected with the `plot` method." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 830 }, "executionInfo": { "elapsed": 58771, "status": "ok", "timestamp": 1601337379190, "user": { "displayName": "Nicholas Saunders", "photoUrl": "https://lh3.googleusercontent.com/a-/AOh14GjSXMxzXNcbu4xk4fZvZM6Vk8p23Q3yBn7WvZmx=s64", "userId": "15005070089368591907" }, "user_tz": 600 }, "id": "7LgBAFVZvcfG", "outputId": "db565861-c2ff-4a24-991a-2d7d70c82804" }, "outputs": [], "source": [ "tpf_collection.plot();" ] }, { "cell_type": "markdown", "metadata": { "id": "Xq-zcLZ9BCI1" }, "source": [ "## 4. Searching for *TESS* Full Frame Image (FFI) Cutouts" ] }, { "cell_type": "markdown", "metadata": { "id": "AxP1qfWkEOHf" }, "source": [ "It is also possible to download targets observed in the *TESS* Full Frame Images (FFIs) using Lightkurve. This is done using [search_tesscut](https://lightkurve.github.io/lightkurve/reference/api/lightkurve.search_tesscut.html), which utilizes the [TESSCut](https://mast.stsci.edu/tesscut/) tool ([Brasseur et. al 2019](https://ui.adsabs.harvard.edu/abs/2019ascl.soft05007B/abstract))." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 204 }, "executionInfo": { "elapsed": 1719, "status": "ok", "timestamp": 1601395873026, "user": { "displayName": "Geert Barentsen", "photoUrl": "https://lh3.googleusercontent.com/a-/AOh14Gj8sjdnDeqdejfe7OoouYPIclAQV0KSTpsU469Jyeo=s64", "userId": "05704237875861987058" }, "user_tz": 420 }, "id": "hjOoH_OzBJVl", "outputId": "0d969cd4-3a39-491a-e865-6446991c0ffc" }, "outputs": [], "source": [ "search_result = lk.search_tesscut('Pi Men')\n", "search_result" ] }, { "cell_type": "markdown", "metadata": { "id": "hccNcNI5FN5C" }, "source": [ "*TESS* FFI cutouts are downloaded as `TargetPixelFile` objects. This is done using the same download function as above, but it now takes an additional argument `cutout_size`, which describes the number of pixels along the side of the cutout, and can be an `int` or a `tuple`." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 420 }, "executionInfo": { "elapsed": 83966, "status": "ok", "timestamp": 1601337404397, "user": { "displayName": "Nicholas Saunders", "photoUrl": "https://lh3.googleusercontent.com/a-/AOh14GjSXMxzXNcbu4xk4fZvZM6Vk8p23Q3yBn7WvZmx=s64", "userId": "15005070089368591907" }, "user_tz": 600 }, "id": "Cn9ox8ruFOPu", "outputId": "a5bfe847-6b50-4611-a1e1-32cfe644e925" }, "outputs": [], "source": [ "tpf_cutout = search_result[0].download(cutout_size=10)\n", "tpf_cutout.plot();" ] }, { "cell_type": "markdown", "metadata": { "id": "DTELFOWHAWyb" }, "source": [ "## 5. Performing a Cone Search" ] }, { "cell_type": "markdown", "metadata": { "id": "6MKQPoqWF1zL" }, "source": [ "If you are interested in identifying a number of nearby targets, you can perform a cone search, which will return all available targets within a cone of a specfied radius on the sky. The radius can be either a `float` or an [astropy.units.Quantity](https://docs.astropy.org/en/stable/units/) object. If a float is given, it will be assumed to be in units of arcseconds. If `None` then we default to 0.0001 arcsec." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 136 }, "executionInfo": { "elapsed": 90945, "status": "ok", "timestamp": 1601337411383, "user": { "displayName": "Nicholas Saunders", "photoUrl": "https://lh3.googleusercontent.com/a-/AOh14GjSXMxzXNcbu4xk4fZvZM6Vk8p23Q3yBn7WvZmx=s64", "userId": "15005070089368591907" }, "user_tz": 600 }, "id": "cfv5BkfaAWF4", "outputId": "186f7e86-8a9f-4e2c-fe57-c36bb1b38dc8" }, "outputs": [], "source": [ "search_result = lk.search_targetpixelfile('Trappist-1', radius=180., campaign=12, exptime=1800)\n", "print(search_result)" ] }, { "cell_type": "markdown", "metadata": { "id": "CwRVCMUKGhlD" }, "source": [ "The `distance` column describes the distance on the sky in arcseconds from the target or coordinates passed into the search." ] }, { "cell_type": "markdown", "metadata": { "id": "MuF1-VWr9LEx" }, "source": [ "## About this Notebook" ] }, { "cell_type": "markdown", "metadata": { "id": "fjIdUaM29T0m" }, "source": [ "**Authors**: Nicholas Saunders (nksaun@hawaii.edu)\n", "\n", "**Updated**: September 28, 2020" ] }, { "cell_type": "markdown", "metadata": { "id": "gpIoc3m580w6" }, "source": [ "## Citing Lightkurve and Astropy\n", "\n", "If you use `lightkurve` or its dependencies in your published research, please cite the authors. Click the buttons below to copy BibTeX entries to your clipboard." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 144 }, "executionInfo": { "elapsed": 873, "status": "ok", "timestamp": 1601395947242, "user": { "displayName": "Geert Barentsen", "photoUrl": "https://lh3.googleusercontent.com/a-/AOh14Gj8sjdnDeqdejfe7OoouYPIclAQV0KSTpsU469Jyeo=s64", "userId": "05704237875861987058" }, "user_tz": 420 }, "id": "rSuCOMoE83RE", "outputId": "688336f7-5885-49dc-df98-acb0a4e577c8" }, "outputs": [], "source": [ "lk.show_citation_instructions()" ] }, { "cell_type": "markdown", "metadata": { "id": "UORqugNo89Zg" }, "source": [ "\"Space\n" ] } ], "metadata": { "colab": { "collapsed_sections": [], "name": "Searching for Kepler/K2 and TESS data products", "provenance": [] }, "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.10" } }, "nbformat": 4, "nbformat_minor": 4 }