Skip to main content

Astrora - Rust-backed astrodynamics library for Python

Project description

Astrora - Rust-Backed Astrodynamics Library

Python 3.8+ Rust 1.90+ License: MIT

A modern, high-performance orbital mechanics library combining Python's ease of use with Rust's computational performance.

Overview

Astrora is a ground-up modernization of astrodynamics computing, delivering 10-100x performance improvements over pure Python implementations while maintaining an intuitive Python API.

Background

The original poliastro library was archived on October 14, 2023. While active forks like hapsira continue development, Astrora represents a new approach that:

  • Leverages the mature Rust astrodynamics ecosystem (2024-2025)
  • Implements cutting-edge Python-Rust integration patterns
  • Provides 10-100x performance improvements over pure Python
  • Maintains API compatibility with poliastro where practical

Features

Core Capabilities

  • High-performance orbit propagators

    • Keplerian propagation (analytical)
    • Cowell's method with perturbations
    • Numerical integrators (RK4, DOPRI5, DOP853)
    • 10-50x faster than pure Python
  • Perturbation models

    • Earth oblateness (J2, J3, J4)
    • Atmospheric drag (exponential model)
    • Third-body effects (Sun, Moon)
    • Solar radiation pressure
  • Coordinate transformations

    • GCRS ↔ ITRS ↔ TEME
    • Batch transformations with 20-80x speedup
    • Full time-dependent rotations
  • Lambert solvers

    • Universal variable formulation
    • Izzo's algorithm
    • Batch processing with 50-100x speedup
  • Orbital mechanics

    • Classical orbital elements ↔ Cartesian state vectors
    • Anomaly conversions (true, eccentric, mean)
    • Orbit classification and analysis
  • Maneuvers

    • Hohmann transfers
    • Bi-elliptic transfers
    • Impulsive burns (Δv calculations)
  • Visualization

    • 2D/3D static plots
    • Interactive 3D visualizations (Plotly)
    • Ground track plotting
    • Porkchop plots for transfer analysis
    • Orbit animations (GIF, MP4, HTML)
  • Satellite operations

    • TLE/OMM parsing and propagation
    • Lifetime estimation
    • Ground station visibility
    • Eclipse predictions

Installation

Quick Start (Recommended)

Install using uv for the fastest experience:

# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh

# Install Astrora
uv pip install astrora

Traditional Installation

pip install astrora

From Source

For development or latest features:

git clone https://github.com/cachemcclure/astrora.git
cd astrora
uv venv --python 3.12
source .venv/bin/activate
uv pip install -e ".[dev]"
maturin develop --release

Complete Installation Guide - Detailed instructions for all platforms and use cases

Quick Start

import numpy as np
from astrora import Orbit, bodies
from astrora._core import hohmann_transfer

# Create an orbit from state vectors
orbit = Orbit.from_vectors(
    bodies.Earth,
    r=np.array([7000e3, 0.0, 0.0]),  # Position (m)
    v=np.array([0.0, 7546.0, 0.0])   # Velocity (m/s)
)

print(f"Semi-major axis: {orbit.a/1e3:.1f} km")
print(f"Period: {orbit.period/3600:.2f} hours")
print(f"Eccentricity: {orbit.ecc:.6f}")

# Propagate the orbit forward in time
orbit_after_1hr = orbit.propagate(3600.0)  # 1 hour later
print(f"True anomaly after 1 hour: {orbit_after_1hr.nu:.2f} rad")

# Calculate a Hohmann transfer from LEO to GEO
result = hohmann_transfer(7000e3, 42164e3, bodies.Earth.mu)
print(f"Total Δv: {result['delta_v_total']/1000:.2f} km/s")
print(f"Transfer time: {result['transfer_time']/3600:.2f} hours")

# Visualize (requires matplotlib)
from astrora.plotting import plot_orbit
plot_orbit(orbit)

Performance

Real-world benchmarks on Apple M2 Pro:

  • Numerical propagation: 10-50x faster than pure Python
  • Lambert problem (batch): 50-100x faster with Rayon parallelization
  • Coordinate transformations (batch): 20-80x faster with SIMD
  • Overall workflows: 5-10x typical improvement

