CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
Avatar for Testing 18.04.

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

| Download
Project: Testing 18.04
Views: 778
Kernel: Python 3 (Ubuntu Linux)

Skyfield

Kernel: Python 3 (Ubuntu Linux)

https://rhodesmill.org/skyfield/

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
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"