snr_threshold

specutils.manipulation.snr_threshold(spectrum, value, op=<built-in function gt>)[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:
spectrumSpectrum1D, SpectrumCollection or NDData

The spectrum object overwhich the S/N threshold will be calculated.

value: ``float``

Threshold value to be applied to flux / uncertainty.

op: One of operator.gt, operator.ge, operator.lt, operator.le or

the str equivalent ‘>’, ‘>=’, ‘<’, ‘<=’ The mathematical operator to apply for thresholding.

Returns:
spectrum: Spectrum1D

Output object with spectrum.mask set based on threshold.

Notes

The input object will need to have the uncertainty defined in order for the SNR to be calculated.