-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JP-3601: Fix background interval edge case #8433
JP-3601: Fix background interval edge case #8433
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #8433 +/- ##
==========================================
+ Coverage 56.38% 56.41% +0.03%
==========================================
Files 387 387
Lines 38716 38733 +17
==========================================
+ Hits 21830 21852 +22
+ Misses 16886 16881 -5 ☔ View full report in Codecov by Sentry. |
b9fb054
to
71c80c4
Compare
In testing, the initial simple fix was a little too simple: it did not handle correctly the case where part of a pixel falls within the specified region, or the case where an empty interval is specified, but the limits are within range of the data. The updated version should now handle both of those cases correctly, as well as fixing the original crash. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not familiar with extract_1d at that level of detail but the changes seem to address the ticket. Is there a reasonable tests to add?
I started a regression test run here https://plwishmaster.stsci.edu:8081/job/RT/job/JWST-Developers-Pull-Requests/1408
Thanks @nden - I'll see if I can add some unit tests to cover the relevant cases. |
@nden - unit tests added for a couple relevant cases in background and source extraction. Looking at the regression tests, it looks like the test_nirspec_fs_spec3[s00024-s1600a1-x1d] failure is the only relevant change. For this spectral extraction, the WCS is invalid: all wavelengths are set to NaN and the extraction region is out of range. The old version defaulted the flux to 0.0 and the errors to NaN in this case; the new version defaults the flux to NaN and the errors to 0.0. I think the new version is closer to the intended default values. |
916d2ac
to
1addf63
Compare
1addf63
to
8bc4bf3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. I'll take your word that the new regtest result is the more appropriate result.
For posterity - the new result matches the default return value for the _extract_src_flux function in extract1d.py when no good data points are found: |
Resolves JP-3601
Closes #8431
This PR fixes a crash in an extraction background edge case, in which both lower and upper limits for the background region are outside the valid area for some data range.
Checklist for maintainers
CHANGES.rst
within the relevant release sectionHow to run regression tests on a PR