fit_lines

specutils.fitting.fit_lines(spectrum, model, fitter=<astropy.modeling.fitting.LevMarLSQFitter object at 0x7fe7febe7190>, 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.

exclude_regionslist of SpectralRegion

List of regions to exclude in the fitting.

weightslist (NOT IMPLEMENTED YET)

List of weights to define importance of fitting regions.

windowSpectralRegion or list of SpectralRegion

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.

Notes

  • Could add functionality to set the bounds in model if they are not set.

  • The models in the list of model are added

    together and passed as a compound model to the Fitter class instance.