What are Light Curve File objects?

In the previous tutorial we looked at LightCurve objects, which contain time and flux points. Now we will look at LightCurveFiles. Rather than being generated by you using a Target Pixel File, these files have been pregenerated using NASA’s Kepler Data Processing Pipeline. Usually, you will access these files through the MAST archive.

We will demonstrate the difference between a LightCurve and a LightCurveFile using data from Kepler.

Kepler light curves from MAST have some level of processing (more details here) and allow you to access the two kinds of flux; the SAP flux and the PDCSAP flux. SAP flux is Simple Aperture Photometry flux, the same as we made in the previous tutorial. PDCSAP is the Pre-search Data Conditioning SAP flux. Long term trends have been removed from this data using so-called Cotrending Basis Vectors (CBVs). PDCSAP flux is usually slightly cleaner data than the SAP flux and will have fewer long term trends.

We can read in a light curve file from the Kepler mission using KeplerLightCurveFile. We can use the same from_archive function as before.

In [1]:
from lightkurve import KeplerLightCurveFile
lcf = KeplerLightCurveFile.from_archive(6922244, quarter=4)
Downloading URL https://mast.stsci.edu/api/v0/download/file?uri=mast:Kepler/url/missions/kepler/lightcurves/0069/006922244/kplr006922244-2010078095331_llc.fits to ./mastDownload/Kepler/kplr006922244_lc_Q111111111111111111/kplr006922244-2010078095331_llc.fits ... [Done]

lcf is now a KeplerLightCurveFile object. In this case it contains two KeplerLightCurve objects, one for the SAP flux and one for the PDCSAP flux. The plot method on a KeplerLightCurveFile object will plot up both of these.

In [3]:

We can see that the PDCSAP flux is flatter. To work more with this data we must choose which type of flux we want to work with. Let’s choose PDCSAP flux:

In [4]:
pdcsap = lcf.PDCSAP_FLUX

You can choose SAP flux in a similar way using

sapflux = lcf.SAP_FLUX
In [5]:
KeplerLightCurveFile(KIC: 6922244)
In [6]:
KeplerLightCurve(KIC: 6922244)

This has created a KeplerLightCurve object. The only flux it contains is the PDCSAP flux. This has the same methods we used in the previous tutorial. For example you can check the meta data and the CDPP noise metric:

In [7]:
In [8]:
In [9]: