Skip to content

Commit

Permalink
Use astropy pixel_to_pixel in calc_pixmap
Browse files Browse the repository at this point in the history
  • Loading branch information
mcara committed Oct 25, 2024
1 parent 6b0a118 commit 99d15a7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
7 changes: 7 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
Release Notes
=============


2.0.1 (unreleased)
==================

- Use ``astropy``'s ``pixel_to_pixel()`` in ``utils.calc_pixmap()``. [#161]


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

Expand Down
3 changes: 2 additions & 1 deletion drizzle/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import math

from astropy.wcs.utils import pixel_to_pixel
import numpy as np

__all__ = ["calc_pixmap", "decode_context", "estimate_pixel_scale_ratio"]
Expand Down Expand Up @@ -74,7 +75,7 @@ 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))
x, y = pixel_to_pixel(x, y)
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 @@ -7,7 +7,7 @@ authors = [
]
dependencies = [
"numpy",
"astropy",
"astropy>=5.0",
]
dynamic = [
"version",
Expand Down

0 comments on commit 99d15a7

Please sign in to comment.