fit_1d_background_complex_1d

jwst.residual_fringe.utils.fit_1d_background_complex_1d(flux, weights, wavenum, ffreq=None)[source]

Fit the background signal using a piecewise spline of n knots.

Note that this will also try to identify obvious emission lines and flag them so they aren’t considered in the fitting.

Parameters:
fluxndarray

The 1D array of fluxes.

weightsndarray

The 1D array of weights.

wavenumndarray

The 1D array of wavenum.

ffreqfloat or None, optional

The expected fringe frequency, used to determine number of knots. If None, defaults to NUM_KNOTS constant.

Returns:
bg_fitndarray

The fitted background.

bgindxndarray

The location of the knots.