Sharedskyfield.ipynbOpen in CoCalc
Author: Harald Schilly
Views : 69

Skyfield

Kernel: Python 3 (Ubuntu Linux)

https://rhodesmill.org/skyfield/

In [3]:
from skyfield.api import load planets = load('de421.bsp') earth, mars = planets['earth'], planets['mars'] ts = load.timescale() t = ts.now() astrometric = earth.at(t).observe(mars) ra, dec, distance = astrometric.radec() print(ra) print(dec) print(distance)
03h 38m 52.01s +20deg 23' 56.8" 1.98412 au
In [4]:
from skyfield.api import Topos boston = earth + Topos('42.3583 N', '71.0636 W') astrometric = boston.at(t).observe(mars) alt, az, d = astrometric.apparent().altaz() print(alt) print(az)
-16deg 29' 57.9" 40deg 14' 16.0"
In [ ]: