Skip to content

Commit 8bc260b

Browse files
committed
Disable bounding box in calc_pixmap
1 parent dab1009 commit 8bc260b

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,13 @@ jobs:
2222
envs: |
2323
- linux: check-style
2424
- linux: check-security
25-
2625
- linux: py310-xdist
2726
- linux: py311-xdist
2827
- linux: py313-xdist
2928
- macos: py312-xdist
3029
- windows: py312-xdist
3130
- linux: py312-xdist-cov
3231
coverage: codecov
33-
3432
- linux: py312-xdist-devdeps
3533
secrets:
3634
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

CHANGES.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@
44
Release Notes
55
=============
66

7+
2.0.1 (2024-12-16)
8+
==================
9+
10+
- Update ``utils.calc_pixmap`` code to be ready for upcoming changes in GWCS
11+
due to which inverse WCS transformations will respect bounding box by
12+
disabling the bounding box when computing pixel map. [#164]
13+
14+
715
2.0.0 (2024-10-23)
816
==================
917

drizzle/utils.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,21 @@ def calc_pixmap(wcs_from, wcs_to, shape=None):
8585
)
8686

8787
y, x = np.indices(shape, dtype=np.float64)
88-
x, y = wcs_to.world_to_pixel_values(*wcs_from.pixel_to_world_values(x, y))
88+
89+
# temporarily disable the bounding box:
90+
if hasattr(wcs_to, "bounding_box"):
91+
orig_bbox = getattr(wcs_to, "bounding_box", None)
92+
wcs_to.bounding_box = None
93+
else:
94+
orig_bbox = None
95+
try:
96+
x, y = wcs_to.world_to_pixel_values(
97+
*wcs_from.pixel_to_world_values(x, y)
98+
)
99+
finally:
100+
if orig_bbox is not None:
101+
wcs_to.bounding_box = orig_bbox
102+
89103
pixmap = np.dstack([x, y])
90104
return pixmap
91105

0 commit comments

Comments
 (0)