Files
astronomy/demo/python/utdate.py
Don Cross 982c92ff9f Added code to help me investigate planet distance vs time.
I am working on adding aphelion/perihelion functionality
for planets. I ran into complicated behavior with the orbit
of Neptune. Its orbit is so circular, and its movement so slow,
that wobbling of the Sun around the Solar System Barycenter (SSB)
causes there to be 3 consecutive zero-slope points near the true
perihelion. I still need to resolve this.
2020-01-03 11:19:15 -05:00

20 lines
436 B
Python
Executable File

#!/usr/bin/env python3
#
# utdate.py - Don Cross - 2020-01-03
#
# Convert J2000 UT day number to UTC date/time.
# Also displays Terrestrial Time (TT).
#
import sys
import astronomy
if __name__ == '__main__':
if len(sys.argv) != 2:
print('USAGE: utdate.py ut')
sys.exit(1)
ut = float(sys.argv[1])
time = astronomy.Time(ut)
print(time)
print('TT = {:0.16f}'.format(time.tt))
sys.exit(0)