normalisation_choice

tessilator.lc_analysis.normalisation_choice(t_orig, f_orig, e_orig, lc_part, MAD_fac=2.0)[source]

Choose how to detrend the lightcurve, either as one component or in parts.

There are always at least two data components in a TESS sector because of the finite time needed for data retrieval. This can sometimes lead to discontinuities between components because of TESS systematics and the temperature gradients across the photometer. These discontinuities can cause the phase of the sinusoidal fit to change, leading to low power output in the periodograms. Alternatively, if the data are all detrended individually, but the data is relatively continuous, this can lead to shorter period measurements.

The idea with this function is that a polynomial fit is made to each component (chosen using the Aikaike Information Criterion). The extrapolated flux value from component 1 is calculated at the point where component 2 starts. If the difference between this value and the actual normalised flux at this point is greater than a given threshold, the data should be detrended separately. Otherwise the full lightcurve can be detrended as a whole.

Parameters:
t_origIterable

The time coordinate

f_origIterable

The original, normalised flux values

e_origIterable

The error on “f_orig”

lc_partIterable

The running index for each contiguous data section in the lightcurve

MAD_facfloat, optional, default = 2.0

The factor to multiply the median absolute deviation by.

Returns:
norm_compBoolean

Determines whether the data should be detrended as one whole component (False) or in parts (True)