cbv_fit_test

tessilator.lc_analysis.cbv_fit_test(t, of, cf)[source]

Determine whether the cbv-corrected lightcurve should be considered.

Whilst the cbv-corrected flux are designed to eliminate systematic artefacts by identifying features common to many stars (using principle component analysis), the routine can overfit the data, and often the cbv corrections inject too much unwanted noise (particularly for targets with low signal to noise).

Therefore the plan here is to assess lightcurves produced by the cbv corrections by comparing basic attributes with the regular (non-corrected) lightcurves. These scores come down to:

1: the number of outliers 2: the size of the median absolute deviation 3: which lightcurve provides the lowest chi-squared value to a sine fit.

If the “original lightcurve” scores higher, then the cbv-corrected lightcurve is not considered for further analysis.

Parameters:
tIterable

The time component of the lightcurve

ofIterable

The original flux

cfIterable

The cbv-corrected flux

Returns:
use_cbvbool

True if cf score > of score, else False.