siderust — Astrometry & Astrodynamics for Python
Python bindings for the siderust Rust library, providing observation planning, coordinate queries, ephemeris access, and moon-phase computation — all backed by Rust for performance and precision.
Installation
From source (requires Rust toolchain and maturin):
Quick Start
# 1. Pick an observatory
=
# 2. Find sunrise and sunset over one day (MJD 60 000)
=
=
# 3. Check star visibility at midnight
=
=
Features
| Area | API |
|---|---|
| Observers | Observer(lon, lat, h), .roque_de_los_muchachos(), .el_paranal(), .mauna_kea(), .la_silla() |
| Bodies | Body.Sun, .Moon, .Mercury … .Neptune |
| Stars | Star.catalog("Vega"), Star.from_ra_dec(name, ra, dec) |
| Directions | Direction(ra_deg, dec_deg) — fixed ICRS position |
| Altitude | altitude_at(), above_threshold(), below_threshold() |
| Events | crossings(), culminations() |
| Azimuth | azimuth_at() |
| Moon phase | moon_phase(jd), find_moon_phases(start, end) |
All heavy computation happens in compiled Rust. Python is used only for orchestration and display.
Downstream Rust/PyO3 extensions should use the documented
siderust_py::interop API to exchange canonical
Python Observer and Direction objects safely across extension boundaries.
API Reference
Observer
# Custom location
=
# Predefined sites
=
=
=
=
# longitude
# latitude
# height above ellipsoid
Body
# degrees
# degrees
Star
= # built-in catalog
= # custom RA/Dec
# "Vega"
# right ascension
# declination
# distance in light-years
Free Functions
# degrees
# degrees
# [(s,e), ...]
# [(s,e), ...]
# [CrossingEvent]
# [CulminationEvent]
# MoonPhaseGeometry
# [PhaseEvent]
target can be a Body, Star, or Direction.
License
AGPL-3.0 — see LICENSE.