Skip to main content

Retrieve, represent and manipulate JPL Horizons ephemerides.

Project description


The eph package provides some useful functions, classes and tools to retrieve, parse and manipulate ephemerides in an astropy-compatible way.

See eph-howto (jupyter notebook) for more info.

Basic Usage

import eph

req = eph.JplReq() # create the request'eph.ini', section='jplparams') # read parameters from 'jplparams' section in 'eph.ini'
    'COMMAND': 'venus',
    'START_TIME': '2007-11-17',
    'STOP_TIME': '2017-4-22'
    'STEP_SIZE': '10d'
    }) # set parameters from dictionary
req['OBJ_DATA'] = False # set parameter dict-like
req.csv = True # set parameter as attributes
) # set position vectors output

res = req.query() # perform the request obtaining a response from Jpl Horizons service
e = res.parse() # parse the ephemeris in an astropy QTable

from import ascii

ascii.write(e, format='csv') # write output data

The content of eph.ini can be something like this (see for a complete description of JPL parameters)



eph package defines also some useful shortcut functions to easily access Jpl Horizons data. Instead of building a JplReq and get back a JplRes to parse, you can get an astropy QTable with

from eph import *

e = get('2000-1-1', '2018-1-1', 299, step=100).

This returns by default an observer table. If you want vectors, type

e = vec('2000-1-1', '2018-1-1', 299, step=100).

Command line tool

eph package also provides a command line tool:

$ eph 2007-11-17 2017-4-22 venus

This command gives you an ephemeris table of Venus starting from 2007-11-17 to 2017-4-22. You can also change the reference frame, the time-step size, the output etc.. through the options provided. Check available options typing

$ eph --help

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
eph-1.0.0.tar.gz (342.1 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page