How to Search for TESS/Kepler/K2 Mission Data with lksearch#
[1]:
from lksearch import MASTSearch, KeplerSearch, K2Search, TESSSearch
Welcome to the new lksearch module! This package allows users to peruse available data products for the TESS, Kepler, and K2 missions. This notebook will guide you through several examples of how to use search functions.
The result of the search is a MASTSearch object, which contains among other things a full list of results stored in a pandas dataframe.
NOTE: While MASTSearch is a usable class, it does not have all of the functionality or nicities of the mission-specific searches (TESSSearch/KeplerSearch/K2Search). It is therefore recommended you as the user interact with these instead.
Basic Searches#
Data Exploration#
The lksearch package provides a user-friendly wrapper to search the MAST data archive. The most generic search is to use MASTsearch, which checks for mission products from three missions (Kepler, K2, and TESS). This search can be useful for data exploration, but does not have full functionality, as discussed below.
In addition, you can specify
search_radius: a search radius (assumes arcsec by default, but you can specify anything by using astropy units)
exptime: the exposure time of the observation. Either a number or a range in the form of a tuple
mission: the mission - only Kepler, K2, and TESS are directly supported
pipline: the pipeline(s) used to create the product, eg. Kepler, K2, SPOC, QLP, KBONUS-BKG, etc
and in the case of mission-specific searches
a sequence number*
sector for TESS
quarter/month for Kepler
campaign for K2
**NOTE* MASTSearch allows a sequence number, but it will result in selecting the same sequence for all mission. For example, if you provide sequence = 5, it will return only data from TESS sector 5, K2 campaign 5, or Kepler quarter 5.
For data exploration, it is suggested users search with the default setting (ie, providing only the target). You can use the provided class functions to extract the data products you want to download, as demonstrated throughout this tutorial.
[2]:
# First, we can check what data is available by any mission (TESS, Kepler, or K2)
# TOI-1161 is the same as Kepler-13. You can search using either name to get the same results
search_result = MASTSearch("TOI 1161")
search_result
[2]:
target_name | pipeline | mission | exptime | distance | year | description | |
---|---|---|---|---|---|---|---|
0 | 158324245 | SPOC | TESS | 120.0 | 0.0 | 2019 | full data validation report |
1 | 158324245 | SPOC | TESS | 120.0 | 0.0 | 2019 | Light curves |
2 | 158324245 | SPOC | TESS | 120.0 | 0.0 | 2019 | TCE summary report |
3 | 158324245 | SPOC | TESS | 120.0 | 0.0 | 2019 | Data validation mini report |
4 | 158324245 | SPOC | TESS | 120.0 | 0.0 | 2019 | Target pixel files |
... | ... | ... | ... | ... | ... | ... | ... |
239 | kplr009941662 | Kepler | Kepler | 60.0 | 0.0 | 2012 | Lightcurve Short Cadence (CSC) - Q14 |
240 | kplr009941662 | Kepler | Kepler | 60.0 | 0.0 | 2012 | Target Pixel Short Cadence (TPS) - Q14 |
241 | kplr009941662 | Kepler | Kepler | 60.0 | 0.0 | 2013 | Lightcurve Short Cadence (CSC) - Q17 |
242 | kplr009941662 | Kepler | Kepler | 60.0 | 0.0 | 2011 | Target Pixel Short Cadence (TPS) - Q11 |
243 | kplr009941662 | Kepler | Kepler | 60.0 | 0.0 | 2009 | Target Pixel Short Cadence (TPS) - Q2 |
244 rows × 7 columns
Note that search_result is a MASTSearch object. When calling the object, a summary of the contents (MASTSearch object containing X data products) is printed to the screen along with a subset of the observation table.
The returned MASTSearch object has several properties to easily access specific observation characteristics. These include
target name (target_name)
right ascension (ra)
declination (dec)
exposure time (exptime)
mission
obsrvation year (year)
reduction pipeline (pipeline)
data location URI (uris)
data location in cloud storage (cloud_uris)
[3]:
# Let's use this to check what mission(s) have observed this target
print(search_result.mission)
['TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS'
'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS'
'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS'
'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS'
'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS'
'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'Kepler'
'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler'
'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler'
'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler'
'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler'
'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler' 'TESS'
'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS'
'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS'
'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS'
'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS'
'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS'
'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS'
'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'TESS' 'Kepler' 'Kepler'
'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler'
'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler'
'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler'
'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler'
'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler'
'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler'
'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler'
'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler'
'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler' 'Kepler'
'Kepler' 'Kepler']
[4]:
print(
f"There are {sum(search_result.mission == 'TESS')} observations by TESS and {sum(search_result.mission == 'Kepler')} by Kepler"
)
There are 128 observations by TESS and 116 by Kepler
Accessing the full result table#
To view all of the results, you can access the ‘table’ variable. This table is a pandas dataframe that contains the full results of the MAST search as well as a few added parameters such as year, start_time, and end_time.
[5]:
search_result.table
[5]:
intentType | obs_collection_obs | provenance_name | instrument_name | project_obs | filters_obs | wavelength_region | target_name | target_classification | obs_id | ... | size | parent_obsid | dataRights | calib_level_prod | filters_prod | pipeline | mission | year | start_time | end_time | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | science | TESS | SPOC | Photometer | TESS | TESS | Optical | 158324245 | NaN | tess2019198215352-s0014-0000000158324245-0150-s | ... | 16426251 | 27448285 | PUBLIC | 3 | TESS | SPOC | TESS | 2019 | 2019-07-18 20:30:33.624 | 2019-08-14 16:56:23.634 |
1 | science | TESS | SPOC | Photometer | TESS | TESS | Optical | 158324245 | NaN | tess2019198215352-s0014-0000000158324245-0150-s | ... | 1964160 | 27448285 | PUBLIC | 3 | TESS | SPOC | TESS | 2019 | 2019-07-18 20:30:33.624 | 2019-08-14 16:56:23.634 |
2 | science | TESS | SPOC | Photometer | TESS | TESS | Optical | 158324245 | NaN | tess2019198215352-s0014-0000000158324245-0150-s | ... | 1322689 | 27448285 | PUBLIC | 3 | TESS | SPOC | TESS | 2019 | 2019-07-18 20:30:33.624 | 2019-08-14 16:56:23.634 |
3 | science | TESS | SPOC | Photometer | TESS | TESS | Optical | 158324245 | NaN | tess2019198215352-s0014-0000000158324245-0150-s | ... | 5082604 | 27448285 | PUBLIC | 3 | TESS | SPOC | TESS | 2019 | 2019-07-18 20:30:33.624 | 2019-08-14 16:56:23.634 |
4 | science | TESS | SPOC | Photometer | TESS | TESS | Optical | 158324245 | NaN | tess2019198215352-s0014-0000000158324245-0150-s | ... | 47376000 | 27448285 | PUBLIC | 2 | TESS | SPOC | TESS | 2019 | 2019-07-18 20:30:33.624 | 2019-08-14 16:56:23.634 |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
239 | science | Kepler | Kepler | Kepler | Kepler | KEPLER | OPTICAL | kplr009941662 | NaN | kplr009941662_sc_Q003300033333333332 | ... | 5045760 | 599738 | PUBLIC | 2 | KEPLER | Kepler | Kepler | 2012 | 2009-05-02 00:54:00.000 | 2013-05-11 12:15:00.000 |
240 | science | Kepler | Kepler | Kepler | Kepler | KEPLER | OPTICAL | kplr009941662 | NaN | kplr009941662_sc_Q003300033333333332 | ... | 76302956 | 599738 | PUBLIC | 2 | KEPLER | Kepler | Kepler | 2012 | 2009-05-02 00:54:00.000 | 2013-05-11 12:15:00.000 |
241 | science | Kepler | Kepler | Kepler | Kepler | KEPLER | OPTICAL | kplr009941662 | NaN | kplr009941662_sc_Q003300033333333332 | ... | 648000 | 599738 | PUBLIC | 2 | KEPLER | Kepler | Kepler | 2013 | 2009-05-02 00:54:00.000 | 2013-05-11 12:15:00.000 |
242 | science | Kepler | Kepler | Kepler | Kepler | KEPLER | OPTICAL | kplr009941662 | NaN | kplr009941662_sc_Q003300033333333332 | ... | 130764115 | 599738 | PUBLIC | 2 | KEPLER | Kepler | Kepler | 2011 | 2009-05-02 00:54:00.000 | 2013-05-11 12:15:00.000 |
243 | science | Kepler | Kepler | Kepler | Kepler | KEPLER | OPTICAL | kplr009941662 | NaN | kplr009941662_sc_Q003300033333333332 | ... | 64708791 | 599738 | PUBLIC | 2 | KEPLER | Kepler | Kepler | 2009 | 2009-05-02 00:54:00.000 | 2013-05-11 12:15:00.000 |
244 rows × 59 columns
By default, MASTSearch returns any available data provided by an official mission pipeline. This means that any available High Level Science Products (HLSPs) are NOT returned. Additonally, TESS full frame images (FFIs) are not returned by MASTSearch. To search for these data types, we recommend using the mission-specific searches.
TESS search#
[6]:
# Search for TESS data only. This by default includes both HLSPs and FFI cutouts.
toi = TESSSearch("TOI 1161")
toi
[6]:
target_name | pipeline | mission | sector | exptime | distance | year | description | |
---|---|---|---|---|---|---|---|---|
0 | 158324245 | SPOC | TESS | 14 | 120.0 | 0.0 | 2019 | Target pixel files |
1 | 158324245 | SPOC | TESS | 14 | 120.0 | 0.0 | 2019 | full data validation report |
2 | 158324245 | SPOC | TESS | 14 | 120.0 | 0.0 | 2019 | Data validation mini report |
3 | 158324245 | SPOC | TESS | 14 | 120.0 | 0.0 | 2019 | TCE summary report |
4 | 158324245 | SPOC | TESS | 14 | 120.0 | 0.0 | 2019 | Light curves |
... | ... | ... | ... | ... | ... | ... | ... | ... |
231 | 1717079071 | QLP | HLSP | 55 | 600.0 | 0.0 | 2022 | FITS |
232 | 1717079066 | QLP | HLSP | 55 | 600.0 | 0.0 | 2022 | FITS |
233 | 158324245 | QLP | HLSP | 74 | 200.0 | 0.0 | 2024 | FITS |
234 | 1717079066 | QLP | HLSP | 74 | 200.0 | 0.0 | 2024 | FITS |
235 | 1717079071 | QLP | HLSP | 74 | 200.0 | 0.0 | 2024 | FITS |
236 rows × 8 columns
There are 200+ TESS data products available for this target. Note that this is more than were returned by our first MASTsearch. These ‘extra’ data products come from non-mission sources. The ‘pipeline’ column shows what pipeline was used to generate the data product. The ‘mission’ column simply reports if the data is a mission product or HLSP. Another addition for the TESSSearch is the ‘sector’ column. This column is only populated in the TESSSearch call, so is not available when using MASTSearch.
Now that we know that TESS has observed this target, we may want to restrict our search to match our needs. Below we demonstrate some common filtering examples.
[7]:
# Only return timeseries (lightcurve) products
toi_lc = toi.timeseries
toi_lc
[7]:
target_name | pipeline | mission | sector | exptime | distance | year | description | |
---|---|---|---|---|---|---|---|---|
0 | 158324245 | SPOC | TESS | 14 | 120.0 | 0.0 | 2019 | Light curves |
1 | 158324245 | SPOC | TESS | 15 | 120.0 | 0.0 | 2019 | Light curves |
2 | 158324245 | SPOC | TESS | 26 | 120.0 | 0.0 | 2020 | Light curves |
3 | 1717079071 | SPOC | TESS | 26 | 120.0 | 0.0 | 2020 | Light curves |
4 | 1717079066 | SPOC | TESS | 40 | 120.0 | 0.0 | 2021 | Light curves |
... | ... | ... | ... | ... | ... | ... | ... | ... |
81 | 1717079071 | QLP | HLSP | 55 | 600.0 | 0.0 | 2022 | FITS |
82 | 1717079066 | QLP | HLSP | 55 | 600.0 | 0.0 | 2022 | FITS |
83 | 158324245 | QLP | HLSP | 74 | 200.0 | 0.0 | 2024 | FITS |
84 | 1717079066 | QLP | HLSP | 74 | 200.0 | 0.0 | 2024 | FITS |
85 | 1717079071 | QLP | HLSP | 74 | 200.0 | 0.0 | 2024 | FITS |
86 rows × 8 columns
[8]:
# Only return cubedata (TPF) products
# NOTE: Only TESS provides FFI cutouts
toi_cube = toi.cubedata
toi_cube
[8]:
target_name | pipeline | mission | sector | exptime | distance | year | description | |
---|---|---|---|---|---|---|---|---|
0 | 158324245 | SPOC | TESS | 14 | 120.0 | 0.0 | 2019 | Target pixel files |
1 | 158324245 | SPOC | TESS | 15 | 120.0 | 0.0 | 2019 | Target pixel files |
2 | 158324245 | SPOC | TESS | 26 | 120.0 | 0.0 | 2020 | Target pixel files |
3 | 1717079071 | SPOC | TESS | 26 | 120.0 | 0.0 | 2020 | Target pixel files |
4 | 1717079066 | SPOC | TESS | 40 | 120.0 | 0.0 | 2021 | Target pixel files |
... | ... | ... | ... | ... | ... | ... | ... | ... |
41 | TOI 1161 | TESScut | TESS Sector 53 | 53 | 600.0 | 0.0 | 2022 | TESS FFI Cutout (sector 53) |
42 | TOI 1161 | TESScut | TESS Sector 54 | 54 | 600.0 | 0.0 | 2022 | TESS FFI Cutout (sector 54) |
43 | TOI 1161 | TESScut | TESS Sector 55 | 55 | 600.0 | 0.0 | 2022 | TESS FFI Cutout (sector 55) |
44 | TOI 1161 | TESScut | TESS Sector 74 | 74 | 200.0 | 0.0 | 2024 | TESS FFI Cutout (sector 74) |
45 | TOI 1161 | TESScut | TESS Sector 75 | 75 | 200.0 | 0.0 | 2024 | TESS FFI Cutout (sector 75) |
46 rows × 8 columns
[9]:
# Only return data validation products. These are PDFs generated automatically during transit searches.
toi_dv = toi.dvreports
toi_dv
[9]:
target_name | pipeline | mission | sector | exptime | distance | year | description | |
---|---|---|---|---|---|---|---|---|
0 | 158324245 | SPOC | TESS | 14 | 120.0 | 0.0 | 2019 | full data validation report |
1 | 158324245 | SPOC | TESS | 14 | 120.0 | 0.0 | 2019 | Data validation mini report |
2 | 158324245 | SPOC | TESS | 14 | 120.0 | 0.0 | 2019 | TCE summary report |
3 | 158324245 | SPOC | TESS | 14 | 120.0 | 0.0 | 2019 | full data validation report |
4 | 158324245 | SPOC | TESS | 14 | 120.0 | 0.0 | 2019 | TCE summary report |
... | ... | ... | ... | ... | ... | ... | ... | ... |
99 | 1717079066 | TESS-SPOC | HLSP | 54 | 600.0 | 0.0 | 2022 | Informational PDF |
100 | 158324245 | TESS-SPOC | HLSP | 55 | 600.0 | 0.0 | 2022 | Informational PDF |
101 | 158324245 | TESS-SPOC | HLSP | 55 | 600.0 | 0.0 | 2022 | |
102 | 1717079066 | TESS-SPOC | HLSP | 55 | 600.0 | 0.0 | 2022 | |
103 | 1717079066 | TESS-SPOC | HLSP | 55 | 600.0 | 0.0 | 2022 | Informational PDF |
104 rows × 8 columns
[10]:
# Only return High Level Science Products
toi_hlsp = toi.HLSPs
toi_hlsp
[10]:
target_name | pipeline | mission | sector | exptime | distance | year | description | |
---|---|---|---|---|---|---|---|---|
0 | 158324245 | TESS-SPOC | HLSP | 14 | 1800.0 | 0.0 | 2019 | FITS |
1 | 158324245 | TESS-SPOC | HLSP | 14 | 1800.0 | 0.0 | 2019 | FITS |
2 | 158324245 | TESS-SPOC | HLSP | 15 | 1800.0 | 0.0 | 2019 | FITS |
3 | 158324245 | TESS-SPOC | HLSP | 15 | 1800.0 | 0.0 | 2019 | FITS |
4 | 1717079071 | TESS-SPOC | HLSP | 26 | 1800.0 | 0.0 | 2020 | FITS |
... | ... | ... | ... | ... | ... | ... | ... | ... |
103 | 1717079071 | QLP | HLSP | 55 | 600.0 | 0.0 | 2022 | FITS |
104 | 1717079066 | QLP | HLSP | 55 | 600.0 | 0.0 | 2022 | FITS |
105 | 158324245 | QLP | HLSP | 74 | 200.0 | 0.0 | 2024 | FITS |
106 | 1717079066 | QLP | HLSP | 74 | 200.0 | 0.0 | 2024 | FITS |
107 | 1717079071 | QLP | HLSP | 74 | 200.0 | 0.0 | 2024 | FITS |
108 rows × 8 columns
[11]:
# Only return official mission products
toi_mission = toi.mission_products
toi_mission
[11]:
target_name | pipeline | mission | sector | exptime | distance | year | description | |
---|---|---|---|---|---|---|---|---|
0 | 158324245 | SPOC | TESS | 14 | 120.0 | 0.0 | 2019 | Target pixel files |
1 | 158324245 | SPOC | TESS | 14 | 120.0 | 0.0 | 2019 | full data validation report |
2 | 158324245 | SPOC | TESS | 14 | 120.0 | 0.0 | 2019 | Data validation mini report |
3 | 158324245 | SPOC | TESS | 14 | 120.0 | 0.0 | 2019 | TCE summary report |
4 | 158324245 | SPOC | TESS | 14 | 120.0 | 0.0 | 2019 | Light curves |
... | ... | ... | ... | ... | ... | ... | ... | ... |
123 | 158324245 | SPOC | TESS | 75 | 120.0 | 0.0 | 2024 | TCE summary report |
124 | 158324245 | SPOC | TESS | 75 | 120.0 | 0.0 | 2024 | Data validation mini report |
125 | 158324245 | SPOC | TESS | 75 | 120.0 | 0.0 | 2024 | full data validation report |
126 | 158324245 | SPOC | TESS | 75 | 120.0 | 0.0 | 2024 | Light curves |
127 | 158324245 | SPOC | TESS | 75 | 120.0 | 0.0 | 2024 | Target pixel files |
128 rows × 8 columns
Even after limiting results by data type, there are a lot of results for this target. The filter_table function allows you to filter by several additional parameters. These are: - exposure time (exptime) - the data pipline (pipeline) - the total number of results (limit).
In addition, KeplerSearch objects can be filtered by quarter/month, TESSSearch objects by sector, and K2Search objects by campaign.
[12]:
# Keep any data type, but only the shortest cadence available, which in this case is 2-minute data
toi_shortest = toi.filter_table(exptime="shortest")
toi_shortest
[12]:
target_name | pipeline | mission | sector | exptime | distance | year | description | |
---|---|---|---|---|---|---|---|---|
0 | 158324245 | SPOC | TESS | 74 | 20.0 | 0.0 | 2024 | Target pixel files |
1 | 158324245 | SPOC | TESS | 74 | 20.0 | 0.0 | 2024 | Light curves |
2 | 1717079066 | SPOC | TESS | 74 | 20.0 | 0.0 | 2024 | Light curves |
3 | 1717079066 | SPOC | TESS | 74 | 20.0 | 0.0 | 2024 | Target pixel files |
4 | 1717079066 | SPOC | TESS | 75 | 20.0 | 0.0 | 2024 | Light curves |
5 | 1717079066 | SPOC | TESS | 75 | 20.0 | 0.0 | 2024 | Target pixel files |
6 | 158324245 | SPOC | TESS | 75 | 20.0 | 0.0 | 2024 | Target pixel files |
7 | 158324245 | SPOC | TESS | 75 | 20.0 | 0.0 | 2024 | Light curves |
[13]:
# You could also specify an exact exposure time or range in the form of a tuple (eg, (100,500))
toi_trange = toi.filter_table(exptime=(100, 500))
toi_trange
[13]:
target_name | pipeline | mission | sector | exptime | distance | year | description | |
---|---|---|---|---|---|---|---|---|
0 | 158324245 | SPOC | TESS | 14 | 120.0 | 0.0 | 2019 | Target pixel files |
1 | 158324245 | SPOC | TESS | 14 | 120.0 | 0.0 | 2019 | full data validation report |
2 | 158324245 | SPOC | TESS | 14 | 120.0 | 0.0 | 2019 | Data validation mini report |
3 | 158324245 | SPOC | TESS | 14 | 120.0 | 0.0 | 2019 | TCE summary report |
4 | 158324245 | SPOC | TESS | 14 | 120.0 | 0.0 | 2019 | Light curves |
... | ... | ... | ... | ... | ... | ... | ... | ... |
123 | 158324245 | TASOC | HLSP | 15 | 120.0 | 0.0 | 2019 | FITS |
124 | 158324245 | TASOC | HLSP | 26 | 120.0 | 0.0 | 2020 | FITS |
125 | 158324245 | QLP | HLSP | 74 | 200.0 | 0.0 | 2024 | FITS |
126 | 1717079066 | QLP | HLSP | 74 | 200.0 | 0.0 | 2024 | FITS |
127 | 1717079071 | QLP | HLSP | 74 | 200.0 | 0.0 | 2024 | FITS |
128 rows × 8 columns
[14]:
toi_lim = toi.filter_table(limit=2)
toi_lim
[14]:
target_name | pipeline | mission | sector | exptime | distance | year | description | |
---|---|---|---|---|---|---|---|---|
0 | 158324245 | SPOC | TESS | 14 | 120.0 | 0.0 | 2019 | Target pixel files |
1 | 158324245 | SPOC | TESS | 14 | 120.0 | 0.0 | 2019 | full data validation report |
Keep in mind, you can chain these commands
[15]:
toi_short_lcs = toi.timeseries.filter_table(exptime=120, sector=14)
toi_short_lcs
[15]:
target_name | pipeline | mission | sector | exptime | distance | year | description | |
---|---|---|---|---|---|---|---|---|
0 | 158324245 | SPOC | TESS | 14 | 120.0 | 0.0 | 2019 | Light curves |
1 | 158324245 | TASOC | HLSP | 14 | 120.0 | 0.0 | 2019 | FITS |
Once your search result contains the files you want, you can download the files directly to your machine.
[16]:
toi_short_lcs.download()
pipeline products: 100%|████████████████████████████████████████████| 2/2 [00:00<00:00, 4.27it/s]
[16]:
Local Path | Status | Message | URL | |
---|---|---|---|---|
0 | /Users/tapritc2/.lksearch/cache/mastDownload/T... | COMPLETE | None | None |
1 | /Users/tapritc2/.lksearch/cache/mastDownload/H... | COMPLETE | None | None |
You can also query the pandas Dataframe back end to perform more complicated searches. For example, the above could also be perfomed via:
[17]:
toi_short_lcs = toi.timeseries.query_table("sector == 14 & exptime == 120")
toi_short_lcs
[17]:
target_name | pipeline | mission | sector | exptime | distance | year | description | |
---|---|---|---|---|---|---|---|---|
0 | 158324245 | SPOC | TESS | 14 | 120.0 | 0.0 | 2019 | Light curves |
1 | 158324245 | TASOC | HLSP | 14 | 120.0 | 0.0 | 2019 | FITS |
TESScut FFI Cutouts#
In addition to lightcurves and target pixel files, TESS provides Full Frame Image (FFI) data. This data was taken at a cadence of 30 minutes during the primary mission, 10 minutes during the first extension, and 200-seconds beginning in the second mission extension.
lksearch allows users to download entire FFIs, or make smaller cutouts around a target of interest using TESScut. All of this functionality if available with the TESSSearch object.
Find and download TESScut TPFs#
[18]:
search_result = TESSSearch("TOI 270", hlsp=False)
# You can filter two different ways to get the same result.
# search_result.filter_table(pipeline='TESScut')
search_result.tesscut
[18]:
target_name | pipeline | mission | sector | exptime | distance | year | description | |
---|---|---|---|---|---|---|---|---|
0 | TOI 270 | TESScut | TESS Sector 03 | 3 | 1800.0 | 0.0 | 2018 | TESS FFI Cutout (sector 3) |
1 | TOI 270 | TESScut | TESS Sector 04 | 4 | 1800.0 | 0.0 | 2018 | TESS FFI Cutout (sector 4) |
2 | TOI 270 | TESScut | TESS Sector 05 | 5 | 1800.0 | 0.0 | 2018 | TESS FFI Cutout (sector 5) |
3 | TOI 270 | TESScut | TESS Sector 30 | 30 | 600.0 | 0.0 | 2020 | TESS FFI Cutout (sector 30) |
4 | TOI 270 | TESScut | TESS Sector 31 | 31 | 600.0 | 0.0 | 2020 | TESS FFI Cutout (sector 31) |
5 | TOI 270 | TESScut | TESS Sector 32 | 32 | 600.0 | 0.0 | 2020 | TESS FFI Cutout (sector 32) |
For TESScut images, you can specify how large you want the cutout to be in pixels when you download the data using the TESScut_size keyword. By default, it will download a 10-pixel square image. If you use set this keyword when downloading non-TESScut data, it will be ignored.
[19]:
search_result.tesscut.filter_table(sector=3).download(TESScut_size=20)
TESScut : 100%|████████████████████████████████████████████| 1/1 [00:08<00:00, 8.03s/it]
[19]:
Local Path | Status | |
---|---|---|
0 | /Users/tapritc2/.lksearch/cache/mastDownload/T... | COMPLETE |
Kepler Search#
The call to KeplerSearch saves all availabe data products for the target as a table. Like with the other search objects, there are several convenient functions to limit the results to timeseries (lighcurve), cubedata (target pixel files and, in the case of TESS only, full frame image cutouts), dvreports (PDF data validation reports generated by the data pipelines), mission_products, and HLSPs. Calling these functions returns a new search object.
[23]:
# What timeseries data is available?
kep = KeplerSearch("Kepler 137")
kep
[23]:
target_name | pipeline | mission | quarter | exptime | distance | year | description | |
---|---|---|---|---|---|---|---|---|
0 | kplr007419318 | Kepler | Kepler | 0 | 1800.000 | 0.0 | 2009 | Lightcurve Long Cadence (CLC) - Q0 |
1 | kplr007419318 | Kepler | Kepler | 0 | 1800.000 | 0.0 | 2009 | Target Pixel Long Cadence (TPL) - Q0 |
2 | kplr007419318 | Kepler | Kepler | 1 | 1800.000 | 0.0 | 2009 | Lightcurve Long Cadence (CLC) - Q1 |
3 | kplr007419318 | Kepler | Kepler | 1 | 1800.000 | 0.0 | 2009 | Target Pixel Long Cadence (TPL) - Q1 |
4 | kplr007419318 | Kepler | Kepler | 2 | 1800.000 | 0.0 | 2009 | Lightcurve Long Cadence (CLC) - Q2 |
... | ... | ... | ... | ... | ... | ... | ... | ... |
77 | kplr007419318 | Kepler | Kepler | 17 | 1800.000 | 0.0 | 2013 | Target Pixel Long Cadence (TPL) - Q17 |
78 | kplr007419318 | Kepler | Kepler | 99 | 1800.000 | 0.0 | 2009 | Data Validation full report |
79 | kplr007419318 | Kepler | Kepler | 99 | 1800.000 | 0.0 | 2009 | Data Validation summary report |
80 | kplr007419318 | Kepler | Kepler | 99 | 1800.000 | 0.0 | 2009 | Data Validation summary report |
81 | Gaia DR3 2104847370214740352 | KBONUS-BKG | HLSP | 99 | 1765.464 | 0.0 | 2009 | FITS |
82 rows × 8 columns
[24]:
kep_lc = kep.timeseries
kep_lc
[24]:
target_name | pipeline | mission | quarter | exptime | distance | year | description | |
---|---|---|---|---|---|---|---|---|
0 | kplr007419318 | Kepler | Kepler | 0 | 1800.000 | 0.0 | 2009 | Lightcurve Long Cadence (CLC) - Q0 |
1 | kplr007419318 | Kepler | Kepler | 1 | 1800.000 | 0.0 | 2009 | Lightcurve Long Cadence (CLC) - Q1 |
2 | kplr007419318 | Kepler | Kepler | 2 | 1800.000 | 0.0 | 2009 | Lightcurve Long Cadence (CLC) - Q2 |
3 | kplr007419318 | Kepler | Kepler | 3 | 1800.000 | 0.0 | 2009 | Lightcurve Long Cadence (CLC) - Q3 |
4 | kplr007419318 | Kepler | Kepler | 4 | 1800.000 | 0.0 | 2010 | Lightcurve Long Cadence (CLC) - Q4 |
... | ... | ... | ... | ... | ... | ... | ... | ... |
35 | kplr007419318 | Kepler | Kepler | 14 | 1800.000 | 0.0 | 2012 | Lightcurve Long Cadence (CLC) - Q14 |
36 | kplr007419318 | Kepler | Kepler | 15 | 1800.000 | 0.0 | 2013 | Lightcurve Long Cadence (CLC) - Q15 |
37 | kplr007419318 | Kepler | Kepler | 16 | 1800.000 | 0.0 | 2013 | Lightcurve Long Cadence (CLC) - Q16 |
38 | kplr007419318 | Kepler | Kepler | 17 | 1800.000 | 0.0 | 2013 | Lightcurve Long Cadence (CLC) - Q17 |
39 | Gaia DR3 2104847370214740352 | KBONUS-BKG | HLSP | 99 | 1765.464 | 0.0 | 2009 | FITS |
40 rows × 8 columns
[25]:
# You can download a subsection of results directly
kep_lc[:2].download()
pipeline products: 100%|████████████████████████████████████████████| 2/2 [00:00<00:00, 3.32it/s]
[25]:
Local Path | Status | Message | URL | |
---|---|---|---|---|
0 | /Users/tapritc2/.lksearch/cache/mastDownload/K... | COMPLETE | None | None |
1 | /Users/tapritc2/.lksearch/cache/mastDownload/K... | COMPLETE | None | None |
Notice that when downloading, a table is printed out showing the status of the download. You can save this table and explore it in more detail, if desired.
[26]:
# You can download a subsection of results directly
manifest = kep[:2].download()
print(manifest["Local Path"].values)
pipeline products: 100%|████████████████████████████████████████████| 2/2 [00:00<00:00, 3.98it/s]
['/Users/tapritc2/.lksearch/cache/mastDownload/Kepler/kplr007419318_lc_Q111111111111111111/kplr007419318-2009131105131_llc.fits'
'/Users/tapritc2/.lksearch/cache/mastDownload/Kepler/kplr007419318_lc_Q111111111111111111/kplr007419318-2009131105131_lpd-targ.fits.gz']
[27]:
# we can also filter the results by observing quarter
kep_quarters = kep.filter_table(quarter=[7, 17])
kep_quarters
[27]:
target_name | pipeline | mission | quarter | exptime | distance | year | description | |
---|---|---|---|---|---|---|---|---|
0 | kplr007419318 | Kepler | Kepler | 7 | 60.0 | 0.0 | 2010 | Lightcurve Short Cadence (CSC) - Q7 |
1 | kplr007419318 | Kepler | Kepler | 7 | 60.0 | 0.0 | 2010 | Lightcurve Short Cadence (CSC) - Q7 |
2 | kplr007419318 | Kepler | Kepler | 7 | 60.0 | 0.0 | 2010 | Target Pixel Short Cadence (TPS) - Q7 |
3 | kplr007419318 | Kepler | Kepler | 7 | 60.0 | 0.0 | 2010 | Target Pixel Short Cadence (TPS) - Q7 |
4 | kplr007419318 | Kepler | Kepler | 7 | 60.0 | 0.0 | 2010 | Target Pixel Short Cadence (TPS) - Q7 |
5 | kplr007419318 | Kepler | Kepler | 7 | 60.0 | 0.0 | 2010 | Lightcurve Short Cadence (CSC) - Q7 |
6 | kplr007419318 | Kepler | Kepler | 7 | 1800.0 | 0.0 | 2010 | Target Pixel Long Cadence (TPL) - Q7 |
7 | kplr007419318 | Kepler | Kepler | 7 | 1800.0 | 0.0 | 2010 | Lightcurve Long Cadence (CLC) - Q7 |
8 | kplr007419318 | Kepler | Kepler | 17 | 1800.0 | 0.0 | 2013 | Lightcurve Long Cadence (CLC) - Q17 |
9 | kplr007419318 | Kepler | Kepler | 17 | 1800.0 | 0.0 | 2013 | Target Pixel Long Cadence (TPL) - Q17 |
K2 Search#
K2Search behaves in much the same way as Kepler. As with Kepler, both mission products and HLSPs are returned by default. Note that instead of quarters, the K2 mission was separated by campaign.
[28]:
K2 = K2Search("K2-18")
K2
[28]:
target_name | pipeline | mission | campaign | exptime | distance | year | description | |
---|---|---|---|---|---|---|---|---|
0 | ktwo201912552 | K2 | K2 | 1 | 1800.0 | 0.0 | 2014 | Target Pixel Long Cadence (KTL) - C01 |
1 | ktwo201912552 | K2 | K2 | 1 | 1800.0 | 0.0 | 2014 | Lightcurve Long Cadence (KLC) - C01 |
2 | ktwo201912552 | EVEREST | HLSP | 1 | 1800.0 | 0.0 | 2014 | FITS |
3 | ktwo201912552 | EVEREST | HLSP | 1 | 1800.0 | 0.0 | 2014 | |
4 | ktwo201912552 | K2SFF | HLSP | 1 | 1800.0 | 0.0 | 2014 | FITS |
5 | ktwo201912552 | K2VARCAT | HLSP | 1 | 1800.0 | 0.0 | 2014 | FITS |
[29]:
# Download all lightcurves produced by HLSPs
K2_HLSPs = K2.HLSPs
K2_HLSPs
[29]:
target_name | pipeline | mission | campaign | exptime | distance | year | description | |
---|---|---|---|---|---|---|---|---|
0 | ktwo201912552 | EVEREST | HLSP | 1 | 1800.0 | 0.0 | 2014 | FITS |
1 | ktwo201912552 | EVEREST | HLSP | 1 | 1800.0 | 0.0 | 2014 | |
2 | ktwo201912552 | K2SFF | HLSP | 1 | 1800.0 | 0.0 | 2014 | FITS |
3 | ktwo201912552 | K2VARCAT | HLSP | 1 | 1800.0 | 0.0 | 2014 | FITS |
[30]:
manifest = K2_HLSPs.timeseries.download()
manifest
pipeline products: 100%|████████████████████████████████████████████| 3/3 [00:01<00:00, 2.02it/s]
[30]:
Local Path | Status | Message | URL | |
---|---|---|---|---|
0 | /Users/tapritc2/.lksearch/cache/mastDownload/H... | COMPLETE | None | None |
1 | /Users/tapritc2/.lksearch/cache/mastDownload/H... | COMPLETE | None | None |
2 | /Users/tapritc2/.lksearch/cache/mastDownload/H... | COMPLETE | None | None |