Technical Stack

  • Python 3.8+: High-level API and user interface
  • Rust 1.90+: Performance-critical computations
  • PyO3 0.22: Seamless Rust-Python bindings with stable ABI
  • maturin: Build system for Rust-backed Python packages
  • uv: Ultra-fast package management (10-100x faster than pip)

Scientific Libraries:

  • nalgebra: Linear algebra operations
  • hifitime: Nanosecond-precision time handling
  • rayon: Data parallelism for batch operations
  • astropy: Astronomical calculations and units
  • numpy: Array operations

Documentation

Examples

Check the examples/ directory for comprehensive usage examples:

  • Basic orbit creation and propagation
  • Coordinate transformations
  • Lambert problem solving
  • Porkchop plots for mission planning
  • Ground track visualization
  • Orbit animations
  • Satellite operations

Contributing

Contributions are welcome! This project is in active development.

Development Setup

# Clone the repository
git clone https://github.com/cachemcclure/astrora.git
cd astrora

# Set up development environment
uv venv --python 3.12
source .venv/bin/activate
uv pip install -e ".[dev,docs,test]"

# Build Rust extension
maturin develop --release

# Run tests
pytest tests/ -v

# Check coverage
pytest --cov=astrora --cov-report=html

Code Quality

We maintain high code quality standards:

  • Rust: All public APIs documented, >90% test coverage target
  • Python: NumPy-style docstrings, >85% test coverage target
  • Testing: 636+ tests (Rust + Python), comprehensive integration tests
  • Benchmarking: Continuous performance tracking via GitHub Actions
  • Linting: rustfmt, clippy, black, ruff
  • Type checking: mypy for Python

Areas for Contribution

  • Additional perturbation models (Harris-Priester atmosphere, NRLMSISE-00)
  • More Lambert solver algorithms
  • GPU acceleration for batch operations
  • Advanced maneuver optimization
  • Documentation and tutorials
  • Performance improvements

Roadmap

  • PyPI release with pre-built wheels (Linux, macOS, Windows)
  • Complete user guide and tutorials
  • Jupyter notebook examples
  • Advanced gravity models (EGM2008)
  • Constellation design tools
  • Low-thrust trajectory optimization
  • Integration with mission analysis tools

Project Status

Current Version: 0.1.0 (Alpha)

Test Status:

  • 636+ tests passing (473 Rust, 163+ Python)
  • 73.96% overall Rust coverage (~87% excluding PyO3 bindings)
  • Comprehensive benchmark suite
  • Continuous integration via GitHub Actions

Phase Completion:

  • Phase 1-8: Core functionality (propagators, coordinates, plotting)
  • Phase 9-10: Advanced features (SIMD optimization, satellite operations)
  • Phase 11: Documentation (in progress)
  • Phase 12: Testing and quality assurance (14/17 complete)

Performance Benchmarks

Measured on Apple M2 Pro (10-core, 16GB RAM):

Operation Astrora (Rust) Pure Python Speedup
RK4 propagation (1000 steps) 5.0 μs 12.6 μs 2.5x
Lambert solver (single) 8.2 μs 45 μs 5.5x
Lambert batch (1000) 2.1 ms 45 ms 21x
Coordinate transform (single) 1.8 μs 8.5 μs 4.7x
Coordinate batch (1000) 1.2 ms 8.5 ms 7.1x
Cross product 2.75 μs 75.5 μs 27.5x

Note: Actual speedups depend on CPU, problem size, and operation type. Batch operations see higher speedups due to Rayon parallelization.

License

MIT License - See LICENSE for details

Citation

If you use Astrora in your research, please cite:

