LightCurve

class aspros.LightCurve(times=None, fluxes=None, errors=None, quarters=None, name=None)[source]

Bases: object

Container object for light curves.

Parameters
timesndarray

Times in JD

fluxesndarray

Fluxes (normalized or not)

errorsndarray

Uncertainties on the fluxes

quartersndarray (optional)

Kepler Quarter for each flux

namestr

Name this light curve (optional)

Attributes Summary

times_jd

Get the times in this light curve in JD.

Methods Summary

bls(self, periods, duration)

Compute Box Least Squares periodogram

delete_outliers(self)

from_dir(path[, for_stsp])

Load light curve from numpy save files in dir

from_raw_fits(fits_paths[, name])

Load FITS files downloaded from MAST into the LightCurve object.

get_available_quarters(self)

Get which quarters are available in this LightCurve

get_quarter(self, quarter)

Get a copy of the data from within LightCurve during one Kepler quarter.

get_transit_light_curves(self, params[, plots])

For a light curve with transits only (i.e.

mask_in_transit(self, params[, …])

Mask out the in-transit light curve based on transit parameters

mask_out_of_transit(self, params[, …])

Mask out the out-of-transit light curve based on transit parameters

normalize_each_quarter(self[, rename, …])

Use polynomial fit to each quarter to normalize the data.

phases(self, params)

plot(self[, transit_params, ax, quarter, …])

Plot light curve.

save_to(self, path[, overwrite, for_stsp])

Save times, fluxes, errors to new directory dirname in path

split_at_index(self, index)

Split the light curve into two light curves, at index

Attributes Documentation

times_jd

Get the times in this light curve in JD.

Returns
t_jdndarray

Julian dates.

Methods Documentation

bls(self, periods, duration)[source]

Compute Box Least Squares periodogram

Parameters
periodsndarray
duration: `~astropy.units.Quantity`
Returns
resultsBoxLeastSquaresResults
bestslist
statsdict
delete_outliers(self)[source]
classmethod from_dir(path, for_stsp=False)[source]

Load light curve from numpy save files in dir

classmethod from_raw_fits(fits_paths, name=None)[source]

Load FITS files downloaded from MAST into the LightCurve object.

Parameters
fits_pathslist

List of paths to FITS files to read in

namestr (optional)

Name of light curve

Returns
lcLightCurve

The light curve for the data in the fits files.

get_available_quarters(self)[source]

Get which quarters are available in this LightCurve

Returns
qslist

List of unique quarters available.

get_quarter(self, quarter)[source]

Get a copy of the data from within LightCurve during one Kepler quarter.

Parameters
quarterint

Kepler Quarter

Returns
lcLightCurve

Light curve from one Kepler Quarter

get_transit_light_curves(self, params, plots=False)[source]

For a light curve with transits only (i.e. like one returned by LightCurve.mask_out_of_transit), split up the transits into their own light curves, return a list of TransitLightCurve objects.

Parameters
paramsTransitParams

Transit light curve parameters

plotsbool

Make diagnostic plots.

Returns
transit_light_curveslist

List of TransitLightCurve objects

mask_in_transit(self, params, oot_duration_fraction=0.25)[source]

Mask out the in-transit light curve based on transit parameters

Parameters
paramsTransitParams

Transit light curve parameters. Requires that params.duration is defined.

oot_duration_fractionfloat (optional)

Fluxes from what fraction of a transit duration of the out-of-transit light curve should be included in the mask?

Returns
ddict

Inputs for a new LightCurve object with the mask applied.

mask_out_of_transit(self, params, oot_duration_fraction=0.25, flip=False)[source]

Mask out the out-of-transit light curve based on transit parameters

Parameters
paramsTransitParams

Transit light curve parameters. Requires that params.duration is defined.

oot_duration_fractionfloat (optional)

Fluxes from what fraction of a transit duration of the out-of-transit light curve should be included in the mask?

flipbool (optional)

If True, mask in-transit rather than out-of-transit.

Returns
ddict

Inputs for a new LightCurve object with the mask applied.

normalize_each_quarter(self, rename=None, polynomial_order=2, plots=False)[source]

Use polynomial fit to each quarter to normalize the data.

Parameters
renamestr (optional)

New name of the light curve after normalization

polynomial_orderint (optional)

Order of polynomial to fit to the out-of-transit fluxes. Default is 2.

plotsbool (optional)

Show diagnostic plots after normalization.

phases(self, params)[source]
plot(self, transit_params=None, ax=None, quarter=None, show=False, phase=False, **kwargs)[source]

Plot light curve.

Parameters
transit_paramsTransitParams (optional)

Transit light curve parameters. Required if phase is True.

axAxes (optional)

Axis to make plot on top of

quarterfloat (optional)

Plot only this Kepler quarter

showbool

If True, call matplotlib.pyplot.show after plot is made

phasebool

If True, map times in JD to orbital phases, which requires that transit_params be input also.

plot_kwargsdict

Keyword arguments to pass to matplotlib calls.

save_to(self, path, overwrite=False, for_stsp=False)[source]

Save times, fluxes, errors to new directory dirname in path

split_at_index(self, index)[source]

Split the light curve into two light curves, at index