detrend_lc¶
- tessilator.lc_analysis.detrend_lc(ds, df, t, m, f, err, MAD_fac=2.0, poly_max=8)[source]¶
Detrend and normalise the lightcurves.
This function runs several operations to detrend the lightcurve, as follows:1. Remove any sparse components of the lightcurve that will not benefit the lightcurve analysis.2. Remove data points that are clearly outliers.3. Choose the best detrending polynomial using the Aikaike Information Criterion, and detrend the full lightcurve.4. Decide whether to use the detrended lightcurve from part 3, or to separate the lightcurve into individual components and detrend each one separately.5. Place the results into a dictionary.- Parameters:
- ds
Iterable the start indices for the lightcurve.
- df
Iterable the end indices for the lightcurve.
- t
Iterable The list of time coordinates.
- m
Iterable The list of magnitude coordinates.
- f
Iterable The list of flux coordinates.
- err
Iterable The list of flux error coordinates.
- MAD_fac
float, optional, default = 2.0 The factor to multiply the median absolute deviation by.
- poly_max
int, optional, default=8 The maximum order of the polynomial fit.
- ds
- Returns:
- dict_lc
dict - A dictionary containing the following keys:“time” -> The time coordinate“mag” -> The magnitude coordinate“oflux” -> The original, normalised flux values“nflux” -> The detrended, cleaned, normalised flux values“enflux” -> The error on “nflux”“polyord” -> The polynomial order used for each detrend
- dict_lc