Lightkurve v2.0
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.
LightCurve
TimeSeries
Table
time
flux
flux_err
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.
data
LightCurve([data, time, flux, flux_err])
Subclass of AstroPy Table guaranteed to have time, flux, and flux_err columns.
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
LightCurve["time"]
Time values stored as an AstroPy Time object.
Time
LightCurve.flux
Brightness values stored as an AstroPy Quantity object.
Quantity
LightCurve.flux_err
Brightness uncertainties stored as an AstroPy Quantity object.
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"].
meta
LightCurve.sector
LightCurve.meta["sector"]
LightCurve.meta
LightCurve.plot(**kwargs)
LightCurve.plot
Plot the light curve using Matplotlib’s plot method.
plot
LightCurve.scatter([colorbar_label, …])
LightCurve.scatter
Plots the light curve using Matplotlib’s scatter method.
scatter
LightCurve.errorbar([linestyle])
LightCurve.errorbar
Plots the light curve using Matplotlib’s errorbar method.
errorbar
LightCurve.plot_river(period[, epoch_time, …])
LightCurve.plot_river
Plot the light curve as a river plot.
The following methods all return a new LightCurve object.
LightCurve.append(others[, inplace])
LightCurve.append
Append one or more other LightCurve object(s) to this one.
LightCurve.copy([copy_data])
LightCurve.copy
Return a copy of the table.
LightCurve.bin([time_bin_size, …])
LightCurve.bin
Bins a lightcurve in equally-spaced bins in time.
LightCurve.fill_gaps([method])
LightCurve.fill_gaps
Fill in gaps in time.
LightCurve.flatten([window_length, …])
LightCurve.flatten
Removes the low frequency trend using scipy’s Savitzky-Golay filter.
LightCurve.fold([period, epoch_time, …])
LightCurve.fold
Returns a FoldedLightCurve object folded on a period and epoch.
FoldedLightCurve
LightCurve.normalize([unit])
LightCurve.normalize
Returns a normalized version of the light curve.
LightCurve.remove_nans([column])
LightCurve.remove_nans
Removes cadences where column is a NaN.
column
LightCurve.remove_outliers([sigma, …])
LightCurve.remove_outliers
Removes outlier data points using sigma-clipping.
LightCurve.to_corrector([method])
LightCurve.to_corrector
Returns a corrector object to remove instrument systematics.
LightCurve.to_csv([path_or_buf])
LightCurve.to_csv
Writes the light curve to a CSV file.
LightCurve.to_fits([path, overwrite, …])
LightCurve.to_fits
Converts the light curve to a FITS file in the Kepler/TESS file format.
LightCurve.to_pandas()
LightCurve.to_pandas
Convert this TimeSeries to a DataFrame with a DatetimeIndex index.
DataFrame
DatetimeIndex
LightCurve.to_periodogram([method])
LightCurve.to_periodogram
Converts the light curve to a Periodogram power spectrum object.
Periodogram
LightCurve.to_seismology(**kwargs)
LightCurve.to_seismology
Returns a Seismology object for estimating quick-look asteroseismic quantities.
Seismology
LightCurve.to_table()
LightCurve.to_table
LightCurve.read(filename[, time_column, …])
LightCurve.read
Read and parse a file and returns a astropy.timeseries.TimeSeries.
astropy.timeseries.TimeSeries
LightCurve.write
LightCurve.estimate_cdpp([transit_duration, …])
LightCurve.estimate_cdpp
Estimate the CDPP noise metric using the Savitzky-Golay (SG) method.
LightCurve.query_solar_system_objects([…])
LightCurve.query_solar_system_objects
Returns a list of asteroids or comets which affected the light curve.
LightCurve.interact_bls([notebook_url, …])
LightCurve.interact_bls
Display an interactive Jupyter Notebook widget to find planets.
LightCurve.create_transit_mask(period, …)
LightCurve.create_transit_mask
Returns a boolean array that is True during transits and False elsewhere.
True
False
LightCurve.search_neighbors([limit, radius])
LightCurve.search_neighbors
Search the data archive at MAST for the most nearby light curves.