Fortran
SPICELIB's routines as methods: spice%furnsh loads, ctx%spkezr queries.
Modern Fortran · thread-safe · SPICE-compatible
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.
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.
SPICELIB's routines as methods: spice%furnsh loads, ctx%spkezr queries.
About 830 routines in pepper.h, generated from the Fortran interfaces.
PepperyPy, with SpiceyPy's API: import pepperypy as spice.
399 / 399 of NAIF's tspice test families pass.
Measurements: pepper_vs_spicelib.md and python/README.md in the repository.
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)
#include "pepper.h"
pepper_runtime_init();
void *spice = pepper_spice_new();
void *ctx = pepper_context_new(spice); /* one per thread */
pepper_spice_furnsh(spice, "kernels.tm", -1);
double et, state[6], lt;
pepper_str2et(ctx, "2026 NOV 8 12:00", &et);
pepper_spkezr(ctx, "MOON", et, "J2000", "LT+S", "EARTH", state, <);
import pepperypy as spice
spice.furnsh('kernels.tm')
et = spice.str2et('2026 NOV 8')
state, lt = spice.spkezr('MOON', et, 'J2000', 'LT+S', 'EARTH')
No global state: load kernels once, query from every core, a context per thread.
in_memory=.true. reads binary kernels whole: queries at scattered epochs never touch the disk.
Resolve names and frames once, then evaluate states at any number of epochs, to the last bit of SPKEZR.
Bodies and frames defined by your own procedures, used by every query like kernel data.
Text kernels written in JSON (*.json), loaded straight into the kernel pool.
Names, paths and results of any size; the old tables of 26003 variables and 5000 files are gone.
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.