LightCurveFile

class lightkurve.lightcurvefile.LightCurveFile(path, **kwargs)

Bases: object

Generic class to represent FITS files which contain one or more light curves.

Parameters
pathstr or astropy.io.fits.HDUList object

Local path or remote url of a lightcurve FITS file. Also accepts a FITS file object already opened using AstroPy.

kwargsdict

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

Attributes Summary

FLUX

Returns a LightCurve object based on the contents of the FLUX column in the file, if that column exists.

PDCSAP_FLUX

Returns a LightCurve object based on the contents of the PDCSAP_FLUX column in the file, if that column exists.

SAP_FLUX

Returns a LightCurve object based on the contents of the SAP_FLUX column in the file, if that column exists.

cadenceno

The file’s CADENCENO column.

dec

Declination as recorded in the header’s DEC_OBJ keyword.

ra

Right Ascension as recorded in the header’s RA_OBJ keyword.

time

The file’s TIME column.

Methods Summary

errorbar(self[, flux_types, style])

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

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.

scatter(self[, flux_types, style])

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

Attributes Documentation

FLUX

Returns a LightCurve object based on the contents of the FLUX column in the file, if that column exists.

PDCSAP_FLUX

Returns a LightCurve object based on the contents of the PDCSAP_FLUX column in the file, if that column exists.

SAP_FLUX

Returns a LightCurve object based on the contents of the SAP_FLUX column in the file, if that column exists.

cadenceno

The file’s CADENCENO column.

dec

Declination as recorded in the header’s DEC_OBJ keyword.

ra

Right Ascension as recorded in the header’s RA_OBJ keyword.

time

The file’s TIME column.

Methods Documentation

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

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

Parameters
axAxes

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
axAxes

The matplotlib axes object.

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
axAxes

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
axAxes

The matplotlib axes object.

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

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

Parameters
axAxes

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
axAxes

The matplotlib axes object.