Skip to content

Commit

Permalink
Fix as discussed for issue #279
Browse files Browse the repository at this point in the history
  • Loading branch information
shanosborne authored and mperrin committed Mar 11, 2019
1 parent 22be403 commit aad73f8
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions webbpsf/webbpsf_core.py
Expand Up @@ -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])

Expand All @@ -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))
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit aad73f8

Please sign in to comment.