fit_lines¶
-
specutils.fitting.fit_lines(spectrum, model, fitter=<astropy.modeling.fitting.LevMarLSQFitter object at 0x7fa561c5ec90>, exclude_regions=None, weights=None, window=None, \*\*kwargs)[source]¶ Fit the input models to the spectrum. The parameter values of the input models will be used as the initial conditions for the fit.
- Parameters
- spectrumSpectrum1D
The spectrum object over which the equivalent width will be calculated.
- model: `~astropy.modeling.Model` or list of `~astropy.modeling.Model`
The model or list of models that contain the initial guess.
- fitter
Fitter, optional Fitter instance to be used when fitting model to spectrum.
- exclude_regionslist of
SpectralRegion List of regions to exclude in the fitting.
- weightsarray-like or ‘unc’, optional
If ‘unc’, the unceratinties from the spectrum object are used to to calculate the weights. If array-like, represents the weights to use in the fitting. Note that if a mask is present on the spectrum, it will be applied to the
weightsas it would be to the spectrum itself.- window
SpectralRegionor list ofSpectralRegion Regions of the spectrum to use in the fitting. If None, then the whole spectrum will be used in the fitting.
- Additional keyword arguments are passed directly into the call to the
- ``fitter``.
- Returns
- modelsCompound model of
Model A compound model of models with fitted parameters.
- modelsCompound model of
Notes
Could add functionality to set the bounds in
modelif they are not set.- The models in the list of
modelare added together and passed as a compound model to the
Fitterclass instance.
- The models in the list of