You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to construct a very simple dummy GWCS to essentially just do an identity transform from pixel to pixel coordinates. I would have thought the code below would be sufficient, but I'm getting an error trace related to pixel_bounds and bounding_box. I thought that having pixel_bounds set as None was a common use case, so this surprised me. Would you please let me know if there's something wrong with my code below, or if this is a bug in GWCS?
This results in the following when trying to actually use the dummy GWCS:
dummy_wcs([2*u.pix, 8*u.pix])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/rosteen/opt/anaconda3/envs/viz_dev/lib/python3.9/site-packages/gwcs/wcs.py", line 363, in __call__
if self.bounding_box is not None:
File "/Users/rosteen/opt/anaconda3/envs/viz_dev/lib/python3.9/site-packages/gwcs/wcs.py", line 1321, in bounding_box
bb = transform_0.bounding_box
AttributeError: 'NoneType' object has no attribute 'bounding_box'
The text was updated successfully, but these errors were encountered:
In the grand tradition of figuring things out after publicly asking about them, I realized that this is because both the input and output frame end up with the identical generic name "CoordinateFrame" and the GWCS machinery seems to get confused getting the transform, instead returning None instead of the proper transform. If I give my coordinate frames names it works, but note that it still fails if I give separate unnamed CoordinateFrame as the input and output frame.
It seems like using unnamed coordinate frames shouldn't be a failure mode, or at least that the error message resulting from that case should be more informative, so I'm going leave this issue open and rename it.
rosteen
changed the title
bounding_box error with simple GWCS
Unnamed coordinate frames of the same type cause bounding_box error
Jan 25, 2022
I'm trying to construct a very simple dummy GWCS to essentially just do an identity transform from pixel to pixel coordinates. I would have thought the code below would be sufficient, but I'm getting an error trace related to
pixel_bounds
andbounding_box
. I thought that havingpixel_bounds
set asNone
was a common use case, so this surprised me. Would you please let me know if there's something wrong with my code below, or if this is a bug in GWCS?This results in the following when trying to actually use the dummy GWCS:
The text was updated successfully, but these errors were encountered: