Skip to content
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

Make Readnoise Monitor less memory-intensive #922

Merged
merged 4 commits into from
Apr 13, 2022

Conversation

bsunnquist
Copy link
Collaborator

This PR does the following

  • switch to perform the readnoise calculation in smaller slices to reduce memory pressure
  • makes the plot limits work better with the ranges in values we're seeing (applied same change to bias monitor too, while I was at it)
  • less stringent minimum groups required to calculate readnoise, to maximize the number of data points
  • increased the lookback time, so these changes would be applied to all of the new darks we received

The first point is the main one - it addresses the memory issues noted in #905 , and (after the jwst pipeline is switched to jwst1.4.3) should also solve #900.

@pep8speaks
Copy link

pep8speaks commented Apr 8, 2022

Hello @bsunnquist, Thank you for updating !

Line 47:1: E402 module level import not at top of file
Line 48:1: E402 module level import not at top of file
Line 49:1: E402 module level import not at top of file
Line 50:1: E402 module level import not at top of file
Line 52:1: E402 module level import not at top of file
Line 53:1: E402 module level import not at top of file
Line 54:1: E402 module level import not at top of file
Line 55:1: E402 module level import not at top of file
Line 56:1: E402 module level import not at top of file
Line 57:1: E402 module level import not at top of file
Line 58:1: E402 module level import not at top of file
Line 59:1: E402 module level import not at top of file
Line 60:1: E402 module level import not at top of file
Line 61:1: E402 module level import not at top of file
Line 62:1: E402 module level import not at top of file
Line 63:1: E402 module level import not at top of file
Line 64:1: E402 module level import not at top of file
Line 357:61: E226 missing whitespace around arithmetic operator
Line 357:110: E226 missing whitespace around arithmetic operator
Line 360:61: E226 missing whitespace around arithmetic operator
Line 360:110: E226 missing whitespace around arithmetic operator
Line 372:33: E226 missing whitespace around arithmetic operator
Line 389:13: E128 continuation line under-indented for visual indent
Line 389:42: E712 comparison to True should be 'if cond is True:' or 'if cond:'
Line 424:13: E722 do not use bare 'except'
Line 460:13: E722 do not use bare 'except'
Line 608:67: E226 missing whitespace around arithmetic operator
Line 608:70: E226 missing whitespace around arithmetic operator
Line 610:66: E226 missing whitespace around arithmetic operator

Comment last updated at 2022-04-13 16:46:16 UTC

@bsunnquist
Copy link
Collaborator Author

@bhilbert4 this is ready for review whenever. It should solve all of the ongoing readnoise monitor issues (assuming also the jwst pipeline is updated to 1.4.3)

@mfixstsci mfixstsci self-requested a review April 11, 2022 15:25
@mfixstsci
Copy link
Collaborator

@bsunnquist thank you for the submission, I went ahead and had a few questions/comments.

@mfixstsci mfixstsci self-requested a review April 11, 2022 20:58
@bsunnquist
Copy link
Collaborator Author

thanks @mfixstsci , did your review post? I don't see any questions, just that one comment so far

@@ -542,16 +548,23 @@ def run(self):
siaf = Siaf(self.instrument)
possible_apertures = list(siaf.apertures)

# Get the minimum groups needed to calculate readnoise for this instrument. MIRI
# removes the first five and last group before calculating the readnoise, so needs extra.
if instrument == 'miri':
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Were all minimum groups set to a higher value previously?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, and it missed the cases where there were lots of ints but low groups, which should still be able to give a good cds readnoise measure. Though this comment reminded me of something, so I made another tweak to this logic in a new push.

@@ -181,5 +181,11 @@ def update_mean_bias_figures(self):
if len(bias_vals) != 0:
self.refs['mean_bias_xr_amp{}_{}'.format(amp, kind)].start = expstarts.min() - timedelta(days=3)
self.refs['mean_bias_xr_amp{}_{}'.format(amp, kind)].end = expstarts.max() + timedelta(days=3)
self.refs['mean_bias_yr_amp{}_{}'.format(amp, kind)].start = min(x for x in bias_vals if x is not None) - 20
self.refs['mean_bias_yr_amp{}_{}'.format(amp, kind)].end = max(x for x in bias_vals if x is not None) + 20
min_val, max_val = min(x for x in bias_vals if x is not None), max(x for x in bias_vals if x is not None)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for tackling the same issue with the bias monitor as well.

@mfixstsci
Copy link
Collaborator

@bsunnquist I guess I didn't hit the big green button 😓 let me know if you see it now.

@bsunnquist
Copy link
Collaborator Author

bsunnquist commented Apr 13, 2022

thanks @mfixstsci I just made one more minor tweak to the minimum group/int logic, but let me know if you see any issues. This latest strategy will make sure images with lots of ints/low groups will still get processed, but also ensure the total number of these cds frames is still large enough to give meaningful measurements

@bsunnquist
Copy link
Collaborator Author

and one more tweak, to push back the lookback time a little more to make sure it picks up the earliest dark data

Copy link
Collaborator

@mfixstsci mfixstsci left a 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!

@mfixstsci mfixstsci merged commit 2980a5f into spacetelescope:develop Apr 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants