| Crates.io | siderust |
| lib.rs | siderust |
| version | 0.4.0 |
| created_at | 2025-05-17 19:13:58.509899+00 |
| updated_at | 2026-01-19 23:08:50.108393+00 |
| description | High-precision astronomy and satellite mechanics in Rust. |
| homepage | https://github.com/Siderust/siderust |
| repository | https://github.com/Siderust/siderust |
| max_upload_size | |
| id | 1678091 |
| size | 31,293,619 |
# Run standard CI checks (check, fmt, clippy, tests)
./ci-local.sh
# Run coverage checks only
./ci-local.sh coverage
# Run both standard checks and coverage
./ci-local.sh all
Note: Coverage requires the nightly toolchain. Install it with:
rustup toolchain install nightly
rustup component add llvm-tools-preview --toolchain nightly
cargo install cargo-llvm-cov
Precision astronomy & satellite mechanics in safe, fast Rust.
Siderust aims to be the reference ephemeris and orbit‑analysis library for embedded flight‑software as well as research‐grade pipelines. Every algorithm ships with validation tests against authoritative data (JPL Horizons, IMCCE, SOFA). No unsafe blocks, no hidden allocations.
| Category | What you get |
|---|---|
| Coordinate Systems | Vector and spherical Position types parameterised by ReferenceCenter (Helio, Geo, Bary, …) and ReferenceFrame (ICRS, Ecliptic, Equatorial, Topocentric, etc.). Directions are frame-only. Compile‑time guarantees ensure you never mix frames by accident. |
| Target Tracking | Target<T> couples any coordinate with an observation epoch and optional ProperMotion, enabling extrapolation & filtering pipelines. |
| Physical Units | Strongly typed Mass, Length, Angle, Velocity, Time & more; operator overloading makes math look natural while the compiler guards dimensional correctness. |
| Celestial Mechanics | Kepler solvers, VSOP87 & ELP2000 planetary/lunar theories, light‑time & aberration, nutation & precession matrices, apparent Sun & Moon, culmination searches. |
| Catalogs & Bodies | Built‑in Sun→Neptune, major moons, a starter star catalog, + helper builders to load Gaia, Hipparcos or custom datasets. |
ω×r term (GMST-based Earth rotation).Add to your Cargo.toml:
[dependencies]
siderust = "0.1"
Siderust encodes both the origin and the orientation of every coordinate at the type level:
use siderust::coordinates::{cartesian::Position, centers::*, frames::*};
// Position of Mars in the Heliocentric Ecliptic frame
let mars_helio = Position::<Heliocentric, Ecliptic>::new(x, y, z);
// Convert to Geocentric Ecliptic Cartesian coordinates
let mars_geo: Position::<Geocentric, Ecliptic> = mars_helio.transform(jd);
Impossible states (e.g. adding heliocentric and geocentric positions) simply do not compile.
use siderust::units::{AU, KM, DEG, DAY};
use siderust::units::*;
let distance = 1.523 * AU; // Mars semi‑major axis
let period = 686.97 * DAY;
The compiler will refuse distance + period – dimensional analysis at compile time.
use siderust::{
bodies::Mars,
astro::JulianDate,
};
use chrono::prelude::*;
// 1. Select an epoch (UTC now to JD)
let jd = JulianDate::from_utc(Utc::now());
// 2. Compute barycentric ecliptic coordinates via VSOP87
let mars = Mars::vsop87e(jd);
// 3. Print mars
println!("{}", mars.position);
All numeric kernels are cross‑checked against JPL Horizons (see siderust-py #TODO):
|Δα|, |Δδ| < #TBD mas for planets (1800–2200 CE). Full tables in #TBD.
| Routine | Mean time (ns) | Note | HW |
|---|---|---|---|
| VSOP87 planet | 120 | SIMD auto‑vectorised by LLVM | Ryzen 7 5800X |
| ELP2000 Moon | 310 | ||
| Coordinate transform | <50 | center+frame change |
-- This is just a placeholder to put the real data --
├─ astro/ # Astronomical properties (nutation, precession, …)
├─ bodies/ # Data structures for celestial bodies (planet, star, satellite, …)
├─ calculus/ # Numerical kernels (kepler, vsop87, …)
├─ coordinates/ # Coordinate types & transforms
├─ observatories/ # Ground stations & observer helpers
├─ targets/ # Target<T> & ProperMotion
└─ units/ # Dimensional quantities
wgpu (experiment)Contributions of algorithms, bug fixes or docs are welcome! Please:
git clone)cargo test && cargo clippy -- -D warnings)By participating you agree to follow the Rust Code of Conduct.
Copyright (C) 2026 Vallés Puig, Ramon
This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). The AGPL-3.0 ensures that:
Note for commercial or proprietary use: If you wish to incorporate this code into a closed-source or otherwise differently licensed project, a dual-licensing arrangement can be negotiated. Please contact the authors to discuss terms and conditions for a commercial or proprietary license that suits your needs.
Big thanks to Màrius Montón (@mariusmm) for inviting me to his three-week Rust intro course at the Universitat Autònoma de Barcelona (UAB) in 2024 that nudge set this project in motion.