-
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
AL-875: Add memory saving options to compute_weight_threshold sigma_clip call #312
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #312 +/- ##
==========================================
+ Coverage 86.21% 86.35% +0.14%
==========================================
Files 47 49 +2
Lines 8812 8905 +93
==========================================
+ Hits 7597 7690 +93
Misses 1215 1215 ☔ View full report in Codecov by Sentry. |
I'm pretty confident this will not change anything downstream, as the unit tests for the changed function appear to be relatively robust, but I started some downstream JWST regression tests here anyway edit: these failures are unrelated |
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!
Resolves AL-875
This PR adds memory-saving options to a call to astropy
sigma clip
withincompute_weight_threshold
in an attempt to decrease the overall memory usage of outlier detection step (see flamegraphs on JP-3685), which cause that function to modify the input array in-place instead of copying it and allocating extra arrays for masks. Since the output sigma-clipped array is immediately collapsed into its mean, there is no need to retain it as a masked array and the behavior is unchanged.Note that the "masked=False" option to sigma_clip does not affect that function's processing of input masked arrays, it only specifies whether the output is a masked array with clipped pixels masked, or a simple np.array with clipped pixels removed.
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