open

lightkurve.search.open(path_or_url, **kwargs)

Opens any valid Kepler or TESS data file and returns an instance of LightCurveFile or TargetPixelFile.

This function will use the detect_filetype() function to automatically detect the type of the data product, and return the appropriate object. File types currently supported are:

* `KeplerTargetPixelFile` (typical suffix "-targ.fits.gz");
* `KeplerLightCurveFile` (typical suffix "llc.fits");
* `TessTargetPixelFile` (typical suffix "_tp.fits");
* `TessLightCurveFile` (typical suffix "_lc.fits").
Parameters
path_or_urlstr

Path or URL of a FITS file.

Returns
dataa subclass of TargetPixelFile or

LightCurveFile, depending on the detected file type.

Raises
ValueErrorraised if the data product is not recognized as a Kepler or

TESS product.

Examples

To open a target pixel file using its path or URL, simply use:

>>> tpf = open("mytpf.fits")  # doctest: +SKIP