snr

specutils.analysis.snr(spectrum, region=None)[source]

Calculate the mean S/N of the spectrum based on the flux and uncertainty in the spectrum. This will be calculated over the regions, if they are specified.

Parameters:
spectrum : Spectrum1D

The spectrum object overwhich the equivalent width will be calculated.

region: `~specutils.utils.SpectralRegion` or list of `~specutils.utils.SpectralRegion`

Region within the spectrum to calculate the SNR.

Returns:
snr : Quantity or list (based on region input)

Signal to noise ratio of the spectrum or within the regions

Notes

The spectrum will need to have the uncertainty defined in order for the SNR to be calculated. If the goal is instead signal to noise per pixel, this should be computed directly as spectrum.flux / spectrum.uncertainty.