Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-9111 Add rotator information to HSC VisitInfo #65

Merged
merged 1 commit into from
Mar 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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