Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use astropy pixel_to_pixel in calc_pixmap #161

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
4 changes: 3 additions & 1 deletion drizzle/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import numpy as np

from astropy.wcs.utils import pixel_to_pixel

__all__ = ["calc_pixmap", "decode_context", "estimate_pixel_scale_ratio"]

_DEG2RAD = math.pi / 180.0
Expand Down Expand Up @@ -74,7 +76,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(wcs_from, wcs_to, 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
Loading