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.
#!/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