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:
- spectrumSpectrum1D
The spectrum object overwhich the equivalent width will be calculated.
- modellist of
Model
The 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_size
parameter ofmedfilt
for more information.- fitter
_FitterMeta
The astropy fitter to use for fitting the model. Default:
TRFLSQFitter
- exclude_regionslist of 2-tuples
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.
- Returns:
- continuum_model
Fitted continuum as a model of whatever class
model
provides.
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 theFitter
class instance.