@software{astrora2025,
  author = {McClure, Cache},
  title = {Astrora: A Rust-Backed Astrodynamics Library for Python},
  year = {2025},
  url = {https://github.com/cachemcclure/astrora},
  version = {0.1.0}
}

Acknowledgments

Support


Made by the Astrora team. Powered by Rust and Python.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

astrora-0.1.1.tar.gz (859.9 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

astrora-0.1.1-cp38-abi3-win_amd64.whl (773.1 kB view details)

Uploaded CPython 3.8+Windows x86-64

astrora-0.1.1-cp38-abi3-win32.whl (729.5 kB view details)

Uploaded CPython 3.8+Windows x86

astrora-0.1.1-cp38-abi3-musllinux_1_2_x86_64.whl (4.2 MB view details)

Uploaded CPython 3.8+musllinux: musl 1.2+ x86-64

astrora-0.1.1-cp38-abi3-musllinux_1_2_i686.whl (4.2 MB view details)

Uploaded CPython 3.8+musllinux: musl 1.2+ i686

astrora-0.1.1-cp38-abi3-musllinux_1_2_armv7l.whl (4.3 MB view details)

Uploaded CPython 3.8+musllinux: musl 1.2+ ARMv7l

astrora-0.1.1-cp38-abi3-musllinux_1_2_aarch64.whl (4.1 MB view details)

Uploaded CPython 3.8+musllinux: musl 1.2+ ARM64

astrora-0.1.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.5 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ x86-64

astrora-0.1.1-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (4.0 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARMv7l

astrora-0.1.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.9 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARM64

astrora-0.1.1-cp38-abi3-manylinux_2_12_i686.manylinux2010_i686.whl (4.1 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.12+ i686

astrora-0.1.1-cp38-abi3-macosx_11_0_arm64.whl (802.5 kB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

astrora-0.1.1-cp38-abi3-macosx_10_12_x86_64.whl (861.8 kB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

File details

Details for the file astrora-0.1.1.tar.gz.

File metadata

  • Download URL: astrora-0.1.1.tar.gz
  • Upload date:
  • Size: 859.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.9.6

File hashes

Hashes for astrora-0.1.1.tar.gz
Algorithm Hash digest
SHA256 eac159942ea8fb9928ce323fb49e1ed7f1dbdf6c18be8d4fa7b3873792ae8044
MD5 88d8313e271dd0eef012d518119da5c0
BLAKE2b-256 0065c909ea8b5046f6bf13e0ce258c117bd92249647800a06988103918b3e7b4

See more details on using hashes here.

File details

Details for the file astrora-0.1.1-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: astrora-0.1.1-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 773.1 kB
  • Tags: CPython 3.8+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.9.6

File hashes

Hashes for astrora-0.1.1-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 1761cb9f6de02a2bd01e7623754537454f8f6dee707ee11a45ea0fae6b03e71d
MD5 7912f62473cbade3a39168e34522f156
BLAKE2b-256 bd680d416705abc360a0c6edfffb0d0b080bd7258877548fb5da2e852b067139

See more details on using hashes here.

File details

Details for the file astrora-0.1.1-cp38-abi3-win32.whl.

File metadata

  • Download URL: astrora-0.1.1-cp38-abi3-win32.whl
  • Upload date:
  • Size: 729.5 kB
  • Tags: CPython 3.8+, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.9.6

File hashes

Hashes for astrora-0.1.1-cp38-abi3-win32.whl
Algorithm Hash digest
SHA256 c78cb426349ea881e3d3bc805dc671a2cb7873560eb3efd46767db80de0907c3
MD5 ce52ef532aff446d8d0d6a02d6d669ac
BLAKE2b-256 88987591dc9fd3e72e8645f8e1521ad6d543e2e031b2186b27d8c576198ceea1

See more details on using hashes here.

File details

Details for the file astrora-0.1.1-cp38-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for astrora-0.1.1-cp38-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 4b630508f19aa3596468d9dafc6ff6c60c4633ca4f2ed6ee2f6371c3923a596e
MD5 44b45eeb460232aa1c7a608b687ccfc2
BLAKE2b-256 e280f09ebe2eaeeff57608aa571a18c860f847d0a8ae3c24f08d143d7fad7609

See more details on using hashes here.

File details

Details for the file astrora-0.1.1-cp38-abi3-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for astrora-0.1.1-cp38-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 bc52bd2e0d69e1dd961519051d229890e741093f7af5dc37c227657d36458436
MD5 6fe0d4d56ee1aaa9324f960e560f9d85
BLAKE2b-256 dfd6f64d3cb862fcb5b1d870ab3384b6298b0de19c0a0ec6265a562ef21a6131

See more details on using hashes here.

File details

Details for the file astrora-0.1.1-cp38-abi3-musllinux_1_2_armv7l.whl.

File metadata

File hashes

Hashes for astrora-0.1.1-cp38-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 93630420a53509bbfe9d884829ad9aff89712a428ae7bdddf5a4e61ce4e82089
MD5 2ac76e02af26ca48208875f8067b525e
BLAKE2b-256 a83ed9718e5a6a530a8fcb92636fcb95ae0147e9a022cc126d8673dd5bae2a2f

See more details on using hashes here.

File details

Details for the file astrora-0.1.1-cp38-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for astrora-0.1.1-cp38-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 34832a5377ac5c6b26cd8fb21f44091563e468444e3506fa07bd7fab4b6f12cc
MD5 050d9694d6b0f1fd2848c3c4e3071454
BLAKE2b-256 5da2b1525e9d57041a09fb79f9c4c43288ebcd3bf87bfec9abdfc0b6b8117ea9

See more details on using hashes here.

File details

Details for the file astrora-0.1.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for astrora-0.1.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ff8f1647eea9f0b8b6b1cf94503be283ac4815107d2c97a58d264698603b7a80
MD5 b0b144460185366516b1d26efed3dbc2
BLAKE2b-256 358848ad2705bc46ff1817c86be5a3dcc9c517a7b6d43e5ef6713b576d5fc233

See more details on using hashes here.

File details

Details for the file astrora-0.1.1-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for astrora-0.1.1-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 276786d5cf0f26a14da3b270a704f526a338c913bf24886b820d8d3629306fee
MD5 8cd658f0864039e4b204d3ca4c7e7706
BLAKE2b-256 d10700704c22c18691bbc9d14b67cd03b91c616c17912d60b1c208675eb19d0b

See more details on using hashes here.

File details

Details for the file astrora-0.1.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for astrora-0.1.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 ab40b503bbdb19fc91bc9a40f8edf64bc756ab47c6d3f1001ed394ae51a54931
MD5 afc16f7f63dd7b14d4bc2c7f0e4c8e19
BLAKE2b-256 b28b78425cd64b4f2a469fdd233b6209afcf98b53f1a3790f8b8815ad9282bfc

See more details on using hashes here.

File details

Details for the file astrora-0.1.1-cp38-abi3-manylinux_2_12_i686.manylinux2010_i686.whl.

File metadata

File hashes

Hashes for astrora-0.1.1-cp38-abi3-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm Hash digest
SHA256 460f719aeac5ded2fedcd26ec1cdd2377f46a94b5a4859086d79179688ecd903
MD5 5e176e9512d2a7aae7bbc88d10d25961
BLAKE2b-256 8914c318c4fcf9a6564d32610bd36250d763eb30b3a11c1b7a68ca3729c2a246

See more details on using hashes here.

File details

Details for the file astrora-0.1.1-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for astrora-0.1.1-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c43eaf2c8e6641617c50b7fdb707ffd3a507a850e138b1b9d38fd786675ca787
MD5 aa26922375292308d116cd552dd09e70
BLAKE2b-256 42f86efd472826c087edb655628f254644ccc2be3443044433ffc8596f5949a3

See more details on using hashes here.

File details

Details for the file astrora-0.1.1-cp38-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for astrora-0.1.1-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 0ccfa8448ce73a6bd2d05de91f7419145a19790dfcdd31d65d95e163e766a9ca
MD5 412d296ca06c3852a0da3f5fd069cb4a
BLAKE2b-256 ab8180f3bbd8b97b82d558f2b4dc79ca70e382e90d1a4f7807807b8e5a4db65c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page