Skip to content

Commit

Permalink
Add crude ERA from LST method and a test for it.
Browse files Browse the repository at this point in the history
  • Loading branch information
parejkoj committed Nov 4, 2016
1 parent 05cedcf commit 22e64d4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
9 changes: 9 additions & 0 deletions python/lsst/obs/base/makeRawVisitInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,15 @@ def popMjdDate(self, md, key, timesys=None):
self.log.warn("Could not parse {} = {} as an MJD date: {}".format(key, mjdDate, e))
return BadDate

@staticmethod
def eraFromLstAndLongitude(lst, longitude):
"""
Convert local sidereal time and longitude (both in degrees) to an approximate Earth Rotation Angle.
NOTE: if we properly compute ERA via UT1 a la DM-8053, we could remove this method.
"""
return lst - longitude

@staticmethod
def altitudeFromZenithDistance(zd):
"""Convert zenith distance to altitude (lsst.afw.geom.Angle)"""
Expand Down
6 changes: 6 additions & 0 deletions tests/testMakeRawVisitInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,12 @@ def testPopMjdDate(self):
missingDate = self.makeRawVisitInfo.popMjdDate(md, "BADKEY")
self.assertEqual(missingDate, DateTime())

def testEraFromLstAndLongitude(self):
LST = 90*degrees
Longitude = 50*degrees
era = self.makeRawVisitInfo.eraFromLstAndLongitude(LST, Longitude)
self.assertEqual(era, LST-Longitude)

def testAltitudeFromZenithDistance(self):
for zdDeg in (0, 35.6, 89.999, 90.0):
desAltDeg = 90-zdDeg
Expand Down

0 comments on commit 22e64d4

Please sign in to comment.