From 3173496c5415b2ebcbb3783aba05ba1c6e898a94 Mon Sep 17 00:00:00 2001 From: Navin Chaurasiya Date: Thu, 12 Mar 2026 11:38:21 -0400 Subject: [PATCH] solves #726: bug in default inverse mapping sky2pix_proj can't access the __name__ attribute of the parent class, so explicitly access from the parent class. --- gwcs/wcs/_wcs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gwcs/wcs/_wcs.py b/gwcs/wcs/_wcs.py index 1b185bd8..9fe93bb0 100644 --- a/gwcs/wcs/_wcs.py +++ b/gwcs/wcs/_wcs.py @@ -2787,14 +2787,14 @@ def _calc_approx_inv(self, max_inv_pix_error=5, inv_degree=None, npoints=16): if isinstance(transform, projections.Projection): sky2pix_proj = transform break - if sky2pix_proj.__name__.startswith("Pix2Sky"): + if sky2pix_proj.__class__.__name__.startswith("pix2sky"): sky2pix_proj = sky2pix_proj.inverse lon_pole = _compute_lon_pole((crval1, crval2), sky2pix_proj) ntransform = ( (Shift(crpix[0]) & Shift(crpix[1])) | self.forward_transform | RotateCelestial2Native(crval1, crval2, lon_pole) - | sky2pix_proj() + | sky2pix_proj ) # standard sampling: