Skip to content

Commit

Permalink
Fill in HSC VisitInfo boresightRotAngle
Browse files Browse the repository at this point in the history
Uses the formula
boresightRotAngle = 270 - INST-PA
where INST-PA is the position angle from the HSC file header.
Also sets rotType to rotType.SKY.
  • Loading branch information
jmeyers314 committed Mar 15, 2017
1 parent 4173d19 commit 233bc89
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
11 changes: 7 additions & 4 deletions python/lsst/obs/hsc/makeHscRawVisitInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,14 @@

from lsst.afw.geom import degrees
from lsst.afw.coord import Coord, IcrsCoord, Observatory, Weather
from lsst.afw.image import RotType
from lsst.obs.base import MakeRawVisitInfo

__all__ = ["MakeHscRawVisitInfo"]


class MakeHscRawVisitInfo(MakeRawVisitInfo):
"""Make a VisitInfo from the FITS header of a Subaru HSC image
Boresight rotation angle could probably be set from one of:
- INST-PT (but apparently only available for HSC, not suprimecam)
- INR-TR, INR-END (but appears to not be SKY; so probably not interesting)
"""
observatory = Observatory(-155.476667*degrees, 19.825556*degrees, 4139) # long, lat, elev

Expand Down Expand Up @@ -67,6 +64,12 @@ def setArgDict(self, md, argDict):
argDict['era'] = self.eraFromLstAndLongitude(LST, self.observatory.getLongitude())
argDict['darkTime'] = argDict['exposureTime']

# Rotation angle formula determined empirically from visual inspection
# of HSC images. See DM-9111.
rotAngle = (270.0*degrees - self.popAngle(md, "INST-PA")).wrap()
argDict['boresightRotAngle'] = rotAngle
argDict['rotType'] = RotType.SKY

def getDateAvg(self, md, exposureTime):
"""Return date at the middle of the exposure
Expand Down
6 changes: 3 additions & 3 deletions tests/testRepository.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ def setUp(self):
self.boresightRaDec = IcrsCoord('21:22:59.982', '+00:30:00.07')
self.boresightAzAlt = Coord(226.68922661*degrees, 63.04359233*degrees)
self.boresightAirmass = 1.121626027604189
self.boresightRotAngle = float("nan")*degrees
self.rotType = RotType.UNKNOWN
self.boresightRotAngle = 270.0*degrees
self.rotType = RotType.SKY
self.obs_longitude = -155.476667*degrees
self.obs_latitude = 19.825556*degrees
self.obs_elevation = 4139
Expand Down Expand Up @@ -134,7 +134,7 @@ def testRaw(self):
self.assertCoordsNearlyEqual(visitInfo.getBoresightRaDec(), self.boresightRaDec)
self.assertCoordsNearlyEqual(visitInfo.getBoresightAzAlt(), self.boresightAzAlt)
self.assertAlmostEqual(visitInfo.getBoresightAirmass(), self.boresightAirmass)
self.assertTrue(math.isnan(visitInfo.getBoresightRotAngle().asDegrees()))
self.assertAnglesNearlyEqual(visitInfo.getBoresightRotAngle(), self.boresightRotAngle)
self.assertEqual(visitInfo.getRotType(), self.rotType)
self.assertEqual(visitInfo.getExposureTime(), self.exptime)
self.assertEqual(visitInfo.getDarkTime(), self.darktime)
Expand Down

0 comments on commit 233bc89

Please sign in to comment.