-
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-3763: Fix crash combining full and subarray for background #8787
JP-3763: Fix crash combining full and subarray for background #8787
Conversation
1df761f
to
9eedc66
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8787 +/- ##
==========================================
+ Coverage 61.86% 61.89% +0.03%
==========================================
Files 377 377
Lines 38911 38954 +43
==========================================
+ Hits 24071 24110 +39
- Misses 14840 14844 +4 ☔ View full report in Codecov by Sentry. |
9eedc66
to
8b45869
Compare
Never mind! I found your original ticket for this issue (#7807) with your example program. |
@melanieclarke Yep, that's exactly the one :) |
@thomaswilliamsastro - thanks for confirming! I'm looking through the associations for that program, but I don't see one that specifies a background member for the SUB256 data. Did I miss one, or do you use a custom association for this task? |
@melanieclarke I used a custom association, so all the M33 data with "SKY" in the name is the background, and is associated to anything that doesn't have that |
Thanks, I got it now and I'm able to reproduce the problem. I think this could use either a unit test or a regression test, to make sure we don't break your use case again. Would you like to try adding a unit test to cover your changes? If you don't have the bandwidth, I can take a look. |
I'm not well-versed in unit tests, so I'm very happy to leave it with you! |
I sent you a PR to your repo with some unit tests, and a few suggested fixes: |
f9265b6
to
5868435
Compare
I've merged, rebased onto main, and pushed |
Thanks! This looks good to me now, but I'm going to tag in another reviewer to take a quick look, since I contributed some tests. |
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. Starting regression tests here and I'd approve this assuming no unexpected failures. My two questions are only minor
Thanks Ned, I forgot I hadn't run a full set of regression tests yet! |
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.
No failures in regtests.
@emolter - are you happy with this one now? |
Resolves JP-3763
This PR addresses combining full and subarray observations to accumulate a background. This fixes an issue introduced with #8326, where if you try to use a full frame observation to create a background for a subarray observation, it would crash. This instead uses the best of both worlds: if a multi-int exposure, it will use NINTS from the background obs to form a mean background. If you're mismatching full/subarray observations, it'll use the x/y size of the science to avoid array size mismatches.
I can't run regression tests, but have verified it works in my case
Tasks
CHANGES.rst
within the relevant release section (otherwise add theno-changelog-entry-needed
label to this PR)docs/
page