A Python Module to Query JPL HORIZONS

Working on Solar System small bodies, I make frequent use of the JPL HORIZONS system, which provides ephemerides and orbital elements at given times for any Solar System body. HORIZONS provides access through email, telnet, and a website that can be queried manually.

In order to conveniently query and investigate large amounts of data from HORIZONS, I wrote a Python module that provides access to ephemerides and orbital elements by parsing the html source code of the HORIZONS website. This method provides robust and fast access.

The module can be downloaded from github and is available through PyPi, which means you can install it using:

pip install callhorizons

Obtaining the coordinates for NEO 433 Eros as seen from Mauna Kea (observatory code 568) on a given Julian date is as easy as:

import callhorizons
eros = callhorizons.query('Eros')
eros.set_discreteepochs([2457446.177083, 2457446.182343])
print eros['RA'], eros['DEC'] 

Ephemerides and orbital elements for up to 15 discrete times, or over an arbitrary time range, can be queried for one object at a time. Data are stored in a numpy array, allowing for convenient access. Have a look at the documentation to learn more!

The module is publicly available without any warranty; feel free to use and modify it. If you have suggestions or comments, please let me know!