Skip to content

snr_der

Derivative-based SNR estimator (DER_SNR, Stoehr et al. 2008).

Category Quality / SNR
Backend numpy - implemented here on top of numpy primitives
Version 1.0.0
Reads ctx.spectrum (a Spectrum1D)
Writes metrics.snr_der

SNR = median(flux) / (1.482602 / sqrt(6) * median(|2*F[i] - F[i-2] - F[i+2]|)). Works on any reasonably sampled spectrum and is insensitive to broadband features.

Parameters

This algorithm takes no parameters.

Use it

from spectro_kernel import run_algorithm

output = run_algorithm("snr_der", ctx, {})
spectro run snr_der --input spectrum.fits
{
  "tool": "snr_der",
  "arguments": {
    "session_id": "<session_id>",
    "params": {}
  }
}

Every algorithm is an MCP tool of the same name; describe_algorithm returns this page's metadata as JSON.

References

  • Stoehr et al. 2008, 'DER_SNR: A Simple & General Spectroscopic Signal-to-Noise Measurement Algorithm', ASP Conf. Ser. 394, 505
  • compare_snr_methods - Run every SNR estimator on ctx.spectrum and collect their numbers.
  • snr_edge - Estimate SNR from the flat, line-free regions at the spectrum's edges.
  • snr_linear_fit - Estimate SNR from the scatter around a linear fit of a continuum region.
  • validate_bess_header - Check a FITS header against the BeSS keyword contract.