Skip to content

NAIF Functions

Functions for downloading planetary ephemeris kernels from NASA JPL's NAIF archive.

All functions are available via brahe.datasets.naif.<function_name>.

download_de_kernel

naif_download_de_kernel builtin

naif_download_de_kernel(name: str, output_path: str = None) -> str

Download a DE kernel from NAIF with caching support

Downloads the specified DE (Development Ephemeris) kernel file from NASA JPL's NAIF archive and caches it locally. If the kernel is already cached, returns the cached path without re-downloading. Optionally copies the kernel to a user-specified location.

Parameters:

Name Type Description Default
name str

Kernel name. Supported kernels: "de430", "de432s", "de435", "de438", "de440", "de440s", "de442", "de442s".

required
output_path str

Optional path to copy the kernel to after download/cache retrieval. If not specified, returns the cache location.

None

Returns:

Name Type Description
str str

Path to the kernel file (cache location or output_path if specified).

Raises:

Type Description
RuntimeError

If kernel name is unsupported, download fails, or file operations fail.

Example
1
2
3
4
5
6
7
8
9
import brahe as bh

# Download and cache de440s kernel
kernel_path = bh.datasets.naif.download_de_kernel("de440s")
print(f"Kernel cached at: {kernel_path}")

# Download and copy to specific location
kernel_path = bh.datasets.naif.download_de_kernel("de440s", "/path/to/my_kernel.bsp")
print(f"Kernel saved to: {kernel_path}")
Note
  • DE kernels are long-term stable products and are not refreshed once cached
  • Files are cached to ~/.cache/brahe/naif/ (or $BRAHE_CACHE/naif/ if set)
  • Kernel files are large (de440s: ~17MB, de440: ~114MB)
  • Available at: https://naif.jpl.nasa.gov/pub/naif/generic_kernels/spk/planets/

See Also