Skip to content

Commit

Permalink
Compute ERA from LST for megacam
Browse files Browse the repository at this point in the history
  • Loading branch information
parejkoj committed Nov 18, 2016
1 parent 47bf749 commit d96601a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions python/lsst/obs/cfht/makeMegacamRawVisitInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
from __future__ import division
from __future__ import print_function

import astropy.units

from lsst.afw.coord import Coord, IcrsCoord, Observatory, Weather
from lsst.obs.base import MakeRawVisitInfo

Expand Down Expand Up @@ -61,6 +63,9 @@ def setArgDict(self, md, argDict):
self.popFloat(md, "PRESSURE")*100.0, # 100 Pascal per millibar
self.popFloat(md, "RELHUMID"),
)
# Using LST to compute ERA until we get UT1 (see: DM-8053)
LST = self.popAngle(md, "LST-OBS", units=astropy.units.h)
argDict['era'] = self.eraFromLstAndLongitude(LST, argDict["observatory"].getLongitude())

def getDateAvg(self, md, exposureTime):
"""Return date at the middle of the exposure
Expand Down
4 changes: 4 additions & 0 deletions tests/testButler.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ def setUp(self):
self.weath_airTemperature = 0.90
self.weath_airPressure = 617.65*100 # 100 Pascal/millibar
self.weath_humidity = 39.77
# NOTE: if we deal with DM-8053 and get UT1 implemented, ERA will change slightly.
lst = 104.16591666666666*degrees
self.era = lst - self.obs_longitude

def tearDown(self):
del self.butler
Expand Down Expand Up @@ -126,6 +129,7 @@ def testRaw(self):

visitInfo = raw.getInfo().getVisitInfo()
self.assertAlmostEqual(visitInfo.getDate().get(), self.dateAvg.get())
self.assertEqual(visitInfo.getEra(), self.era)
self.assertAlmostEqual(visitInfo.getExposureTime(), self.exposureTime)
self.assertAlmostEqual(visitInfo.getDarkTime(), self.darkTime)
self.assertCoordsNearlyEqual(visitInfo.getBoresightRaDec(), self.boresightRaDec)
Expand Down

0 comments on commit d96601a

Please sign in to comment.