Modern Fortran · thread-safe · SPICE-compatible

PEPPER

Planetary Ephemerides, Positions, Pointing, Events & Rotations

A modern, thread-safe reimagining of NAIF's SPICELIB: the same routines, names and results, from Fortran, C and Python, on as many threads as you have.

SPICE, modernized, not rewritten

PEPPER starts from SPICELIB N0067, the Fortran 77 library NASA's NAIF has developed for decades, and keeps its routines, arguments and behavior. What changes is underneath: all state lives in an instance, each thread queries it through its own context, and the limits of fixed-size tables are gone.

Fortran

SPICELIB's routines as methods: spice%furnsh loads, ctx%spkezr queries.

C & C++

About 830 routines in pepper.h, generated from the Fortran interfaces.

Python

PepperyPy, with SpiceyPy's API: import pepperypy as spice.

399 / 399 of NAIF's tspice test families pass.

Fast, and faster with more cores

5×faster than NAIF's SPICELIB build, for most queries
0.25 µsper state with kernels in memory
5.4×speedup on 8 threads (SPICELIB: one thread)
1800×faster to unload a kernel
up to 30×PepperyPy against SpiceyPy, with prepared queries
0.1–0.5 µsper state, with prepared queries

Measurements: pepper_vs_spicelib.md and python/README.md in the repository.

The Moon from Earth, three ways

use pepper_module

type(pepper_instance), target :: spice
type(pepper_context) :: ctx
real(wp) :: et, state(6), lt

call spice%furnsh('kernels.tm')
ctx = spice%new_context()                ! one per thread
call ctx%str2et('2026 NOV 8 12:00:00 UTC', et)
call ctx%spkezr('MOON', et, 'J2000', 'LT+S', 'EARTH', state, lt)

What's new on board

PEPPER is new and experimental: its interfaces may still change. It passes NAIF's test suite and agrees with SPICELIB and SpiceyPy in the comparisons described in the repository, but it has not yet been used for mission-critical applications. PEPPER is not developed or supported by NAIF, JPL, or NASA.