astropy / astropy/specutils

Have a consistent concept/shared implementation of signal-to-noise

Open
#523 0 comments 0 reactions 0 assignees View on GitHub
analysis enhancement
Dominant language
Python
Stars
204
Forks
134
Avg merge
12h 55m
Merged PRs (30d)
1

Description

In the `snr` function and soon #509, we are using a definition of signal-to-noise that is a bit heuristic - basically whatever the uncertainty object is, we are assuming that's what the user meant as "noise".

But I think it may make more sense to instead assume the typical convention that "noise" means "gaussian statistics standard deviation" - i.e., we would want to try to convert the uncertainty object to StdDev and if it fails raise an exception asking the user to update the uncertainty to be meaningful.

A related task would be to have an underlying implementation of "what is the per-pixel signal to noise" that's part of the public API. The options that come to mind for me are either a `snr_pixel` function (`snr` is already taken for the "snr of a spectrum" operation), or a method on `Spectrum 1D` that would be `spectrum.pixel_snr` or similar.

Contributor guide

Open the contributing guide

Research direction

Start with the existing `snr` function and the related work in #509, then inspect how uncertainty objects are currently interpreted. Compare the proposed `snr_pixel` function and `Spectrum 1D` method as public API options; done means a shared per-pixel signal-to-noise implementation with consistent uncertainty handling and a defined failure for unsuitable uncertainties.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, data
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.