KeplerLightCurveFile

class lightkurve.lightcurvefile.KeplerLightCurveFile(path, quality_bitmask='default', **kwargs)

Bases: lightkurve.lightcurvefile.LightCurveFile

Subclass of LightCurveFile to represent files generated by NASA’s Kepler pipeline.

Parameters
pathstr

Local path or remote url of a FITS file in Kepler’s lightcurve format.

quality_bitmaskstr or int

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 (quality_bitmask=0).

  • “default”: cadences with severe quality issues will be ignored (quality_bitmask=1130799).

  • “hard”: more conservative choice of flags to ignore (quality_bitmask=1664431). This is known to remove good data.

  • “hardest”: removes all data that has been flagged (quality_bitmask=2096639). This mask is not recommended.

See the KeplerQualityFlags class for details on the bitmasks.

kwargsdict

Keyword arguments to be passed to astropy.io.fits.open.

Attributes Summary

PDCSAP_FLUX

Returns a LightCurve object for PDCSAP_FLUX

SAP_FLUX

Returns a LightCurve object for SAP_FLUX

astropy_time

Returns an AstroPy Time object for all good-quality cadences.

cadenceno

Cadence number

campaign

K2 Campaign number.

channel

Kepler CCD channel number.

dec

Declination of the target.

mission

‘Kepler’ or ‘K2’.

obsmode

‘short cadence’ or ‘long cadence’.

pos_corr1

Returns the column position correction.

pos_corr2

Returns the row position correction.

quarter

Kepler quarter number.

ra

Right Ascension of the target.

time

Time measurements

Methods Summary

compute_cotrended_lightcurve(self[, cbvs])

Returns a LightCurve object after cotrending the SAP_FLUX against the cotrending basis vectors.

get_lightcurve(self, flux_type[, centroid_type])

header(self[, ext])

Header of the object at extension ext

plot(self[, flux_types, style])

Plot the light curve file using matplotlib’s plot method.

Attributes Documentation

PDCSAP_FLUX

Returns a LightCurve object for PDCSAP_FLUX

SAP_FLUX

Returns a LightCurve object for SAP_FLUX

astropy_time

Returns an AstroPy Time object for all good-quality cadences.

cadenceno

Cadence number

campaign

K2 Campaign number. (‘CAMPAIGN’ header keyword)

channel

Kepler CCD channel number. (‘CHANNEL’ header keyword)

dec

Declination of the target.

mission

‘Kepler’ or ‘K2’. (‘MISSION’ header keyword)

obsmode

‘short cadence’ or ‘long cadence’. (‘OBSMODE’ header keyword)

pos_corr1

Returns the column position correction.

pos_corr2

Returns the row position correction.

quarter

Kepler quarter number. (‘QUARTER’ header keyword)

ra

Right Ascension of the target.

time

Time measurements

Methods Documentation

compute_cotrended_lightcurve(self, cbvs=(1, 2), **kwargs)

Returns a LightCurve object after cotrending the SAP_FLUX against the cotrending basis vectors.

Parameters
cbvstuple or list of ints

The list of cotrending basis vectors to fit to the data. For example, (1, 2) will fit the first two basis vectors.

kwargsdict

Dictionary of keyword arguments to be passed to KeplerCBVCorrector.correct.

Returns
lcLightCurve object

CBV flux-corrected lightcurve.

get_lightcurve(self, flux_type, centroid_type='MOM_CENTR')
header(self, ext=0)

Header of the object at extension ext

plot(self, flux_types=None, style='lightkurve', **kwargs)

Plot the light curve file using matplotlib’s plot method.

Parameters
axmatplotlib.axes._subplots.AxesSubplot

A matplotlib axes object to plot into. If no axes is provided, a new one will be generated.

flux_typeslist or None

Which fluxes in the LCF to plot. Default is lcf._flux_types(). For Kepler this is PDCSAP and SAP flux. Pass a list to change flux types.

normalizebool

Normalize the lightcurve before plotting?

xlabelstr

Plot x axis label

ylabelstr

Plot y axis label

titlestr

Plot set_title

stylestr

Path or URL to a matplotlib style file, or name of one of matplotlib’s built-in stylesheets (e.g. ‘ggplot’). Lightkurve’s custom stylesheet is used by default.

kwargsdict

Dictionary of arguments to be passed to matplotlib.pyplot.plot.

Returns
axmatplotlib.axes._subplots.AxesSubplot

The matplotlib axes object.


Created with ♥ by the Lightkurve collaboration. Please cite us or join us on GitHub.