exoctk.lightcurve_fitting package

Submodules

exoctk.lightcurve_fitting.fitters module

Functions used to fit models to light curve data

Author: Joe Filippazzo Email: jfilippazzo@stsci.edu

exoctk.lightcurve_fitting.fitters.lmfitter(time, data, model, uncertainty=None, verbose=True, **kwargs)[source]

Use lmfit

Parameters
data: sequence

The observational data

model: ExoCTK.lightcurve_fitting.models.Model

The model to fit

uncertainty: np.ndarray (optional)

The uncertainty on the (same shape) data

method: str

The name of the method to use

name: str

A name for the best fit model

verbose: bool

Print some stuff

Returns
lmfit.Model.fit.fit_report

The results of the fit

exoctk.lightcurve_fitting.lightcurve module

Base and child classes to handle light curve fitting

Author: Joe Filippazzo Email: jfilippazzo@stsci.edu

class exoctk.lightcurve_fitting.lightcurve.LightCurve(time, flux, unc=None, parameters=None, units='MJD', name='My Light Curve')[source]

Bases: exoctk.lightcurve_fitting.models.Model

A class to store the actual light curve

Parameters
time: sequence

The time axis in days, [MJD or BJD]

flux: sequence

The flux in electrons (not ADU)

unc: sequence

The uncertainty on the flux

parameters: str, object (optional)

The orbital parameters of the star/planet system, may be a path to a JSON file or a parameter object

units: str

The time units

name: str

A name for the object

fit(model, fitter='lmfit', **kwargs)[source]

Fit the model to the lightcurve

Parameters
model: ExoCTK.lightcurve_fitter.models.Model

The model to fit to the data

fitter: str

The name of the fitter to use

plot(fits=True, draw=True)[source]

Plot the light curve with all available fits

Parameters
fits: bool

Plot the fit models

draw: bool

Show the figure, else return it

Returns
bokeh.plotting.figure

The figure

reset()[source]

Reset the results

class exoctk.lightcurve_fitting.lightcurve.LightCurveFitter(time, flux, model)[source]

Bases: object

Fit the model to the flux cube

Parameters
time:

1D or 2D time axes

flux:

2D flux

master_slicer(value, param_name='wavelength')[source]
run()[source]

Run the model fits

exoctk.lightcurve_fitting.models module

Base and child classes to handle models used to fit light curves

Author: Joe Filippazzo Email: jfilippazzo@stsci.edu

class exoctk.lightcurve_fitting.models.CompositeModel(models, **kwargs)[source]

Bases: exoctk.lightcurve_fitting.models.Model

A class to create composite models

Initialize the composite model

Parameters
models: sequence

The list of models

eval(**kwargs)[source]

Evaluate the model components

class exoctk.lightcurve_fitting.models.Model(**kwargs)[source]

Bases: object

Create a model instance

property flux

A getter for the flux

interp(new_time)[source]

Interpolate the flux to a new time axis

Parameters
new_time: sequence, astropy.units.quantity.Quantity

The time array

property parameters

A getter for the parameters

plot(time, components=False, fig=None, draw=False, color='blue', **kwargs)[source]

Plot the model

Parameters
time: array-like

The time axis to use

components: bool

Plot all model components

fig: bokeh.plotting.figure (optional)

The figure to plot on

Returns
bokeh.plotting.figure

The figure

property time

A getter for the time

property units

A getter for the units

class exoctk.lightcurve_fitting.models.PolynomialModel(**kwargs)[source]

Bases: exoctk.lightcurve_fitting.models.Model

Polynomial Model

Initialize the polynomial model

eval(**kwargs)[source]

Evaluate the function with the given values

class exoctk.lightcurve_fitting.models.TransitModel(**kwargs)[source]

Bases: exoctk.lightcurve_fitting.models.Model

Transit Model

Initialize the transit model

eval(**kwargs)[source]

Evaluate the function with the given values

exoctk.lightcurve_fitting.parameters module

Base and child classes to handle orbital parameters

Author: Joe Filippazzo Email: jfilippazzo@stsci.edu

class exoctk.lightcurve_fitting.parameters.Parameter(name, value, ptype='free', mn=None, mx=None)[source]

Bases: object

A generic parameter class

Instantiate a Parameter with a name and value at least

Parameters
name: str

The name of the parameter

value: float, int, str, list, tuple

The value of the parameter

ptype: str

Parameter type, [‘free’,’fixed’,’independent’]

mn: float, int, str, list, tuple (optioal)

The minimum value

mx: float, int, str, list, tuple (optioal)

The maximim value

property ptype

Getter for the ptype

property values

Return all values for this parameter

class exoctk.lightcurve_fitting.parameters.Parameters(param_file=None, **kwargs)[source]

Bases: object

A class to hold the Parameter instances

Initialize the parameter object

Parameters
param_file: str

A text file of the parameters to parse

Module contents

Package to fit models to light curve data