spacetelescope/pysiaf

Change name of dms_corner()

bhilbert4 opened this issue · 3 comments

The name of the dms_corner attribute of a SIAF aperture is misleading. It appears that this function actually returns the OSS corner coordinates for one of the aperture corners. It would be helpful to rename the attribute to oss_corner or something similar.

The Mirage package contains a function (written by Johannes Sahlmann) to return the DMS coordinates of the aperture corners. Feel free to steal it and use it for the dms_corner attribute if that's convenient.

https://github.com/spacetelescope/mirage/blob/master/mirage/utils/siaf_interface.py#L223

I second this: I wrotedms_corner and I realized later it was a bit of a misnomer. This method of the aperture class does indeed return the value of the OSS "ColCorner, RowCorner" for a given aperture, and these can be directly compared to the corresponding values in the subarray.xml files.

The actual DMS corners should already be available in pysiaf under the 'sci' coordinate system, so I don't think we need to add that.

The sci coordinate system is based on the subarray itself though. e.g. For SUB320, the coordinates go from 0 to 319. What I think of as DMS corners are the coordinates in the full frame coordinate system, with the detector in the DMS orientation. So on the NIRCam A1 detector, the lower left corner of the SUB320 subarray would be (x, y) = (1728, 1728), and the upper right corner is (x, y) = (2048, 2048). I don't see any methods in pysiaf currently to calculate these values. This is what the function in Mirage calculates.