lightkurve.search_lightcurve#
- lightkurve.search_lightcurve(target, radius=None, exptime=None, cadence=None, mission=('Kepler', 'K2', 'TESS'), author=None, quarter=None, month=None, campaign=None, sector=None, limit=None)[source]#
Search the MAST data archive for light curves.
This function fetches a data table that lists the Light Curve Files that fall within a region of sky centered around the position of
target
and within a cone of a givenradius
. If no value is provided forradius
, only a single target will be returned.- Parameters
- targetstr, int, or
astropy.coordinates.SkyCoord
object Target around which to search. Valid inputs include:
The name of the object as a string, e.g. “Kepler-10”.
The KIC or EPIC identifier as an integer, e.g. 11904151.
A coordinate string in decimal format, e.g. “285.67942179 +50.24130576”.
A coordinate string in sexagesimal format, e.g. “19:02:43.1 +50:14:28.7”.
An
astropy.coordinates.SkyCoord
object.
- radiusfloat or
astropy.units.Quantity
object Conesearch radius. If a float is given it will be assumed to be in units of arcseconds. If
None
then we default to 0.0001 arcsec.- exptime‘long’, ‘short’, ‘fast’, or float
‘long’ selects 10-min and 30-min cadence products; ‘short’ selects 1-min and 2-min products; ‘fast’ selects 20-sec products. Alternatively, you can pass the exact exposure time in seconds as an int or a float, e.g.,
exptime=600
selects 10-minute cadence. By default, all cadence modes are returned.- cadence‘long’, ‘short’, ‘fast’, or float
Synonym for
exptime
. This keyword will likely be deprecated in the future.- missionstr, tuple of str
‘Kepler’, ‘K2’, or ‘TESS’. By default, all will be returned.
- authorstr, tuple of str, or “any”
Author of the data product (
provenance_name
in the MAST API). Official Kepler, K2, and TESS pipeline products have author names ‘Kepler’, ‘K2’, and ‘SPOC’. Community-provided products that are supported include ‘K2SFF’, ‘EVEREST’. By default, all light curves are returned regardless of the author.- quarter, campaign, sectorint, list of ints
Kepler Quarter, K2 Campaign, or TESS Sector number. By default all quarters/campaigns/sectors will be returned.
- month1, 2, 3, 4 or list of int
For Kepler’s prime mission, there are three short-cadence TargetPixelFiles for each quarter, each covering one month. Hence, if
exptime='short'
you can specify month=1, 2, 3, or 4. By default all months will be returned.- limitint
Maximum number of products to return.
- targetstr, int, or
- Returns
- result
SearchResult
object Object detailing the data products found.
- result
Examples
This example demonstrates how to use the
search_lightcurve()
function to query and download data. Before instantiating aLightCurve
object or downloading any science products, we can identify potential desired targets withsearch_lightcurve
:>>> from lightkurve import search_lightcurve >>> search_result = search_lightcurve("Kepler-10") >>> print(search_result)
The above code will query mast for lightcurve files available for the known planet system Kepler-10, and display a table containing the available data products. Because Kepler-10 was observed in multiple quarters and sectors by both Kepler and TESS, the search will return many dozen results. If we want to narrow down the search to only return Kepler light curves in long cadence, we can use:
>>> search_result = search_lightcurve("Kepler-10", author="Kepler", exptime=1800) >>> print(search_result)
That is better, we now see 15 light curves corresponding to 15 Kepler quarters. If we want to download a
LightCurveCollection
object containing all 15 observations, use:>>> search_result.download_all()
or we can specify the downloaded products by selecting a specific row using rectangular brackets, for example:
>>> lc = search_result[2].download()
The above line of code will only search and download Quarter 2 data and create a
LightCurve
object called lc.We can also pass a radius into
search_lightcurve
to perform a cone search:>>> search_lightcurve('Kepler-10', radius=100, quarter=4, exptime=1800)
This will display a table containing all targets within 100 arcseconds of Kepler-10 and in Quarter 4. We can then download a
LightCurveFile
containing all these light curves using:>>> search_lightcurve('Kepler-10', radius=100, quarter=4, exptime=1800).download_all()