Skip to content

Lox Python API Reference

Welcome to the Python API reference for lox - an ergonomic astrodynamics library.

import lox_space as lox

Overview

Lox provides tools for space mission analysis and orbital mechanics:

  • High-precision time handling with multiple astronomical time scales
  • Orbital states in Cartesian and Keplerian representations
  • Propagators for orbit prediction (analytical and SGP4)
  • Ground station analysis and visibility calculations
  • Coordinate transformations between reference frames

Quick Start

import lox_space as lox

# Create a time instant
t = lox.Time("TAI", 2024, 1, 1, 12, 0, 0.0)

# Define an orbital state (LEO)
state = lox.State(
    time=t,
    position=(6678.0, 0.0, 0.0),  # km
    velocity=(0.0, 7.73, 0.0),    # km/s
)

# Convert to Keplerian elements
kep = state.to_keplerian()
print(f"Semi-major axis: {kep.semi_major_axis():.1f} km")
print(f"Orbital period: {kep.orbital_period()}")

# Propagate the orbit
propagator = lox.Vallado(state)
future_state = propagator.propagate(t + lox.TimeDelta.from_hours(1.5))

API Sections

Section Description
Time & Dates Time, UTC, TimeDelta, TimeScale
Celestial Bodies Origin
Reference Frames Frame, SPK
Orbital States State, Keplerian, Trajectory, Ensemble
Propagators Vallado, SGP4, GroundPropagator
Ground Stations GroundLocation, ElevationMask, Observables, Pass
Events & Visibility Event, Window, find_events, find_windows, visibility, visibility_all
Data Providers EOPProvider, Series
Units Angle, Distance, Frequency, Velocity