lightkurve.SearchResult.download

SearchResult.download(quality_bitmask='default', download_dir=None, cutout_size=None, **kwargs)[source]

Download and open the first data product in the search result.

If multiple files are present in SearchResult.table, only the first will be downloaded.

Parameters
quality_bitmaskstr or int, optional

Bitmask (integer) which identifies the quality flag bitmask that should be used to mask out bad cadences. If a string is passed, it has the following meaning:

  • “none”: no cadences will be ignored

  • “default”: cadences with severe quality issues will be ignored

  • “hard”: more conservative choice of flags to ignore This is known to remove good data.

  • “hardest”: removes all data that has been flagged This mask is not recommended.

See the KeplerQualityFlags or TessQualityFlags class for details on the bitmasks.

download_dirstr, optional

Location where the data files will be stored. Defaults to “~/.lightkurve-cache” if None is passed.

cutout_sizeint, float or tuple, optional

Side length of cutout in pixels. Tuples should have dimensions (y, x). Default size is (5, 5)

flux_columnstr, optional

The column in the FITS file to be read as flux. Defaults to ‘pdcsap_flux’. Typically ‘pdcsap_flux’ or ‘sap_flux’.

kwargsdict, optional

Extra keyword arguments passed on to the file format reader function.

Returns
dataTargetPixelFile or LightCurve object

The first entry in the products table.

Raises
HTTPError

If the TESSCut service times out (i.e. returns HTTP status 504).

SearchError

If any other error occurs.