Continuum fitting

The continuum of a spectra can be fitted through the menu "Operations - Fit continuum" using four alternative models:

  • Splines
  • Polynomy
  • Template
  • Fixed value

Once the continuum fit is executed, related information can be visualized if the "Stats" action is selected and a region is clicked. The fitted continuum can also be removed by using the function "Operations - Clear - Fitted continuum".

Splines and polynomy

Properties for the fitting of the continuum Properties for the fitting of the continuum

The process applies a median filter (to reduce the noise effects) and a maximum filter (to avoid absorption lines) with windows of sizes specified by the user (the filtering can also be done in the reverse order: max+median). It may be useful to fine tune the window sizes to change the continuum placement, since the most convenient values can depend on the signal-to-noise ratio and spectral type of the star.

The spectral resolution can be specified to optimize the process (oversampling slows down the computation), and the spectrum will be homogeneously re-sampled with a wavelength step equal to the minimum wavelength divided by the resolution. If no resolution is indicated, the spectrum will be re-sampled using the median wavelength step (the fitting process assumes a constant wavelength step, thus the re-sampling ensures that condition).

To automatically detect and ignore strong absorption lines (for which the maximum filter is not enough), iSpec implements a probabilistic mechanism that can be controlled setting a greater or lower probability threshold. This mechanism expects that the rate of change of the filtered fluxes should be similar (in chunks 20 times the max window size, with a minimum value of 10 nm), if a dramatic change is found then it is probable that is due to a strong absorption line and these points will be ignored. A higher probability threshold will accept less outlying rate changes and vice-versa.

The process can consider only the defined continuum regions and/or ignore line regions if the corresponding options are selected, if not it will use the whole spectra. Additionally, it can treat each region independently fitting the continuum without considering the rest of the regions.

Once the spectra is filtered, the model will be fitted:

  • Splines: N splines will be used with the degree specified by the user (recommended: 2). The number of splines (N) is recommended to be 1 per every nanometer, it is suggested in the same window.
  • Polynomy: one polynomy of N degrees. The recommended degree is 1 every nanometer and it is also suggested in the same window.


The continuum can be fitted dividing the spectrum by a template, then a median filter will be applied with a window size specified by the user (recommended size: 5) and finally a Gaussian filter will be applied to smooth the result. This approach is useful when we have a synthetic spectra (or already normalized observed spectra) with similar atmospheric parameters to the target spectrum that can be used as a template.

Properties for the fitting of the continuum

Fixed value

The fixed value model will fix the continuum to a given value. This is required when the spectrum is already normalized and we do not want to modify its continuum, then a fixed continuum to 1.0 can be executed.

Properties for the fitting of the continuum

Continuum normalization

Once a continuum is fitted, the spectra can be normalized through the menu "Operations - Continuum normalization". All fluxes from the active spectrum will be divided by the fitted continuum.