lmfit¶
- threadcount.mpdaf_ext.lmfit(self, model, **kwargs)[source]¶
Fit model to
Spectrumusing lmfit.This function is an interface between the
Spectrumandlmfit.model.Model.fit(). The Spectrum data, variance, and x are passed tolmfit.model.Model.fit(), along with the other kwargs.If params is not provided in kwargs, then
lmfit.model.Model.guess()is called to compute it. If the guess function is not implemented for the model, the values for all parameters are expected to be provided as keyword arguments. If params is given, and a keyword argument for a parameter value is also given, the keyword argument will be used.- Parameters:
model (
lmfit.model.Model) – lmfit Model to use for fitting**kwargs (dict) – Any additional keywords and arguments are passed to
lmfit.model.Model.fit()
- Returns:
The fitted ModelResult, or None if the Spectrum was entirely masked.
- Return type:
lmfit.model.ModelResult, or None