-
Notifications
You must be signed in to change notification settings - Fork 32
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
Saturation speedup #331
Saturation speedup #331
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #331 +/- ##
=======================================
Coverage 86.14% 86.15%
=======================================
Files 50 50
Lines 9313 9332 +19
=======================================
+ Hits 8023 8040 +17
- Misses 1290 1292 +2 ☔ View full report in Codecov by Sentry. |
Just tested this empirically as well. Can confirm that the groupdq array is unaffected both for an ungrouped case (jw01864005001_03102_00001_mirimage), a grouped IRS2 case (jw01908004001_02101_00005_nrs1, used for previous testing of spacetelescope/jwst#8593), and a grouped NIRCam case (jw02756003001_03101_00001_nrcalong), with appreciable runtime gains in the long-integration limit (17 seconds to 3 seconds in the 292 group MIRI case here). Also looks like the slow binary_dilation behavior has been a known issue for the last few years: scipy/scipy#13991 |
Co-authored-by: Brett Graham <[email protected]>
Just checking in on the status of this PR? |
It looks like we lost track of this one, sorry! Is there anything more to do from your side, @t-brandt? If not, I can start regression tests. |
I'm all set with this one, thanks @melanieclarke! |
Romancal tests here: Tagging @schlafly for review: it looks like this code is used in romancal. |
Both regression test runs are clean. |
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.
Thanks!
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.
Tests are passing and we have approval from jwst and romancal - I will go ahead and merge now. Thanks all!
Resolves JP-3820
Closes #
This PR improves the performance of the saturation step, reducing its runtime by as much as a factor of 5-10 while leaving results unchanged. It does this primarily with three changes. First, when a pixel saturates, that saturation is propagated into all subsequent reads using a running boolean tally of pixels that have saturated. Second, ndimage.binary_dilation is very slow, an order of magnitude slower than writing the operations out explicitly. Finally, if there is no averaging in groups, there is no point in the diluted saturation check; this check is skipped if the dilution factor is 1.
Tasks
docs/
pageno-changelog-entry-needed
)changes/
:echo "changed something" > changes/<PR#>.<changetype>.rst
(see below for change types)"git+https://github.com/<fork>/stcal@<branch>"
)jwst
regression testromancal
regression testnews fragment change types...
changes/<PR#>.apichange.rst
: change to public APIchanges/<PR#>.bugfix.rst
: fixes an issuechanges/<PR#>.general.rst
: infrastructure or miscellaneous change