get_SignalBW_idx¶
- threadcount.fit.get_SignalBW_idx(cube, nsigma=5, plot=False)[source]¶
Determine the wavelength indices containing signal.
This function computes an average spectrum using the whole cube. Then, fits a gaussian plus constant (
Const_1GaussModel). The gaussian center and sigma, along with nsigma, are used to compute and return the indices corresponding to \([center - nsigma*sigma, center + nsigma*sigma]\).The plot option may be used for debugging for a visual of the spectrum and the fit, and the computed range.
- Parameters:
cube (
mpdaf.obj.Cube) – The cube containing data, var, and wave attributesnsigma (float, optional) – The number of sigmas to include on each side of the gaussian center, by default 5
plot (bool, optional) – Dispaly a plot of the spectrum and fit, with the bandwidth highlighted, by default False
- Returns:
The indices of the wavelength array corresponding to the calculated bandwidth.
- Return type: