-
Notifications
You must be signed in to change notification settings - Fork 174
JP-4021: Fix a bug where insufficient valid background pixels case was not caught for WFSS background step #9507
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
Conversation
@gnoir0t does this look ok to you? For some reason I can't request you as a reviewer |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9507 +/- ##
==========================================
- Coverage 78.47% 78.47% -0.01%
==========================================
Files 361 361
Lines 36565 36574 +9
==========================================
+ Hits 28696 28701 +5
- Misses 7869 7873 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
If STScI staff has read access, then the person of interest need to be part of that GH Team. Otherwise, it is recommended we add STScI staff to collaborators with read access only to be able to request any staff member to review. I am unable to check that setting with my access. Hope this helps. |
Let me rephrase: I know the reason, in a technical sense, why I can't request reviews from certain people. I do not know the procedure (if any yet exists) by which I should try to give people that permission. |
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.
LGTM for catching this specific problem, but should we add a safety catch for scale_factor = NaN, just in case some other problem arises we haven't anticipated?
part of me wants to say that if things don't work for reasons we don't understand then it should crash. But I can put the check in if you like |
Yes, please. I think it shouldn't crash for an unforeseen numerical error, but even if it should crash, it shouldn't do so many steps later when we try to save the FITS file. |
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.
LGTM, thanks!
It looks to me like this implementation is as requested on the ticket, so I think we can go ahead and merge and let INS test from there.
@meeseeksdev backport to release/1.18.x |
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon! Remember to remove the If these instructions are inaccurate, feel free to suggest an improvement. |
…t valid background pixels case was not caught for WFSS background step
…t valid background pixels case was not caught for WFSS background step
…ound pixels case was not caught for WFSS background step (#9528) Co-authored-by: Ned Molter <emolter@users.noreply.github.com>
@emolter For the record I made some tests of the PR using an example NIRISS WFSS exposure from PID 1089 and it seems to work as expected. I first tested running the background step with default parameters which ran as expected, and then I ran the same test but I modified the input DQ array to artificially create an exposure with >=95% of non valid pixels, and the background step was skipped as expected. |
Resolves JP-4021
Closes #9504
This PR fixes a bug in the background step for WFSS data caused by the interaction between a mostly-masked input image and a reference background with a substantial region of zero values. See the JIRA ticket for a detailed description of the cause of the bug. This PR updates the
_sufficient_background_pixels
function to account for not only the number of masked pixels, but instead the number of masked pixels for which the background reference file is not identically zero.Tasks
Build 12.0
(use the latest build if not sure)no-changelog-entry-needed
)changes/
:echo "changed something" > changes/<PR#>.<changetype>.rst 8000
(see changelog readme for instructions)docs/
pageokify_regtests
to update the truth files