Rust JPL Ephemeris Reader (rust-jpl)
rust-jpl is a Rust library that enables integration of NASA Jet Propulsion Laboratory (JPL) ephemeris data into Rust applications.
It provides high-precision planetary and lunar positions based on a given Julian date, using official NASA JPL DE ephemerides (DE441).
The library is designed for scientific correctness, API clarity, and performance, making it suitable for research, engineering, simulation, and educational use.
π§ Use Cases
- Astronomy and astrophysics research
- Orbital mechanics and trajectory planning
- Space mission planning
- Celestial navigation
- Satellite and ground-station tracking
- Educational tools and simulations
- Scientific visualization software
π Requirements
| Requirement | Version |
|---|---|
| Rust (MSRV) | 1.70.0 or newer |
| Cargo | Comes with Rust |
| Supported OS | Linux, macOS, Windows |
| Architecture | x86_64, aarch64 |
The MSRV is documented and respected. Breaking MSRV changes will require a minor or major release.
π¦ Installation
From crates.io
[]
= "0.0.1-alpha"
π Quick Start
Basic Usage
use ;
β± Time Conversion
use ;
let cal = new;
let jd = cal.to_julian?;
println!;
let cal2 = jd.to_calendar;
println!;
πͺ Planetary Positions
use ;
let mut eph = new?;
let jd = from_calendar?;
let sun = eph.get_position?;
let earth = eph.get_position?;
let mars = eph.get_position?;
println!;
println!;
π Ephemeris Metadata
use Ephemeris;
let mut eph = new?;
let metadata = eph.get_metadata;
println!;
println!;
println!;
println!;
for body in eph.get_bodies
βοΈ Configuration
Copy the example configuration file:
Example config.toml
[]
= "assets/linux_m13000p17000.441.bsp"
= "assets/header.441"
= "assets/Initial_data.dat"
π₯ Ephemeris File Setup
1. Download NASA JPL DE441
- Source: NASA JPL Solar System Dynamics
- Required files:
linux_m13000p17000.441header.441
Rename:
linux_m13000p17000.441 β linux_m13000p17000.441.bsp
Place files in the assets/ directory.
2. Create Initial_data.dat
BODIES:
Mercury true
Venus true
EarthMoon_barycenter true
Mars true
Jupiter true
Saturn true
Uranus true
Neptune true
Pluto true
Moon_geocentric true
Sun true
DATE:
Start_year 1940
End_year 2100
π§ͺ Examples