-
Notifications
You must be signed in to change notification settings - Fork 167
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-3570: Match NaNs and DO_NOT_USE flags #8557
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #8557 +/- ##
==========================================
+ Coverage 60.63% 60.83% +0.19%
==========================================
Files 372 373 +1
Lines 38372 38636 +264
==========================================
+ Hits 23267 23503 +236
- Misses 15105 15133 +28 ☔ View full report in Codecov by Sentry. |
384587a
to
98c9200
Compare
Started regression tests here: I predict many new NaNs! |
Now that we are past build 11.0, I think this is ready for discussion and testing. Regression test results:
|
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.
LG2M.
Thanks, @drlaw1558 for coordinating the testing! I'll rebase and fix up the conflicts with later development and see if we can get this in. |
Outlier detection changed significantly after I initially wrote this PR, so I'm re-requesting review from @emolter and @braingram, if you have a chance. Re-run for regression tests is here: Re-re-run on Jenkins, since the number of failures overwhelmed the report in GitHub actions: |
Edit: I'm looking at the right nightly results now and can see which changes are unrelated. Reviewing now. |
I think the regression test output is as expected, compared to the previous run. One thing I noticed in addition to the differences noted above: i2d and crf output for image3 is sometimes different (e.g. test_miri_image3_i2d) because tweakreg is seeing a different set of sources to cross match on. It might be worth looking into how the starfinder is handling NaNs: I wouldn’t have expected to see much difference here, since the DO_NOT_USE mask is already passed. |
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.
It looks like match_nans_and_flags
will not get called during the outlier detection step if resample_data
is False
for imaging or spectroscopic modes. Is that true, and if so, is that the intended behavior?
It should still be called in that case, via |
Hm, looking into this MIRI imaging case you linked above quickly. I'm getting results that are different from the artifactory reference data, but not because of this PR (results I get with jwst master seem identical to what I get using this branch). MIRI just changed a lot of reference files though, including all of the darks, and those may be the reason for the difference. |
@emolter - confirmed, it's definitely called for image and spec outlier detection when resample_data is False. @drlaw1558 - the new ref files are definitely confusing things in comparing to the current truth files, but I think there is additionally a change in tweakreg due to this branch. I ran the regtest locally with the same CRDS context on the current main and PR branches and compared the log output. On main, tweakreg reports:
On this branch, tweakreg reports:
It's not a big change, and I don't think it should hold up this PR, but we might want to follow up on it later to make sure the star finder isn't handling NaNs badly. |
146f1c2
to
8ce201d
Compare
Regression tests one more time, to test the changes with the ModelLibrary work: |
Cross matching regression tests to the previous run, I don't see anything new or unexpected, so I think this is ready to go. @tapastro, over to you! |
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 - I'll leave it to you to okify, if you have the time to do so!
Okifying is done. Let me know if you see problems. |
Resolves JP-3570
Closes #8345
Make a function that updates a datamodel with NaN values in data, error, or variance arrays whenever the DO_NOT_USE flag is set, and updates the dq array to DO_NOT_USE whenever a NaN value is found in data, error, or variance arrays.
Call the function on output data at the end of several key steps where DO_NOT_USE might be set:
Also call it on input data at the beginning of a couple key steps where data are combined:
Checklist for PR authors (skip items if you don't have permissions or they are not applicable)
CHANGES.rst
within the relevant release sectionupdated relevant documentationHow to run regression tests on a PR