detrend_lc¶
- tessilator.lc_analysis.detrend_lc(t, f, lc, MAD_fac=2.0, poly_max=3)[source]¶
Detrend and normalise the lightcurves.
This function runs 3 operations to detrend the lightcurve, as follows:1. Choose whether a zeroth- or first-order polynomial is the best fit to the full light-curve, using AIC, and detrend the full lightcurve.2. Decide whether to use the detrended lightcurve from part 1, or to detrend individual groups.3. Return the detrended flux.- Parameters:
- t
Iterable the time component of the lightcurve
- f
Iterable the flux component of the lightcurve.
- lc
Iterable The index representing the lightcurve component. Note this must be indexed starting from 1.
- MAD_fac
float, optional, default = 2. The factor to multiply the median absolute deviation by.
- poly_max
int, optional, default=8 The maximum order of the polynomial fit.
- t
- Returns:
- f_norm
Iterable The corrected lightcurve after the detrending procedures.
- detr_dict
dict A dictionary containing the parameters: norm_flag, smooth_flag, “f1_at_f2_0, f2_at_f2_0, f1_MAD, f2_MAD” (see norm_choice) and “s_fit, coeffs” (see aic_selector)
- f_norm