Skip to content

Commit 32c58fc

Browse files
authored
unpin gwcs (#281)
* Unpin gwcs * Use pixel_to_world / world_to_pixel * Make spatial frame output pixels to match input
1 parent 13aca93 commit 32c58fc

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ dependencies = [
2222
"scipy>=1.14.1",
2323
"sunpy>=7.0",
2424
"xarray>=2023.12",
25-
"gwcs>=0.26.0,<1.0.0", #until https://github.com/sunpy/ndcube/issues/913 is resolved
25+
"gwcs>=0.26.0",
2626
"ndcube>=2.3",
2727
]
2828

sunkit_spex/spectrum/spectrum.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def gwcs_from_array(array, flux_shape, spectral_axis_index=None):
137137
spatial_frame = cf.CoordinateFrame(
138138
naxes=naxes - 1,
139139
unit=[
140-
"",
140+
u.pix,
141141
]
142142
* (naxes - 1),
143143
axes_type=[

sunkit_spex/spectrum/tests/test_spectrum.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ def test_gwcs_from_array_1d_wavelength():
5656
assert wcs.output_frame.axes_names[0] == "wavelength"
5757

5858
# Test forward transform (pixel to world)
59-
assert np.allclose(wcs(0), 4000 << u.AA)
60-
assert np.allclose(wcs(99), 7000 << u.AA)
59+
assert np.allclose(wcs.pixel_to_world(0), 4000 * u.AA)
60+
assert np.allclose(wcs.pixel_to_world(99), 7000 * u.AA)
6161

6262
# Test inverse transform (world to pixel)
63-
assert np.allclose(wcs.invert(4000).value, 0)
63+
assert np.allclose(wcs.world_to_pixel_values(4000), 0)
6464

6565

6666
def test_gwcs_from_array_3d_cube():

0 commit comments

Comments
 (0)