Compute the continuum based on the per-pixel spectrum. Each spectrum is sigma-clipped and the histogram of the intensity distribution is fitted by a Gaussian. Corrective techniques are applied to ensure the fit has converged. The position of this Gaussian gives the continuum level. A noise estimate is also derived.
The method does not deliver a spatially independent noise, but adapts the bandwidth to the line free zones for each pixel. It may fail for pixels that are close to line confusion.
The optional arguments control the algorithm. Threshold is clipping level value for the Gaussian: valuesi n range 2.5 - 4 are usable (default 3.5). Nhist is the number of histogram bins. The default is to adjust this number depending on the number of channels in the data.