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:
path : str

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

quality_bitmask : str 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.

kwargs : dict

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([cbvs]) Returns a LightCurve object after cotrending the SAP_FLUX against the cotrending basis vectors.
from_archive(target[, cadence, quarter, …]) WARNING: THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED VERY SOON.
from_fits(path_or_url, **kwargs) WARNING: THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED VERY SOON.
get_lightcurve(flux_type[, centroid_type])
header([ext]) Header of the object at extension ext
plot([flux_types, style]) Plot all the light curves contained in this light curve file.

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(cbvs=[1, 2], **kwargs)

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

Parameters:
cbvs : 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.

kwargs : dict

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

Returns:
lc : LightCurve object

CBV flux-corrected lightcurve.

static from_archive(target, cadence='long', quarter=None, month=None, campaign=None, quality_bitmask='default', **kwargs)

WARNING: THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED VERY SOON. Use lightkurve.search_lightcurvefile() instead.

Parameters:
target : str or int

KIC/EPIC ID or object name.

cadence : str

‘long’ or ‘short’.

quarter, campaign : int, list of ints, or ‘all’

Kepler Quarter or K2 Campaign number.

month : 1, 2, 3, list of int, or ‘all’

For Kepler’s prime mission, there are three short-cadence LightCurveFile objects for each quarter, each covering one month. Hence, if cadence=’short’ you need to specify month=1, 2, or 3.

quality_bitmask : str 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.

kwargs : dict

Keywords arguments passed to KeplerLightCurveFile.

Returns:
lcf : KeplerLightCurveFile or LightCurveFileCollection
classmethod from_fits(path_or_url, **kwargs)

WARNING: THIS FUNCTION IS DEPRECATED AND WILL BE REMOVED VERY SOON.

Please use lightkurve.open() instead.

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

Header of the object at extension ext

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

Plot all the light curves contained in this light curve file.

Parameters:
flux_types : str or list of str

List of flux types to plot. Default is to plot all available. (For Kepler the default fluxes are ‘SAP_FLUX’ and ‘PDCSAP_FLUX’.

style : str

matplotlib.pyplot.style.context, default is ‘fast’

kwargs : dict

Dictionary of keyword arguments to be passed to KeplerLightCurve.plot().


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