run_make_lc_steps

tessilator.lc_analysis.run_make_lc_steps(f_lc, f_orig, min_crit_frac=0.1, min_crit_num=50, outl_mad_fac=3.0)[source]

Process the lightcurve: cleaning, normalisation and detrending functions

During each procedure, the function keeps a record of datapoints that are
kept or rejected, allowing users to assess the amount of data loss.
The function makes the following steps…
1. normalise the original flux points
2. split the lightcurve into ‘time segments’
3. remove very sparse elements from the lightcurve
4. run the first detrending process to pass to the cleaning function.
5. clean the lightcurve edges from outliers
6. clean the lightcurve edges from scattered data
7. finally cut out data that are extreme outliers.
8. divide each lightcurve component by the median flux value
of qualifying data points.
9. return the dictionary
Parameters:
f_lcdict

The initial lightcurve with the minimum following keys required: (1) ‘time’ -> the time coordinate (2) ‘eflux’ -> the error in the flux (3) ‘f_orig’ -> see the f_orig parameter

f_origstr

This string determines which of the original flux values to choose. It forms the final part of the f_lc keys. It could be either ‘reg_oflux’ (the regular, original flux) or ‘cbv_oflux’ (the original flux corrected using co-trending basis vectors)

min_crit_fracfloat, optional, default=0.1

The minimum relative size of a flux component when correcting for sparse data in the cleaning functions.

min_crit_numint, optional, default=50

The minimum number of data points required for a flux component in the sparse data cleaning functions.

outl_mad_facfloat, optional, default=3.

The factor of MAD for the cleaned lightcurve flux values.

Returns:
f_lcdict

A dictionary storing the full set of results from the lightcurve analysis. As well as the keys from the inputs, the final keys returned are: 1: “time” -> the time coordinate. 2: “mag” -> the TESS magnitude. 3: “(reg/cbv)_oflux” -> the flux calculated from aperture photometry. 4: “eflux” -> the error bar on (reg/cbv)_oflux. 5: “nflux_ori” -> the normalised fluxes from (3). 6: “nflux_err” -> the error bars on (5). 7: “nflux_dtr” -> the normalised fluxes after the detrending steps. 8: “lc_part” -> an index referring to each group in the lightcurve. 9: “pass_sparse” -> boolean from remove_sparse_data 10: “pass_clean_outlier” -> boolean from clean_edges_outlier. 11: “pass_clean_scatter” -> boolean from clean_edges_scatter. 12: “pass_full_outlier” -> boolean from the final outlier rejection.

detr_dictdict

The dictionary returned from detrend_lc