fit_generic_continuum#
- specutils.fitting.fit_generic_continuum(spectrum, median_window=3, model=<Chebyshev1D(3, c0=0., c1=0., c2=0., c3=0.)>, fitter=<astropy.modeling.fitting.TRFLSQFitter object>, exclude_regions=None, weights=None)[source]#
Basic fitting of the continuum of an input spectrum. The input spectrum is smoothed using a median filter to remove the spikes.
- Parameters:
- spectrum
Spectrum1D The spectrum object whose continuum will be fitted.
- model
Modelor list ofModel The model or list of models that contain the initial guess.
- median_windowfloat
The width of the median smoothing kernel used to filter the data before fitting the continuum. See the
kernel_sizeparameter ofmedfiltfor more information.- fitter
Fitter The astropy fitter to use for fitting the model. Default:
TRFLSQFitter- exclude_regions
SpectralRegionor None List of regions to exclude in the fitting. Passed through to the fitmodels routine.
- weightslist (NOT IMPLEMENTED YET)
List of weights to define importance of fitting regions.
- spectrum
- Returns:
- continuum_model
Fitted continuum as a model of whatever class
modelprovides.
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 theFitterclass instance.