Skip to main content

Browse, get, and manage SPICE kernels and metakernels across NASA and ESA mission archives

Project description

spice-kernel-db

CI

Browse, get, and manage SPICE kernels and metakernels across NASA and ESA mission archives.

⚠️ CRITICAL: Update to v0.10.0 or later. Versions before 0.10.0 contained a fuzzy filename matching bug that could silently create symlinks between completely different SPICE kernel files, causing silent scientific data corruption — SPICE loads valid but wrong data with no errors. After updating, remove all symlinks in your kernel directories and re-run spice-kernel-db update. See CHANGELOG.md for details and recovery steps.

What this tool does

  1. Mission setup: Configure missions from NASA NAIF or ESA SPICE servers with an interactive dialog.

  2. Browse & get: Browse available metakernels for a mission, then get one — the tool downloads all missing kernels automatically and makes the metakernel ready to use locally.

  3. Metakernel rewriting: Rewrites .tm files for local use with minimal edits — only PATH_VALUES is changed, everything else stays identical to the original. A symlink tree bridges the gap between where the metakernel expects files and where they actually live on disk.

  4. Deduplication (optional): Identifies identical kernel files across missions using SHA-256 hashing and replaces duplicates with symlinks. Per-mission opt-in — you can deduplicate some missions while keeping others untouched.

Documentation

Full documentation is at michaelaye.github.io/spice-kernel-db and built with Quarto.

Installation

pip install spice-kernel-db

Or with conda:

conda install -c michaelaye spice-kernel-db

Or from source:

git clone https://github.com/michaelaye/spice-kernel-db
cd spice-kernel-db
pip install -e ".[dev]"

Quick start

Set up a mission

spice-kernel-db mission add

Interactive dialog: choose a server (NASA NAIF / ESA SPICE) → pick a mission from the list → configure deduplication preference.

Browse available metakernels

spice-kernel-db browse JUICE

Shows all .tm files in the mission's remote mk/ directory, grouped by base name with version counts.

Get a metakernel

spice-kernel-db get juice_ops.tm

Downloads the metakernel, checks which kernels you already have, downloads the missing ones in parallel, and creates symlinks so the .tm file works immediately.

Use with spiceypy

import spiceypy as spice
from spice_kernel_db import KernelDB

db = KernelDB()
mks = db.list_metakernels(mission="JUICE")
spice.furnsh(mks[0]["mk_path"])

Python API

from spice_kernel_db import KernelDB

db = KernelDB()

# Browse remote metakernels
db.browse_remote_metakernels(
    "https://naif.jpl.nasa.gov/pub/naif/JUICE/kernels/mk/",
    mission="JUICE",
)

# Get a metakernel (downloads missing kernels automatically)
db.get_metakernel(
    "https://naif.jpl.nasa.gov/pub/naif/JUICE/kernels/mk/juice_ops.tm",
    mission="JUICE",
)

# Optionally deduplicate across missions
db.deduplicate_with_symlinks(dry_run=True)   # preview
db.deduplicate_with_symlinks(dry_run=False)  # execute

Supported servers

Server URL
NASA NAIF https://naif.jpl.nasa.gov/pub/naif/
ESA SPICE https://spiftp.esac.esa.int/data/SPICE/

Both use the same <server>/<MISSION>/kernels/mk/ directory structure.

Dependencies

License

MIT

Project details


Download files

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

Source Distribution

spice_kernel_db-0.10.0.tar.gz (90.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spice_kernel_db-0.10.0-py3-none-any.whl (42.1 kB view details)

Uploaded Python 3

File details

Details for the file spice_kernel_db-0.10.0.tar.gz.

File metadata

  • Download URL: spice_kernel_db-0.10.0.tar.gz
  • Upload date:
  • Size: 90.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for spice_kernel_db-0.10.0.tar.gz
Algorithm Hash digest
SHA256 4a627fa7f2b96faab0809eef7286ee6a215f2adb83eea987c8facb9fff7dbf81
MD5 fd0ba99dc937e761a135b26dc037fcd3
BLAKE2b-256 b3fc64e551807b130412dc602f574b745fc4944e1427bd19a0867695ba35f9eb

See more details on using hashes here.

File details

Details for the file spice_kernel_db-0.10.0-py3-none-any.whl.

File metadata

File hashes

Hashes for spice_kernel_db-0.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c7039831304712e9018074dc2a67e67992a7a3d0aed7924bc4336a239d4a0c92
MD5 203226736c1de659a0c8468d3d40f4b2
BLAKE2b-256 fae86381aeeaddfdccf69480dc860c18ddcb1f4da652590f52318a66afb3c38c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page