Skip to content

Commit d4ad8c7

Browse files
committed
Fix two WCS bugs
1 parent 753cd5c commit d4ad8c7

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

asdf_astropy/converters/wcs/wcs.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# These attributes don't end up in the hdulist and
44
# instead will be stored in "attrs"
5-
_WCS_ATTRS = ("naxis", "colsel", "keysel", "key", "pixel_bounds")
5+
_WCS_ATTRS = ("naxis", "_naxis", "colsel", "keysel", "key", "pixel_bounds")
66

77

88
class WCSConverter(Converter):
@@ -18,6 +18,8 @@ def from_yaml_tree(self, node, tag, ctx):
1818
if naxis := attrs.pop("naxis"):
1919
hdulist[0].header["naxis"] = naxis
2020

21+
_naxis = attrs.pop("_naxis")
22+
2123
pixel_bounds = attrs.pop("pixel_bounds")
2224

2325
wcs = WCS(hdulist[0].header, fobj=hdulist, **attrs)
@@ -29,6 +31,9 @@ def from_yaml_tree(self, node, tag, ctx):
2931
wcs.wcs.set()
3032

3133
wcs.pixel_bounds = pixel_bounds
34+
35+
if _naxis:
36+
wcs._naxis = _naxis
3237
return wcs
3338

3439
def to_yaml_tree(self, wcs, tag, ctx):

asdf_astropy/resources/schemas/wcs/slicedwcs-1.0.0.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ allOf:
1616
- type: object
1717
properties:
1818
wcs:
19-
tag: "tag:astropy.org:astropy/wcs/wcs-1*"
19+
anyOf:
20+
- tag: "tag:astropy.org:astropy/wcs/wcs-1*"
21+
- tag: "tag:stsci.edu:gwcs/wcs-*"
22+
2023
slices_array:
2124
type: array
2225
items:

0 commit comments

Comments
 (0)