smooth_test

tessilator.lc_analysis.smooth_test(time, flux, n_avg=10)[source]

Determine how to detrend a lightcurve, based on a smoothness algorithm

The idea of this function is to catch lightcurves that appear to have periods longer than ~15 days, and are notably smooth. The function calculates a sine fit to the (linearly) detrended lightcurve, then smoothes it using a running mean. Finally, there are three criteria to decide how the lightcurve should be detrended. A boolean flag is returned, where False=individual groups and True=the whole lightcurve.

Parameters:
timeIter

A set of time coordinates

fluxIter

A set of flux coordinates

n_avgfloat, optional, default=10

The number of datapoints to be used for the running mean calculation.

Returns:
smooth_flagbool

A boolean flag to (partially) determine how the lightcurve should be detrended (False=individual groups, True=the whole lightcurve)