Skip to main content

Crate lox_space

Crate lox_space 

Source
Expand description

Lox is an MPLv2-licensed Rust astrodynamics library with first-class Python bindings for orbital mechanics, mission analysis, and telecommunications.

lox-space is the main entry point for both the Rust and Python APIs, re-exporting all functionality from the Lox ecosystem through a unified interface and providing a prelude of the most commonly used types. Each module mirrors the corresponding standalone crate; enable the matching cargo feature to pull it in.

§Python Quick Start

import lox_space as lox

# Parse a UTC epoch and convert to the TDB time scale
epoch = lox.UTC.from_iso("2025-01-01T12:00:00").to_scale("TDB")

# Load Earth orientation parameters
provider = lox.EOPProvider("finals2000A.all.csv")

# Design a sun-synchronous orbit at 800 km altitude with a 10:30 LTAN
sso = lox.Keplerian.sso(
    epoch, altitude=800 * lox.km, ltan=(10, 30), provider=provider
)

# Convert to Cartesian state and propagate with J2 perturbations
state = sso.to_cartesian()
j2 = lox.J2(state)
trajectory = j2.propagate(epoch, end=epoch + 100 * lox.minutes)

§Rust Quick Start

use lox_space::prelude::*;

let epoch = Utc::from_iso("2025-01-01T12:00:00").unwrap().to_time().to_scale(TimeScale::Tdb);
let provider = EopParser::new().from_path("finals2000A.all.csv").parse().unwrap();

let sso = SsoBuilder::default()
    .with_provider(&provider)
    .with_time(epoch)
    .with_altitude(800.0.km())
    .with_ltan(10, 30)
    .build()
    .unwrap();

// Convert to Cartesian state and propagate with J2 perturbations
let state = sso.to_cartesian();
let j2 = J2Propagator::try_new(state).unwrap();
let end = epoch + TimeDelta::from_minutes(100);
let trajectory = j2.propagate(Interval::new(epoch, end)).unwrap();

§Installation

§Python

uv add lox-space
# or
pip install lox-space

§Rust

cargo add lox-space

Or add to your Cargo.toml:

[dependencies]
lox-space = "0.1"

§Features

  • Orbital Mechanics — Keplerian elements, state vectors, SSO design, Vallado/J2/SGP4 propagation, TLE parsing
  • Time Systems — TAI, TT, TDB, TCB, TCG, UTC, UT1; femtosecond precision, leap-second aware
  • Reference Frames — ICRF, ITRF, TEME; CIO and equinox-based transformation chains
  • Ground Stations — Visibility windows, elevation masks, pass prediction
  • Constellation Design — Walker Delta/Star, Street-of-Coverage, Flower
  • RF Link Budgets — Antenna patterns, modulation schemes, path loss
  • Python Bindings — Full API with type stubs and NumPy interop

§Status

Lox is pre-1.0. The API may change between releases.

§Documentation

Modules§

analysis
Mission analysis: access, visibility, link budgets, and ground-station modelling (re-exports lox_analysis).
bodies
Celestial bodies and their physical and rotational properties (re-exports lox_bodies).
comms
Communications modelling: antennas, links, and signal chains (re-exports lox_comms).
constellations
Satellite constellation builders and geometry (re-exports lox_orbits::constellations).
core
Core numeric types, units, and constants (re-exports lox_core).
earth
Earth-specific models such as geodesy and orientation (re-exports lox_earth).
ephem
Planetary and lunar ephemerides (re-exports lox_ephem).
frames
Reference frames, rotations, and coordinate transformations (re-exports lox_frames).
io
Parsers for astrodynamics data file formats (re-exports lox_io).
itur
ITU-R atmospheric propagation models (re-exports lox_itur).
math
Math utilities used across the toolkit (re-exports lox_core::math).
odm
CCSDS Orbit Data Message types and (de-)serialization (re-exports lox_odm).
orbits
Orbits, propagators, events, and ground tracks (re-exports lox_orbits).
prelude
Convenience re-exports of the most commonly used types.
time
Time scales, epochs, and date arithmetic (re-exports lox_time).
units
Physical units and quantities (re-exports lox_core::units).

Macros§

time
Construct a time::Time — re-export of the lox_time::time! macro.
utc
Construct a UTC timestamp — re-export of the lox_time::utc! macro.