From aad73f85ad080ca3b496bdd16ac40d8b34945788 Mon Sep 17 00:00:00 2001 From: Shannon Osborne Date: Mon, 4 Mar 2019 13:38:47 -0500 Subject: [PATCH] Fix as discussed for issue #279 --- webbpsf/webbpsf_core.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/webbpsf/webbpsf_core.py b/webbpsf/webbpsf_core.py index 28059335..d6033aae 100644 --- a/webbpsf/webbpsf_core.py +++ b/webbpsf/webbpsf_core.py @@ -703,11 +703,12 @@ def detector(self, value): self._detector_geom_info = DetectorGeometry(self.name, self._detectors[self._detector]) def _tel_coords(self): - """ Convert from detector pixel coordinates to SIAF aperture coordinates, + """ Convert from science frame coordinates to telescope frame coordinates using + SIAF transformations. Returns (V2, V3) tuple, in arcminutes. - Returns (V2, V3) tuple, in arcminutes. Note that the astropy.units framework is used to return the result as a - dimensional Quantity. """ + dimensional Quantity. + """ return self._detector_geom_info.pix2angle(self.detector_position[0], self.detector_position[1]) @@ -731,7 +732,7 @@ def set_position_from_aperture_name(self, aperture_name): try: ap = siaf[aperture_name] - self.detector_position = (ap.XDetRef, ap.YDetRef) + self.detector_position = (ap.XSciRef, ap.YSciRef) detname = aperture_name.split('_')[0] self.detector = detname # As a side effect this auto reloads SIAF info, see detector.setter _log.debug("From {} set det. pos. to {} {}".format(aperture_name, detname, self.detector_position)) @@ -2007,7 +2008,9 @@ def validate_coords(self, x, y): raise ValueError("Detector pixels Y coordinate cannot be > {0}".format(int(self.shape[1]) - 1)) def pix2angle(self, xpix, ypix): - """ Convert from detector coordinates to telescope frame coordinates using SIAF transformations + """ Convert from science frame coordinates (in pixels) to telescope frame coordinates + (in arcminutes) using SIAF transformations. + See the pysiaf code for all the full details, or Lallo & Cox Tech Reports Parameters