lightkurve.correctors.
SFFCorrector
(lightcurve)¶Bases: object
Implements the SelfFlatFielding (SFF) systematics removal method.
This method is described in detail by Vanderburg and Johnson (2014). Briefly, the algorithm implemented in this class can be described as follows
Rotate the centroid measurements onto the subspace spanned by the eigenvectors of the centroid covariance matrix
Fit a polynomial to the rotated centroids
Compute the arclength of such polynomial
Fit a BSpline of the raw flux as a function of time
Normalize the raw flux by the fitted BSpline computed in step (4)
Bin and interpolate the normalized flux as a function of the arclength
Divide the raw flux by the piecewise linear interpolation done in step (6)
Set raw flux as the flux computed in step (7) and repeat
Multiply back the fitted BSpline
LightCurve
The light curve object on which the SFF algorithm will be applied.
Examples
>>> lc = LightCurve(time, flux) # doctest: +SKIP
>>> corrector = SFFCorrector(lc) # doctest: +SKIP
>>> new_lc = corrector.correct(centroid_col, centroid_row) # doctest: +SKIP
Methods Summary

Compute the arclength of the polynomial used to fit the centroid measurements. 



Return a break point as a function of the campaign number. 

Returns a systematicscorrected LightCurve. 

Returns a 

Rotate the coordinate frame of the (col, row) centroids to a new (x,y) frame in which the dominant motion of the spacecraft is aligned with the x axis. 
Methods Documentation
arclength
(self, x1, x)¶Compute the arclength of the polynomial used to fit the centroid measurements.
Upper limit of the integration domain.
Domain at which the arclength integrand is defined.
Result of the arclength integral from x[0] to x1.
bin_and_interpolate
(self, s, normflux, bins, sigma)¶breakpoints
(self, campaign)¶Return a break point as a function of the campaign number.
The intention of this function is to implement a smart way to determine the boundaries of the windows on which the SFF algorithm is applied independently. However, this is not implemented yet in this version.
correct
(self, centroid_col=None, centroid_row=None, polyorder=5, niters=3, bins=15, windows=10, sigma_1=3.0, sigma_2=5.0, restore_trend=False)¶Returns a systematicscorrected LightCurve.
Centroid column and row coordinates as a function of time.
If None
, then the centroid_col
and centroid_row
attributes
of the LightCurve
passed to the constructor of this class
will be used, if present.
Degree of the polynomial which will be used to fit one centroid as a function of the other.
Number of iterations of the aforementioned algorithm.
Number of bins to be used in step (6) to create the piecewise interpolation of arclength vs flux correction.
Number of windows to subdivide the data. The SFF algorithm is ran independently in each window.
Sigma values which will be used to reject outliers in steps (6) and (2), respectivelly.
If True
, the longterm trend will be added back into the
lightcurve.
LightCurve
Returns a corrected light curve.
fit_bspline
(self, time, flux, knotspacing=1.5)¶Returns a scipy.interpolate.BSpline
object to interpolate flux as a function of time.
rotate_centroids
(self, centroid_col, centroid_row)¶Rotate the coordinate frame of the (col, row) centroids to a new (x,y) frame in which the dominant motion of the spacecraft is aligned with the x axis. This makes it easier to fit a characteristic polynomial that describes the motion.
Created with ♥ by the Lightkurve collaboration. Please cite us or join us on GitHub.