-
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
AL-852: GWCS inverse transform should respect its bounding box #8554
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8554 +/- ##
==========================================
- Coverage 76.81% 66.83% -9.98%
==========================================
Files 496 376 -120
Lines 45610 37998 -7612
==========================================
- Hits 35034 25397 -9637
- Misses 10576 12601 +2025
☔ View full report in Codecov by Sentry. |
The failing oldestdeps tests appear to show that asdf needs a minimum of at least 3.3 now since that's what GWCS needs |
fixed outlier test failures
Without doing too deep a dive, just plotting some of the outputs, it looks to me like as we guessed in stand-up there are just a few more flagged pixels in the data which are then propagating to the output spectra and it's not much to worry about. But I'll let Melanie have the final word on this one |
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.
These changes look good for me other than the comments made by @emolter which look relatively trivial.
Does this warrant a change log fragment?
… Bump min version of asdf. Fix tweakreg step test.
forward_transform = wcs1.pixel_to_world_values | ||
backward_transform = wcs2.world_to_pixel_values | ||
wcs_no_bbox = deepcopy(wcs2) |
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.
I thought deepcopy
ing a WCS is cpu-intense. Wouldn't it be better to you try-finally
to turn it off/on? Still, I think @emolter 's comment about turning this off may be hiding some other issue is relevant. That is, if we do not disable bbox on the inverse, will the custom WCS test (as modified here) still work?
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.
I think most changes are reasonable except for the custom wcs test where output shape is increased to 10k pixels. I believe the original test does not work because of innacurate crval
and that issue about the bbox calculation in stcal
.
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.
I think test_custom_wcs_resample_imaging
needs better parameters that do not require these large output shapes. I also think that we need to investigate why it is necessary to disable bounding box for pixmap computations. However, this should not prevent merging this PR as it allows the pipeline to work as before the major GWCS change.
Attempting to summarize a conversation between @mcara, @braingram, @tapastro, @perrygreenfield and I this morning. This PR fixes multiple issues. The other change is to unset the The latter bug is fixed by spacetelescope/stcal#326, but that PR is currently causing some unexpected Romancal failures. Additional discussion is needed before merging that one. The proposed plan of action is to:
Also tagging @melanieclarke to see if that sounds good |
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.
I'm happy with this given that we think we know the cause of the LRS bounding_box differences
I looked at the MIRI LRS differences in spec2 S_REGION, from this regression test run: I agree that some changes are expected, since there are changes to bounding boxes and the bounding box matters a lot for MIRI LRS, but I don't know the MIRI WCS well enough to validate that the new version is correct. I recommend that we go ahead and merge this, since it fixes other issues and impact to data is otherwise minor, and ask the MIRI team for help validating the S_REGION, either in testing for this build, or in collaboration on other planned changes for the next build. @tapastro - opinions? |
I agree - we'll alert MIRI LRS of the differences for their testing, but they don't appear to be large enough to warrant further investigation before merge. |
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
The bounding box of the MIRI LRS fixed slit was slightly larger that the range of |
GWCS has a bug where the inverse transform does not respect the bounding_box. This leads to unexpected results that affect other applications. The GWCS bud is fixed in spacetelescope/gwcs#498
This PR fixes problems in jwst which surfaced when the bug was fixed.
Checklist for PR authors (skip items if you don't have permissions or they are not applicable)
CHANGES.rst
within the relevant release sectionHow to run regression tests on a PR