CheopsLightCurve

class linea.CheopsLightCurve(record_array, norm=True)[source] [edit on github]

Bases: object

Data handling class for CHEOPS light curves.

Parameters
record_arrayrecarray

Record array of column vectors and their labels (names). Often this record array comes straight from a FITS file.

normbool

Normalize the fluxes such that the median flux is unity. Default is True.

Methods Summary

design_matrix(self[, norm])

Generate the design matrix.

from_example([norm])

Load example 55 Cnc e light curve (NOTE: this is not real data).

from_fits(path[, norm])

Load a FITS file from DACE or the DRP.

phase(self, planet_params)

Orbital phase of planet at times lc.bjd_time.

plot(self[, ax])

Plot the light curve.

plot_phase_curve(self, r, params, t_fine, …)

Plot the best-fit phase curve.

regress(self, design_matrix)

Regress the design matrix against the fluxes.

sigma_clip_centroid(self[, sigma, plot])

Sigma-clip the light curve on centroid position (update mask).

sigma_clip_flux(self[, sigma_upper, …])

Sigma-clip the light curve on fluxes (update mask).

Methods Documentation

design_matrix(self, norm=True)[source] [edit on github]

Generate the design matrix.

Parameters
normbool

Normalize the column vectors within the design matrix such that they have mean=zero and range=unity.

Returns
Xndarray

Design matrix (concatenated column vectors of observables)

classmethod from_example(norm=True)[source] [edit on github]

Load example 55 Cnc e light curve (NOTE: this is not real data).

Parameters
normbool

Normalize the fluxes such that the median flux is unity. Default is True.

classmethod from_fits(path, norm=True)[source] [edit on github]

Load a FITS file from DACE or the DRP.

Parameters
pathstr

Path to the FITS file containing the data to load.

normbool

Normalize the fluxes such that the median flux is unity. Default is True.

phase(self, planet_params)[source] [edit on github]

Orbital phase of planet at times lc.bjd_time.

Parameters
planet_paramsPlanet

Planet parameter object.

Returns
phasesndarray

Orbital phases at times lc.bjd_time

plot(self, ax=None, **kwargs)[source] [edit on github]

Plot the light curve.

Parameters
axAxes

Matplotlib axis instance on which to build the plot

kwargsdict

Further keyword arguments to pass to plot.

Returns
axAxes

Matplotlib axis instance with the light curve plotted on it.

plot_phase_curve(self, r, params, t_fine, transit_fine, sinusoid_fine, t0_offset=0, n_regressors=2, bins=15)[source] [edit on github]

Plot the best-fit phase curve.

Parameters
rRegressionResult

Result of the linear regression

paramsPlanet

Transiting exoplanet parameters

t_finendarray

Times computed on a grid finer than the original observations

transit_finendarray

Transit model computed at times t_fine

sinusoid_finendarray

Sinusoidal phase curve model computed at times t_fine

t0_offsetfloat, optional

Time offset between the mid-transit time defined by params and the true mid-transit time [days]. Default is zero.

n_regressorsint, optional

Number of regressors used to parameterize the phase curve. Default is two.

binsint, optional

Number of bins to break the light curve into when plotting (black), default is 15.

Returns
fig, axFigure, Axes

Figure and axis objects containing the phase curve plot.

regress(self, design_matrix)[source] [edit on github]

Regress the design matrix against the fluxes.

Parameters
design_matrixndarray

Design matrix (concatenated column vectors of observables)

Returns
betasndarray

Least squares estimators \(\hat{\beta}\)

covndarray

Covariance matrix for the least squares estimators \(\sigma_{\hat{\beta}}^2\)

sigma_clip_centroid(self, sigma=3.5, plot=False)[source] [edit on github]

Sigma-clip the light curve on centroid position (update mask).

Parameters
sigmafloat

Factor of standard deviations away from the median centroid position to clip on.

plotbool

Plot the accepted centroids (in black) and the centroids of the rejected fluxes (in red).

sigma_clip_flux(self, sigma_upper=4, sigma_lower=4, maxiters=None, plot=False)[source] [edit on github]

Sigma-clip the light curve on fluxes (update mask).

Parameters
sigma_upperfloat

Factor of standard deviations above the median centroid position to clip on.

sigma_lowerfloat

Factor of standard deviations below the median centroid position to clip on.

maxitersfloat or None

Number of sigma-clipping iterations. Default is None, which repeats until there are no outliers left.

plotfloat

Plot the accepted fluxes (in black) and the rejected fluxes (in red)