diff --git a/CHANGES.rst b/CHANGES.rst index 1b4bad0..45a9218 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -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) ------------------ diff --git a/stwcs/distortion/utils.py b/stwcs/distortion/utils.py index 9fe555d..4608d33 100644 --- a/stwcs/distortion/utils.py +++ b/stwcs/distortion/utils.py @@ -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)