Skip to content

Commit 0cf7ee2

Browse files
Jammy2211Jammy2211
authored andcommitted
all tests pass and working in Euclid
1 parent 1395b79 commit 0cf7ee2

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

autoarray/geometry/geometry_util.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -379,19 +379,12 @@ def pixel_coordinates_wcs_2d_from(
379379
xcen_wcs = (nx + 1) / 2.0
380380

381381
# Continuous WCS pixel coordinates (NO int-cast, NO +0.5 binning)
382-
y_wcs = (
383-
(-scaled_coordinates_2d[0] + origins[0]) / pixel_scales[0]
384-
+ ycen_wcs
385-
)
386-
x_wcs = (
387-
(scaled_coordinates_2d[1] - origins[1]) / pixel_scales[1]
388-
+ xcen_wcs
389-
)
382+
y_wcs = (-scaled_coordinates_2d[0] + origins[0]) / pixel_scales[0] + ycen_wcs
383+
x_wcs = (scaled_coordinates_2d[1] - origins[1]) / pixel_scales[1] + xcen_wcs
390384

391385
return (y_wcs, x_wcs)
392386

393387

394-
395388
def transform_grid_2d_to_reference_frame(
396389
grid_2d: np.ndarray, centre: Tuple[float, float], angle: float, xp=np
397390
) -> np.ndarray:

test_autoarray/geometry/test_geometry_util.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -974,6 +974,7 @@ def test__pixel_coordinates_2d_from():
974974

975975
import pytest
976976

977+
977978
def test__pixel_coordinates_wcs_2d_from():
978979
# -----------------------------
979980
# (2,2) grid: centre is (1.5, 1.5) in WCS pixels

0 commit comments

Comments
 (0)