Skip to content

Commit

Permalink
Adopt LSST boresightRotAngle convention for imsim
Browse files Browse the repository at this point in the history
The LSST convention for the boresight rotation angle is such that,

At boresightRotAngle = 0, the focal plane pixels are alligned:
+x: E->W (-ve RA), +y: S->N (+ve Dec)

To match this convention, the imsim data requires the following:

boresightRotAngle = 90 deg - ROTANGLE

where ROTANGLE is the FITS header card in the raw imsim data.

Prior to the "translator" method of standardizing metadata from obs
packages to the consistent set of LSST conventions, this rotation
was being accommodated in lsstCameraMapper.py.  This removes the
latter accommodation and adds it to the imsim translator.
  • Loading branch information
laurenam committed Sep 12, 2019
1 parent ff545ac commit 26d62a0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 2 additions & 3 deletions python/lsst/obs/lsst/lsstCamMapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,10 @@ def assemble_raw(dataId, componentInfo, cls):
exposure.getInfo().setVisitInfo(visitInfo)

boresight = visitInfo.getBoresightRaDec()
rotangle = visitInfo.getBoresightRotAngle()
boresightRotAngle = visitInfo.getBoresightRotAngle()

if boresight.isFinite():
exposure.setWcs(getWcsFromDetector(exposure.getDetector(), boresight,
90*geom.degrees - rotangle))
exposure.setWcs(getWcsFromDetector(exposure.getDetector(), boresight, boresightRotAngle))
else:
# Should only warn for science observations but VisitInfo does not know
logger.warn("Unable to set WCS for %s from header as RA/Dec/Angle are unavailable" %
Expand Down
8 changes: 7 additions & 1 deletion python/lsst/obs/lsst/translators/imsim.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import logging
import astropy.units as u
from astropy.coordinates import Angle

from astro_metadata_translator import cache_translation
from astro_metadata_translator.translators.helpers import tracking_from_degree_headers
Expand Down Expand Up @@ -49,7 +50,6 @@ class ImsimTranslator(LsstSimTranslator):
"dark_time": ("DARKTIME", dict(unit=u.s)),
"exposure_time": ("EXPTIME", dict(unit=u.s)),
"detector_serial": "LSST_NUM",
"boresight_rotation_angle": ("ROTANGLE", dict(unit=u.deg)),
}

cameraPolicyFile = "policy/imsim.yaml"
Expand Down Expand Up @@ -92,3 +92,9 @@ def to_boresight_airmass(self):
if altaz is not None:
return altaz.secz.to_value()
return None

@cache_translation
def to_boresight_rotation_angle(self):
angle = Angle(90.*u.deg) - Angle(self.quantity_from_card("ROTANGLE", u.deg))
angle = angle.wrap_at("360d")
return angle

0 comments on commit 26d62a0

Please sign in to comment.