Skip to content

Commit

Permalink
Disable bounding box in calc_pixmap
Browse files Browse the repository at this point in the history
  • Loading branch information
mcara committed Dec 16, 2024
1 parent 8978081 commit 8740532
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,13 @@ jobs:
envs: |
- linux: check-style
- linux: check-security
- linux: py310-xdist
- linux: py311-xdist
- linux: py313-xdist
- macos: py312-xdist
- windows: py312-xdist
- linux: py312-xdist-cov
coverage: codecov
- linux: py312-xdist-devdeps
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
8 changes: 8 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
Release Notes
=============

2.0.1 (2024-12-16)
==================

- Update ``utils.calc_pixmap`` code to be ready for upcoming changes in GWCS
due to which inverse WCS transformations will respect bounding box by
disabling the bounding box when computing pixel map. [#164]


2.0.0 (2024-10-23)
==================

Expand Down
2 changes: 1 addition & 1 deletion drizzle/resample.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from drizzle import cdrizzle

__all__ = ["blot_image", "Drizzle"]
__all__ = ["Drizzle", "blot_image"]

SUPPORTED_DRIZZLE_KERNELS = [
"square",
Expand Down
12 changes: 11 additions & 1 deletion drizzle/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,17 @@ def calc_pixmap(wcs_from, wcs_to, shape=None):
)

y, x = np.indices(shape, dtype=np.float64)
x, y = wcs_to.world_to_pixel_values(*wcs_from.pixel_to_world_values(x, y))

# temporarily disable the bounding box:
orig_bbox = wcs_to.bounding_box
wcs_to.bounding_box = None
try:
x, y = wcs_to.world_to_pixel_values(

Check warning on line 82 in drizzle/utils.py

View check run for this annotation

Codecov / codecov/patch

drizzle/utils.py#L80-L82

Added lines #L80 - L82 were not covered by tests
*wcs_from.pixel_to_world_values(x, y)
)
finally:
wcs_to.bounding_box = orig_bbox

Check warning on line 86 in drizzle/utils.py

View check run for this annotation

Codecov / codecov/patch

drizzle/utils.py#L86

Added line #L86 was not covered by tests

pixmap = np.dstack([x, y])
return pixmap

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ authors = [
{ name = "STScI", email = "[email protected]" },
]
dependencies = [
"numpy",
"astropy",
"numpy",
]
dynamic = [
"version",
Expand Down

0 comments on commit 8740532

Please sign in to comment.