get_background_fit

sofia_redux.toolkit.fitting.fitpeaks1d.get_background_fit(fitter, peak_model, background_class, x, y, pinit, fitopts=None, bg_args=None, **bg_kwargs)[source]

Return a background model with initialized parameters

Subtract peaks from y then fit background on residual

Parameters:
fitterobject
peak_modelastropy.modeling.Fittable1DModel instance
background_classastropy.modeling.Fittable1DModel
xarray_like of float
yarray_like of float
pinitnumpy.ndarray

(npeaks, n_peak_parameters) array giving the peak parameters for peak_model.

fitoptsdict, optional

Optional keywordds to pass into the solver.

bg_argstuple, optional

If the background class requires positional arguments, they should be supplied here.

bg_kwargsdict, optional

Optional keywords to pass into the background_class to initialize the background model.

Returns:
numpy.ndarray

(n_background_parameters,) array of background parameters based on the fit of (x, y - peaks).