lightkurve.search_targetpixelfile#

lightkurve.search_targetpixelfile(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 target pixel files.

This function fetches a data table that lists the Target Pixel Files (TPFs) that fall within a region of sky centered around the position of target and within a cone of a given radius. If no value is provided for radius, 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. 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’. 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.

Returns
resultSearchResult object

Object detailing the data products found.

Examples

This example demonstrates how to use the search_targetpixelfile() function to query and download data. Before instantiating a KeplerTargetPixelFile object or downloading any science products, we can identify potential desired targets with search_targetpixelfile():

>>> search_result = search_targetpixelfile('Kepler-10')  
>>> print(search_result)  

The above code will query mast for Target Pixel Files (TPFs) available for the known planet system Kepler-10, and display a table containing the available science products. Because Kepler-10 was observed during 15 Quarters, the table will have 15 entries. To obtain a TargetPixelFileCollection object containing all 15 observations, use:

>>> search_result.download_all()  

or we can download a single product by limiting our search:

>>> tpf = search_targetpixelfile('Kepler-10', quarter=2).download()  

The above line of code will only download Quarter 2 and create a single KeplerTargetPixelFile object called tpf.

We can also pass a radius into search_targetpixelfile to perform a cone search:

>>> search_targetpixelfile('Kepler-10', radius=100).targets  

This will display a table containing all targets within 100 arcseconds of Kepler-10. We can download a TargetPixelFileCollection object containing all available products for these targets in Quarter 4 with:

>>> search_targetpixelfile('Kepler-10', radius=100, quarter=4).download_all()