sel_nb

tessilator.detrend_cbv.sel_nb(flux, cbv, nBmax=None, use=None)[source]

Correct light curve for systematics using upt to nB CBVs (automatically select best number).

Parameters:
fluxIter

A 1-D array of light curves

cbvIter

A 2-D array of co-trending basis vectors trends

nBmaxint, optional, default=None

The maximum number of CBVs to use (starting with the first)

usebool, optional, default=True

True for data points to use in evaluating correction, False for data points to ignore (NaNs are also ignored)

Returns:
nBoptint

The automatically selected number of CBVs used (<= nBmax)

corr_fluxIter

The corrected light curves (same shape as flux)

weightsIter

The co-trending basis vector coefficients (same shape as nBopt).