Project Overview
rust-ephem is a Rust library with Python bindings for high-performance
satellite and planetary ephemeris calculations. It propagates Two-Line Element
(TLE) data and SPICE kernels, outputs standard coordinate frames (ITRS, GCRS),
and integrates with astropy for Python workflows.
Why rust-ephem?
Performance: Built in Rust for speed, rust-ephem generates ephemerides for
thousands of time steps efficiently. Ideal for visibility calculators where speed
is critical (e.g., APIs serving many users) and large-scale ephemeris tasks where
it outperforms pure-Python libraries by an order of magnitude.
Accuracy: Achieves 10-20 meter accuracy for Low Earth Orbit (LEO) satellites with proper time corrections (UT1, polar motion, leap seconds).
Integration: Outputs astropy SkyCoord objects directly, including Sun
and Moon positions with observer location and velocity. This correctly handles
effects like Moon parallax for LEO spacecraft observatories.
Constraints: A flexible constraint system enables observation planning with
Sun/Moon proximity, Earth limb avoidance, and eclipse detection. Logical operators
(AND, OR, NOT, XOR) allow combining constraints with Python’s &, |, ~,
^ operators.
Core Capabilities
TLE propagation using the SGP4 algorithm
SPICE kernel access for spacecraft ephemeris from SPK files
Ground observatory ephemeris for fixed Earth locations
OEM file support for CCSDS Orbit Ephemeris Messages
Generic file ephemeris for pre-computed simulator output files in various text formats
Parquet ephemeris for columnar state-vector files (local or S3 / Spaces / GCS / R2 / HTTPS) via DuckDB
JPL Horizons integration for asteroids, comets, and spacecraft
Coordinate transformations between TEME, ITRS, and GCRS frames
Time system conversions (TAI, UT1, UTC) with leap seconds
Earth Orientation Parameters (EOP) for polar motion corrections
Constraint evaluation for observation planning
Key Technologies
Language: Rust (2021 edition)
Astronomy libraries:
Time handling: hifitime for high-precision time
Arrays: NumPy integration for efficient data handling
Typical Workflows
Satellite Ephemeris (TLE)
Create
TLEEphemerisfrom TLE data (file, URL, or Celestrak query)Access TEME, ITRS, or GCRS coordinates as
SkyCoordobjectsQuery Sun/Moon positions relative to the satellite
Spacecraft Ephemeris (SPICE)
Obtain SPK file for your spacecraft (from mission provider or NAIF)
Create
SPICEEphemeriswith the SPK path and spacecraft NAIF IDAccess positions in GCRS or ITRS frames
Call
ensure_planetary_ephemeris()if you need Sun/Moon positions
Ground Observatory
Create
GroundEphemeriswith latitude, longitude, heightAccess observatory positions in ITRS/GCRS
Query Sun/Moon positions from the observatory
Constraint Evaluation
Configure constraints (Sun proximity, Moon avoidance, eclipse, etc.)
Combine constraints with
&,|,~operatorsEvaluate against ephemeris to find visibility windows
Use batch evaluation for multiple targets efficiently
Next Steps
Coordinate Frames — Coordinate frame details
Time systems — Time scale handling
Accuracy and precision — Accuracy information
Python API — Complete API reference