-
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
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8554 +/- ##
==========================================
- Coverage 76.81% 66.84% -9.98%
==========================================
Files 496 376 -120
Lines 45610 37998 -7612
==========================================
- Hits 35034 25398 -9636
- Misses 10576 12600 +2024
☔ 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
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.
ASDF still needs a bump to >=3.3.0
It looks like your auto-formatter touched CHANGES.rst, which is making the CI unhappy
Needs a changelog fragment
I forgot to remove two imports that are no longer used in test_outlier_detection.py, namely create_fitswcs()
and compute_s_region_imaging()
Other than those small things that are needed to make our CI pass, this looks good to me.
Regression test run: https://github.com/spacetelescope/RegressionTests/actions/runs/12395581275/job/34601785739 MIRI LRS differences are expected, since the bounding_box has changed. |
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 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
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