-
Notifications
You must be signed in to change notification settings - Fork 48
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
Force gwcs to always return a F ordered bounding box #522
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #522 +/- ##
==========================================
+ Coverage 87.28% 87.42% +0.14%
==========================================
Files 22 22
Lines 3821 3874 +53
==========================================
+ Hits 3335 3387 +52
- Misses 486 487 +1 ☔ View full report in Codecov by Sentry. |
6993d15
to
55223f9
Compare
jwst regression tests: https://github.com/spacetelescope/RegressionTests/actions/runs/11733040618 |
This warning is very disruptive. It is getting emitted in Jdaviz for just existing. For example:
Here, we merely read in the GWCS from an existing JWST ASDF-in-FITS image and checking whether it is set. Not even doing anything with it. Bam, warning. What are we supposed to do here? We cannot really go change the file in MAST. Hope you can advise. |
|
||
* GWCS uses the ``"F"`` ordering convention, where the tuples are ordered | ||
``((x0min, x0max), (x1min, x1max), ..., (xnmin, xnmax))`` (x,y,z ordering). | ||
* While astropy uses the ``"C"`` ordering convention, where tuples are ordered |
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.
You mean specifically astropy.modeling
, right? Things might be different in astropy.wcs
. Should clarify.
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.
astropy.wcs
has no notion of a bounding box.
I am still confused. If downstream, we use it like this, are we already using it correctly? https://github.com/spacetelescope/jdaviz/blob/5130cafd8f8790a3e09b2d82c5ee721a1b909d9f/jdaviz/configs/imviz/wcs_utils.py#L282-L292 ints = data.coords._orig_bounding_box.intervals
if isinstance(ints[0].lower, u.Quantity):
bb_xmin = ints[0].lower.value
bb_xmax = ints[0].upper.value
bb_ymin = ints[1].lower.value
bb_ymax = ints[1].upper.value
else: # pragma: no cover
bb_xmin = ints[0].lower
bb_xmax = ints[0].upper
bb_ymin = ints[1].lower
bb_ymax = ints[1].upper |
If I have to extrapolate from the warnings I already see over at specutils and jdaviz , the way the warning is emitting now, you might get a lot of questions from users just trying to read existing JWST files out there when this patch is released. FYI. |
because there is nothing we can do about it here
because there is nothing we can do about it here
This reverts commit 170d70f.
Just so I can find the trail in the future: |
This PR forces GWCS to always return an F ordered bounding box. It raises a warning when it discovers a non-F ordered bounding box that it needs to convert.