Skip to content
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
11 changes: 11 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
===================
STWCS Release Notes
===================


1.7.8 (TBD)
-----------

- Bug fix for empty scale value returned from idctab [#249]


1.7.7 (2026-03-05)
------------------

Expand Down
4 changes: 4 additions & 0 deletions stwcs/distortion/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,16 @@ def make_orthogonal_cd(wcs):
pv += wcs.idctheta
cs = np.cos(np.deg2rad(pv))
sn = np.sin(np.deg2rad(pv))

pvmat = np.dot(np.array([[cs, sn], [-sn, cs]]), wcs.parity)
rot = np.arctan2(pvmat[0, 1], pvmat[1, 1])

det = linalg.det(wcs.parity)
if hasattr(wcs, 'idcscale') and wcs.idcscale is not None:
scale = (wcs.idcscale) / 3600. # HST pixel scale provided
else:
warnings.warn("IDCSCALE is missing, computing it from CD matrix.")
scale = np.sqrt(np.abs(det)) # find as sqrt(pixel area)
else:

det = linalg.det(cd)
Expand Down
Loading