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.SpectralRegion` or list of `~specutils.SpectralRegion`
Region within the spectrum to calculate the SNR.
- spectrum
- Returns:
- snr
Quantity
or list (based on region input) Signal to noise ratio of the spectrum or within the regions
- snr
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
. This calculation converts the uncertainty to standard deviation internally if it is defined as another type.