Repository navigation
Fixed bugs with WCS slicing, - #18417
Fixed bugs with WCS slicing, #18417
Conversation
|
Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.
|
Pardon my English, but it is not clear to me whether the above is true before this PR or will it be true after this PR will be merged. |
|
Sorry for the confusing wording. This PR makes is so we can slice 3+D WCS (it failed before) and makes it so we can do wcs[...] and get back a WCS object (we got back SlicedFITSWCS back before) |
|
While it looks like your PR may fix the specific failure, it seems to me it basically is a patch hiding the underlying issue. Based on what I see so far in the code, a lot of things depend on >>> wcs.pixel_shape = None
>>> wcs._naxis
[0, 0]This leads to the following puzzling printout of a 3D WCS (even with your changes): Notice I think a better approach would be to replace |
|
Oh, another bad example: In [13]: w = WCS(naxis=1)
In [14]: w
Out[14]:
WCS Keywords
Number of WCS axes: 1
CTYPE : ''
CRVAL : 0.0
CRPIX : 0.0
PC1_1 : 1.0
CDELT : 1.0
NAXIS : 0 0
In [15]: w._naxis
Out[15]: [0, 0]Why is Lines 3090 to 3091 in ee5a7fe |
|
See #18405, which fixes/hides some of the above |
…th more than 2 dimensions but with _naxis not set would fail, and that slicing a WCS with an ellipsis would not return a WCS object but a SlicedFITSWCS instead
be81731 to
6295fa9
Compare
…417-on-v7.1.x Backport PR #18417 on branch v7.1.x (Fixed bugs with WCS slicing, )
Specifically slicing WCS objects wi…th more than 2 dimensions but with _naxis not set would fail, and that slicing a WCS with an ellipsis would not return a WCS object but a SlicedFITSWCS instead
Fixes #18410