SFFCorrector¶

class
lightkurve.correctors.
SFFCorrector
[source]¶ 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
Methods Summary
arclength
(x1, x)Compute the arclength of the polynomial used to fit the centroid measurements. bin_and_interpolate
(s, normflux, bins, sigma)breakpoints
(campaign)Return a break point as a function of the campaign number. correct
(time, flux, centroid_col, centroid_row)Returns a systematicscorrected LightCurve. fit_bspline
(time, flux[, knotspacing])rotate_centroids
(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. Methods Documentation

arclength
(x1, x)[source]¶ Compute the arclength of the polynomial used to fit the centroid measurements.
Parameters:  x1 : float
Upper limit of the integration domain.
 x : ndarray
Domain at which the arclength integrand is defined.
Returns:  arclength : float
Result of the arclength integral from x[0] to x1.

breakpoints
(campaign)[source]¶ 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
(time, flux, centroid_col, centroid_row, polyorder=5, niters=3, bins=15, windows=10, sigma_1=3.0, sigma_2=5.0, restore_trend=False)[source]¶ Returns a systematicscorrected LightCurve.
Note that it is assumed that time and flux do not contain NaNs.
Parameters:  time : arraylike
Time measurements
 flux : arraylike
Data flux for every time point
 centroid_col, centroid_row : arraylike, arraylike
Centroid column and row coordinates as a function of time
 polyorder : int
Degree of the polynomial which will be used to fit one centroid as a function of the other.
 niters : int
Number of iterations of the aforementioned algorithm.
 bins : int
Number of bins to be used in step (6) to create the piecewise interpolation of arclength vs flux correction.
 windows : int
Number of windows to subdivide the data. The SFF algorithm is ran independently in each window.
 sigma_1, sigma_2 : float, float
Sigma values which will be used to reject outliers in steps (6) and (2), respectivelly.
 restore_trend : bool
If True, the longterm trend will be added back into the lightcurve.
Returns:  corrected_lightcurve : LightCurve object
Returns a corrected lightcurve object.