LightCurve¶
-
class
aspros.
LightCurve
(times=None, fluxes=None, errors=None, quarters=None, name=None)[source]¶ Bases:
object
Container object for light curves.
- Parameters
Attributes Summary
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
inpath
split_at_index
(self, index)Split the light curve into two light curves, at
index
Attributes Documentation
Methods Documentation
-
bls
(self, periods, duration)[source]¶ Compute Box Least Squares periodogram
- Parameters
- periods
ndarray
- duration: `~astropy.units.Quantity`
- periods
- Returns
- results
BoxLeastSquaresResults
- bestslist
- statsdict
- results
-
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
- lc
LightCurve
The light curve for the data in the fits files.
- lc
-
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
- lc
LightCurve
Light curve from one Kepler Quarter
- lc
-
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 ofTransitLightCurve
objects.- Parameters
- params
TransitParams
Transit light curve parameters
- plotsbool
Make diagnostic plots.
- params
- 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
- params
TransitParams
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?
- params
- 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
- params
TransitParams
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.
- params
- 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.
-
plot
(self, transit_params=None, ax=None, quarter=None, show=False, phase=False, **kwargs)[source]¶ Plot light curve.
- Parameters
- transit_params
TransitParams
(optional) Transit light curve parameters. Required if
phase
isTrue
.- ax
Axes
(optional) Axis to make plot on top of
- quarterfloat (optional)
Plot only this Kepler quarter
- showbool
If
True
, callmatplotlib.pyplot.show
after plot is made- phasebool
If
True
, map times in JD to orbital phases, which requires thattransit_params
be input also.- plot_kwargsdict
Keyword arguments to pass to
matplotlib
calls.
- transit_params