LightCurve

class salter.LightCurve(times=None, fluxes=None, errors=None, quarters=None, name=None, params=None)[source] [edit on github]

Bases: object

Container object for light curves.

Parameters:

times : ndarray

Times in JD

fluxes : ndarray

Fluxes (normalized or not)

errors : ndarray

Uncertainties on the fluxes

quarters : ndarray (optional)

Kepler Quarter for each flux

name : str

Name this light curve (optional)

params : TransitParams

Planet transit parameters

Attributes Summary

times_jd Get the times in this light curve in JD.

Methods Summary

delete_outliers()
from_hdf5(kic) Load a light curve from the HDF5 light curve archive with KIC number kic.
get_available_quarters() Get which quarters are available in this LightCurve
get_quarter(quarter) Get a copy of the data from within LightCurve during one Kepler quarter.
get_transit_light_curves([plots]) For a light curve with transits only (i.e.
mask_in_transit([oot_duration_fraction]) Mask out the in-transit light curve based on transit parameters
mask_out_of_transit([oot_duration_fraction, …]) Mask out the out-of-transit light curve based on transit parameters
normalize_each_quarter([rename, …]) Use polynomial fit to each quarter to normalize the data.
phases()
plot([transit_params, ax, quarter, show, …]) Plot light curve.
split_at_index(index) Split the light curve into two light curves, at index
transit_model([short_cadence])

Attributes Documentation

times_jd

Get the times in this light curve in JD.

Returns:

t_jd : ndarray

Julian dates.

Methods Documentation

delete_outliers()[source] [edit on github]
classmethod from_hdf5(kic)[source] [edit on github]

Load a light curve from the HDF5 light curve archive with KIC number kic.

Parameters:

kic: float

KIC number

get_available_quarters()[source] [edit on github]

Get which quarters are available in this LightCurve

Returns:

qs : list

List of unique quarters available.

get_quarter(quarter)[source] [edit on github]

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

Parameters:

quarter : int

Kepler Quarter

Returns:

lc : LightCurve

Light curve from one Kepler Quarter

get_transit_light_curves(plots=False)[source] [edit on github]

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:

plots : bool

Make diagnostic plots.

Returns:

transit_light_curves : list

List of TransitLightCurve objects

mask_in_transit(oot_duration_fraction=0.25)[source] [edit on github]

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

Parameters:

oot_duration_fraction : float (optional)

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

Returns:

d : dict

Inputs for a new LightCurve object with the mask applied.

mask_out_of_transit(oot_duration_fraction=0.25, flip=False)[source] [edit on github]

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

Parameters:

oot_duration_fraction : float (optional)

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

flip : bool (optional)

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

Returns:

d : dict

Inputs for a new LightCurve object with the mask applied.

normalize_each_quarter(rename=None, polynomial_order=2, plots=False)[source] [edit on github]

Use polynomial fit to each quarter to normalize the data.

Parameters:

rename : str (optional)

New name of the light curve after normalization

polynomial_order : int (optional)

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

plots : bool (optional)

Show diagnostic plots after normalization.

phases()[source] [edit on github]
plot(transit_params=None, ax=None, quarter=None, show=True, phase=False, plot_kwargs={u'color': u'b', u'lw': 0, u'marker': u'o'})[source] [edit on github]

Plot light curve.

Parameters:

transit_params : TransitParams (optional)

Transit light curve parameters. Required if phase is True.

ax : Axes (optional)

Axis to make plot on top of

quarter : float (optional)

Plot only this Kepler quarter

show : bool

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

phase : bool

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

plot_kwargs : dict

Keyword arguments to pass to matplotlib calls.

split_at_index(index)[source] [edit on github]

Split the light curve into two light curves, at index

transit_model(short_cadence=False)[source] [edit on github]