open, **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").
path_or_url : str

Path or URL of a FITS file.

data : a subclass of TargetPixelFile or LightCurveFile,

depending on the detected file type.

ValueError : raised if the data product is not recognized as a Kepler or

TESS product.


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

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

Created with ♥ by the Lightkurve developers. Join us on GitHub.