Skip to content
A wrapper to CALCEPH: IMCCE planetary ephemeris access library
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Build Status AppVoyer Coverage Status

This is a julia wrapper for CALCEPH a C library for reading planetary ephemeris files, such as INPOPxx, JPL DExxx and SPICE ephemeris files.

CALCEPH C library is developped by IMCCE.

Quick start

In the Julia interpreter, run:


# ephemeris kernels can be downloaded from many different sources
# WARNING this file is huge (Jupiter Moons ephemeris)
# download("","jupiter_system.bsp")

# create an ephemeris context
eph = Ephem("planets.dat")
# from multiple files
# eph = Ephem(["planets.dat","jupiter_system.bsp"])

# prefetch ephemeris files data to main memory for faster access

# retrieve constants from ephemeris as a dictionary
con = constants(eph)
# list the constants
# get the sun J2
J2sun = con[:J2SUN]

# retrieve the position, velocity and acceleration of Earth (geocenter) relative
# to the Earth-Moon system barycenter in kilometers, kilometers per second and
# kilometers per second square at JD= 2451624.5 TDB timescale
# for best accuracy the first time argument should be the integer part and the
# delta the fractional part
# when using NAIF identification numbers, useNaifId has to be added to
# the units argument.

# what is the NAIF identification number for Deimos
id_deimos =[:deimos]

# what does NAIF ID 0 correspond to?
names_0 = naifId.names[0]

Why use CALCEPH?

CALCEPH functionality is also provided by NAIF SPICE Toolkit. However CALCEPH has several advantages over the SPICE toolkit:

  • It is faster at computing ephemeris data.
  • It can handle multiple ephemeris contexts whereas the SPICE toolkit cannot.
  • It is thread safe (if using one context per thread) whereas the SPICE toolkit is not.
  • It can compute higher order derivatives (acceleration and jerk) approximation using differentiation of the interpolation polynomials.
  • Its ephemeris computation interface expects the time separated in two double precision floating point numbers (the SPICE toolkit interface only use one double precision floating point number to specify an epoch). This can be used to achieve higher precision in timetag (this can have a significant impact when modeling Doppler observations from a deep space probe).
  • It is distributed as a single cross platform source making it easy to integrate in other projects whereas the SPICE toolkit is distributed one source per platform.

But CALCEPH does not support all functions of the SPICE toolkit. If you need more functionalities SPICE.jl is a Julia wrapper for the SPICE toolkit.

You can’t perform that action at this time.