SFFCorrector

class lightkurve.correctors.SFFCorrector(lc)

Bases: lightkurve.correctors.regressioncorrector.RegressionCorrector

Special case of RegressionCorrector where the DesignMatrix includes the target’s centroid positions.

The design matrix also contains columns representing a spline in time design to capture the intrinsic, long-term variability of the target.

Parameters
lcLightCurve

The light curve that needs to be corrected.

Attributes Summary

X

Shorthand for self.design_matrix_collection.

Methods Summary

correct(self[, centroid_col, centroid_row, …])

Find the best fit correction for the light curve.

diagnose(self)

Returns a diagnostic plot which visualizes what happened during the most recent call to correct().

diagnose_arclength(self)

Returns a diagnostic plot which visualizes arclength vs flux from most recent call to correct().

diagnose_priors(self)

Returns a diagnostic plot visualizing how the best-fit coefficients compare against the priors.

Attributes Documentation

X

Shorthand for self.design_matrix_collection.

Methods Documentation

correct(self, centroid_col=None, centroid_row=None, windows=20, bins=5, timescale=1.5, breakindex=None, degree=3, restore_trend=False, additional_design_matrix=None, polyorder=None, **kwargs)

Find the best fit correction for the light curve.

Parameters
centroid_colnp.ndarray of floats (optional)

Array of centroid column positions. If None, will use the centroid_col attribute of the input light curve by default.

centroid_rownp.ndarray of floats (optional)

Array of centroid row positions. If None, will use the centroid_row attribute of the input light curve by default.

windowsint

Number of windows to split the data into to perform the correction. Default 20.

binsint

Number of “knots” to place on the arclength spline. More bins will increase the number of knots, making the spline smoother in arclength. Default 10.

timescale: float

Time scale of the b-spline fit to the light curve in time, in units of input light curve time.

breakindexNone, int or list of ints (optional)

Optionally the user can break the light curve into sections. Set break index to either an index at which to break, or list of indicies.

degreeint

The degree of polynomials in the splines in time and arclength. Higher values will create smoother splines. Default 3.

cadence_masknp.ndarray of bools (optional)

Mask, where True indicates a cadence that should be used.

sigmaint (default 5)

Standard deviation at which to remove outliers from fitting

nitersint (default 5)

Number of iterations to fit and remove outliers

restore_trendbool (default False)

Whether to restore the long term spline trend to the light curve

propagate_errorsbool (default False)

Whether to propagate the uncertainties from the regression. Default is False. Setting to True will increase run time, but will sample from multivariate normal distribution of weights.

additional_design_matrixDesignMatrix (optional)

Additional design matrix to remove, e.g. containing background vectors.

polyorderint

Deprecated as of Lightkurve v1.4. Use degree instead.

Returns
corrected_lcLightCurve

Corrected light curve, with noise removed.

diagnose(self)

Returns a diagnostic plot which visualizes what happened during the most recent call to correct().

diagnose_arclength(self)

Returns a diagnostic plot which visualizes arclength vs flux from most recent call to correct().

diagnose_priors(self)

Returns a diagnostic plot visualizing how the best-fit coefficients compare against the priors.

The method will show the results obtained during the most recent call to correct(). If correct() has not yet been called, a ValueError will be raised.

Returns
Axes

The matplotlib axes object.