measure_snr_profile_observed#

madcubapy.utils.measure_snr_profile_observed(x_array, y_array, v0, fwhm, dv, rms, window_sigma_factor=3, window_selection_method='fractional')[source]#

Measure the SNR of a line by integrating the emission on the observed channels.

Note: Needs the velocity and width of a fitted gaussian line on the observed line profile to select the channels.

Parameters:
x_arrayarray or Quantity

X axis array of the observed spectrum in velocity units.

y_arrayarray or Quantity

Y axis array of the observed spectrum.

v0float or Quantity

Central velocity of the fitted gaussian line.

fwhmfloat or Quantity

FWHM of the fitted gaussian line.

dvfloat or Quantity

Channel width.

rmsfloat or Quantity

Measured rms on the spectral data.

window_sigma_factorfloat, default: 3

Number of sigma deviation to be used for each side of the gaussian center as the selected window.

window_selection_method{“fractional”, “binary”}, default: “fractional”

Method for handling channels at the edge of the integration window:

  • ‘fractional’ (Recommended): Weights boundary channels by the fraction of their width that falls inside the selected window.

  • ‘binary’: Boolean masking; includes the full flux of any channel whose center is within the window boundaries.

Returns:
snrfloat

Measured integrated SNR.