+4
Completed

Easy access to ephemerides for Solar System objects

Thomas Robitaille 9 years ago updated by The Astropy Project 8 years ago 7

The astropy.coordinates package includes a framework for celestial coordinate conversion between a number of frames, including for example Equatorial and Galactic frames, Altitude/Azimuth for a given observer, and many more. In addition, a function named get_sun() is included to retrieve the location of the Sun as coordinates which can be transformed to any system.


This feature request is for similar functions to get_sun() but for any Solar System object, including planets, satellites, asteroids, and so on. This could make use of the JPL Solar System Dynamics data. There is already a Python package called jplephem that can be used to interface with this data, but it would be nice to have this seamlessly accessible via the astropy.coordinates framework.


Related Astropy issues: #3219 #4269

An implementation of `get_moon()` and `get_moon_phase()` that does not require interaction with the JPL backend would go a long way. The precision would not need to be especially high.

Good point! The implementation that made it into 1.2 supports either using the JPL backend *or* some polynomial approximations that aren't quite as precise.

Just noting here that SPICE is the (C) library that underpins JPL Horizons, and the custom software of many NASA/ESA missions. It could be wrapped if we want to avoid internet access being a requirement for ephemerides. We'd have to verify the licensing requirements, but I _suspect_ that it can effectively be considered public domain (it's somewhat unclear if derivative software needs export clearance etc).

I've taken a stab at this in #4746.

So can we close this now as implemented, or should keep this open until we can have minor planet ephemerids, too?