LightCurve#

The LightCurve class is an extension of AstroPy’s TimeSeries object, which itself extends AstroPy’s Table. Compared to a generic Table, LightCurve objects enforce the presence of three special data columns: time, flux, and flux_err. This enables a LightCurve object to offer a range of methods which are specific to working with flux-based time series data.

Constructor#

Light curves can be instantiated by passing array-like values to the time, flux, and flux_err parameters. Additional columns can be added by passing a table-like object to the data parameter.

LightCurve([data, time, flux, flux_err])

Subclass of AstroPy Table guaranteed to have time, flux, and flux_err columns.

Attributes#

Another difference with AstroPy Table is that all columns can be accessed conveniently as attributes. For example, LightCurve.time is offered as a shorthand for LightCurve["time"].

LightCurve.time

Time values stored as an AstroPy Time object.

LightCurve.flux

Brightness values stored as an AstroPy Quantity object.

LightCurve.flux_err

Brightness uncertainties stored as an AstroPy Quantity object.

Metadata#

All meta data are stored in the meta dictionary. For convenience, meta data can be accessed as object attributes, e.g. LightCurve.sector is a short-hand for LightCurve.meta["SECTOR"].

LightCurve.meta

Plotting#

LightCurve.plot(**kwargs)

Plot the light curve using Matplotlib's plot method.

LightCurve.scatter([colorbar_label, ...])

Plots the light curve using Matplotlib's scatter method.

LightCurve.errorbar([linestyle])

Plots the light curve using Matplotlib's errorbar method.

LightCurve.plot_river(period[, epoch_time, ...])

Plot the light curve as a river plot.

MPLSTYLE

Lightkurve's stylesheet for matplotlib.

Data manipulation#

The following methods all return a new LightCurve object.

LightCurve.append(others[, inplace])

Append one or more other LightCurve object(s) to this one.

LightCurve.copy([copy_data])

Return a copy of the table.

LightCurve.bin([time_bin_size, ...])

Bins a lightcurve in equally-spaced bins in time.

LightCurve.fill_gaps([method])

Fill in gaps in time.

LightCurve.flatten([window_length, ...])

Removes the low frequency trend using scipy's Savitzky-Golay filter.

LightCurve.fold([period, epoch_time, ...])

Returns a FoldedLightCurve object folded on a period and epoch.

LightCurve.head([n])

Return the first n rows.

LightCurve.normalize([unit])

Returns a normalized version of the light curve.

LightCurve.remove_nans([column])

Removes cadences where column is a NaN.

LightCurve.remove_outliers([sigma, ...])

Removes outlier data points using sigma-clipping.

LightCurve.select_flux(flux_column[, ...])

Assign a different column to be the flux column.

LightCurve.tail([n])

Return the last n rows.

LightCurve.truncate([before, after, column])

Truncates the light curve before and after some time value.

Conversions#

LightCurve.to_corrector([method])

Returns a corrector object to remove instrument systematics.

LightCurve.to_csv([path_or_buf])

Writes the light curve to a CSV file.

LightCurve.to_excel(path_or_buf, **kwargs)

Shorthand for to_pandas().to_excel().

LightCurve.to_fits([path, overwrite, ...])

Converts the light curve to a FITS file in the Kepler/TESS file format.

LightCurve.to_pandas(**kwargs)

Converts the light curve to a Pandas DataFrame object.

LightCurve.to_periodogram([method])

Converts the light curve to a Periodogram power spectrum object.

LightCurve.to_seismology(**kwargs)

Returns a Seismology object for estimating quick-look asteroseismic quantities.

LightCurve.to_table()

LightCurve.write

Other Utility Methods#

LightCurve.estimate_cdpp([transit_duration, ...])

Estimate the CDPP noise metric using the Savitzky-Golay (SG) method.

LightCurve.query_solar_system_objects([...])

Returns a list of asteroids or comets which affected the light curve.

LightCurve.interact_bls([notebook_url, ...])

Display an interactive Jupyter Notebook widget to find planets.

LightCurve.create_transit_mask(period, ...)

Returns a boolean array that is True during transits and False elsewhere.

LightCurve.search_neighbors([limit, radius])

Search the data archive at MAST for the most nearby light curves.