Next / Previous / Contents / TCC Help System / NM Tech homepage

18.4. test14-15: Converting between GST and LST

Here's the book's example for GST to LST; the second half is just the same conversion reversed.

What is the local sidereal time on the longitude 64° W when the Greenwich sidereal time is 4h 40m 5.17s?

The book's answer is 0h 24m 5.17s.

test14-15
#!/usr/bin/env python
#================================================================
# test14-15: Test GST <-> LST conversion.
#   For documentation, see:
#     http://www.nmt.edu/tcc/help/lang/python/examples/sidereal/ims/
#----------------------------------------------------------------

import math
import datetime
import sidereal

#--
# First we used MixedUnits to convert 4h 40m 5.17s to decimal hours.
#--
dmsUnits  =  sidereal.MixedUnits ( (60, 60) )
gstHours  =  dmsUnits.mixToSingle ( (4, 40, 5.17) )
gst  =  sidereal.SiderealTime ( gstHours )
print "GST is", gst

#--
# Convert 64 degrees W to radians of E. Long.
#--
eLong = math.radians ( -64.0 )
print "Longitude east of Greenwich is", math.degrees(eLong)

#--
# Convert GST to LST.
#--
lst  =  gst.lst ( eLong )
print "LST is", lst

#--
# Convert LST back to GST.
#--
check  =  lst.gst ( eLong )
print "Check GST is", check