Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pije76/793cfa25e1c2144cf7addd3cc32f6f40 to your computer and use it in GitHub Desktop.
Save pije76/793cfa25e1c2144cf7addd3cc32f6f40 to your computer and use it in GitHub Desktop.
from skyfield.api import load
from jdutil import *
planets = load('de432s.bsp')
earth, jupiter = planets['EARTH'], planets['JUPITER BARYCENTER']
ts = load.timescale()
t = ts.now()
timenow = jd_to_datetime(float(t.tt))
astrometric = earth.at(t).observe(jupiter)
ra, dec, distance = astrometric.radec()
print('โปรแกรมคำนวณระยะห่างจากโลกกับดาวพฤหัส')
print(timenow.strftime('%Y-%m-%d %H:%M:%S'))
print(ra)
print(dec)
print("ระยะห่าง %s" % distance)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment