def earth_rotation(epoch, jd): ERA = coords.earth_rotation_angle(jd, False) print 'ERA', ERA GAST = coords.greenwich_sidereal_time(jd, True) * pi / 12 print '2000B GAST', GAST GMST = coords.greenwich_sidereal_time(jd, False) * pi / 12 print 'GMST', GMST def cmpfunc(cstdout, ERA, GAST, GMST): from warnings import warn ls = [ l.split(':')[-1].strip() for l in cstdout.split('\n') if l.strip() != '' ] dERA = ERA - float(ls[0]) dGAST = GAST - float(ls[1]) dGMST = GMST - float(ls[2]) for s in ('dERA', 'dGAST', 'dGMST'): val = locals()[s] if abs(val) > 1e-8: warn('%s too large:%g !!!' % (s, val)) return cmpfunc, ERA, GAST, GMST
def greenwich_sidereal_time_in_radians(): """Calculate using GMT (according to client's time settings).""" #Function astropysics.obstools.epoch_to_jd wants a decimal year as input #Function astropysics.obstools.calendar_to_jd can take a datetime object gmt_jd = obstools.calendar_to_jd(site_time_gmt_as_datetime()) #Convert from hours to radians... 24hr = 2*pi return coords.greenwich_sidereal_time(gmt_jd) * pi / 12
def greenwich_sidereal_time_in_radians(): """Calculate using GMT (according to client's time settings).""" # Function astropysics.obstools.epoch_to_jd wants a decimal year as input # Function astropysics.obstools.calendar_to_jd can take a datetime object gmt_jd = obstools.calendar_to_jd(site_time_gmt_as_datetime()) # Convert from hours to radians... 24hr = 2*pi return coords.greenwich_sidereal_time(gmt_jd) * pi / 12
def earth_rotation(epoch,jd): ERA = coords.earth_rotation_angle(jd,False) print 'ERA',ERA GAST = coords.greenwich_sidereal_time(jd,True)*pi/12 print '2000B GAST',GAST GMST = coords.greenwich_sidereal_time(jd,False)*pi/12 print 'GMST', GMST def cmpfunc(cstdout,ERA,GAST,GMST): from warnings import warn ls = [l.split(':')[-1].strip() for l in cstdout.split('\n') if l.strip()!=''] dERA = ERA-float(ls[0]) dGAST = GAST-float(ls[1]) dGMST = GMST-float(ls[2]) for s in ('dERA','dGAST','dGMST'): val = locals()[s] if abs(val)>1e-8: warn('%s too large:%g !!!'%(s,val)) return cmpfunc,ERA,GAST,GMST