Conversation
… estimate noise in a 2D spectrum. This is for now used only in `specreduce.line_matching.find_arc_lines` as a fallback noise estimate if the spectrum doesn't contain uncertainties, but may be useful elsewhere as well.
hpparvi
requested review from
cshanahan1,
kbwestfall,
kecnry and
tepickering
and removed request for
cshanahan1
September 7, 2026 14:11
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #321 +/- ##
==========================================
+ Coverage 92.52% 92.56% +0.03%
==========================================
Files 18 18
Lines 2341 2367 +26
==========================================
+ Hits 2166 2191 +25
- Misses 175 176 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes two issues in how the
find_arc_lineshandles uncertainties:the
find_arc_linesfunction now allows uncertainties to be any of Astropy's uncertainty types (it allowed previously onlyStdDevUncertainty)If the spectrum doesn't include uncertainties, the uncertainties are estimated using a robust approach based on the DER_SNR algorithm by Stoerh et al. (2008). (with a small difference that we're using Astropy's sigma-clipped median instead of plain median).
I've also added the noise estimation function as
specreduce.utils.utils.measure_noise.AI/LLM Disclaimer: The same as in #319. I've used Claude Code with Fable 5.1 to co-develop the PR, but I understand what the code does and how it works, and can explain it when needed.