- LightCurve.flatten(window_length=101, polyorder=2, return_trend=False, break_tolerance=5, niters=3, sigma=3, mask=None, **kwargs)¶
Removes the low frequency trend using scipy’s Savitzky-Golay filter.
This method wraps
The length of the filter window (i.e. the number of coefficients).
window_lengthmust be a positive odd integer.
The order of the polynomial used to fit the samples.
polyordermust be less than window_length.
True, the method will return a tuple of two elements (flattened_lc, trend_lc) where trend_lc is the removed trend.
If there are large gaps in time, flatten will split the flux into several sub-lightcurves and apply
savgol_filterto each individually. A gap is defined as a period in time larger than
break_tolerancetimes the median gap. To disable this feature, set
Number of iterations to iteratively sigma clip and flatten. If more than one, will perform the flatten several times, removing outliers each time.
Number of sigma above which to remove outliers from the flatten
- maskboolean array with length of self.time
Boolean array to mask data with before flattening. Flux values where mask is True will not be used to flatten the data. An interpolated result will be provided for these points. Use this mask to remove data you want to preserve, e.g. transits.
Dictionary of arguments to be passed to