Skip to content
/ astroz Public

Astrodynamics and Spacecraft Toolkit Written in Zig! Features orbit prop, celestial precession, CCSDS parsing, RF parsing, fits image parsing, and more!

License

Notifications You must be signed in to change notification settings

ATTron/astroz

Repository files navigation

CI CD DC

Astronomical and Spacecraft Toolkit Written in Zig

Featuring the fastest open-source SGP4 propagator.

Orbital Mechanics Spacecraft Ops Astronomy
SGP4 propagation CCSDS packets FITS parsing
TLE parsing VITA49 packets WCS coordinates
Orbital maneuvers Attitude determination Star precession
Monte Carlo sims Celestial bodies

Performance

Sub-meter accuracy validated against reference implementations. Uses SIMD (AVX2/SSE) to process 4 satellites simultaneously.

Single Satellite (Python)

Scenario astroz python-sgp4 Speedup
1 day (minute res) 0.24 ms 0.65 ms 2.7x
1 week (minute res) 1.99 ms 3.41 ms 1.7x
2 weeks (minute res) 3.22 ms 7.00 ms 2.2x
2 weeks (second res) 144 ms 438 ms 3.0x
1 month (minute res) 5.29 ms 14.84 ms 2.8x

Multi-Satellite Constellation

Satellites Time Points Total Props Throughput
100 10,080 1M 7.9M props/sec
13,000+ 120 1.5M 6M+ props/sec

The Cesium visualization example propagates the entire active satellite catalog (~13,000 satellites) at interactive rates. Try the live demo →

Python

pip install astroz
from astroz import Tle, Sgp4, Sgp4Constellation
import numpy as np

tle = Tle("1 25544U 98067A   24127.82853009 ...\n2 25544  51.6393 ...")
sgp4 = Sgp4(tle)

# Single propagation
pos, vel = sgp4.propagate(30.0)  # 30 min after epoch

# Batch propagation (zero-copy into pre-allocated arrays)
times = np.arange(1209600, dtype=np.float64) / 60.0  # 2 weeks in minutes
positions = np.empty((len(times), 3), dtype=np.float64)
velocities = np.empty((len(times), 3), dtype=np.float64)
sgp4.propagate_into(times, positions, velocities)

# Multi-satellite constellation (SIMD-accelerated)
tles = [Tle(tle_str) for tle_str in tle_strings]
constellation = Sgp4Constellation(tles)
times = np.arange(1440, dtype=np.float64)  # 1 day in minutes
out = np.empty((len(times) * constellation.num_batches * 4 * 6,), dtype=np.float64)
constellation.propagate_into(times, out)  # ~6M propagations/sec

Usage

  • Add astroz as a dependency in your build.zig.zon.
zig fetch --save https://github.com/ATTron/astroz/archive/<git_tag_or_commit_hash>.tar.gz
#or
zig fetch --save git+https://github.com/ATTron/astroz/#HEAD
  • Use astroz as a module in your build.zig.
const astroz_dep = b.dependency("astroz", .{
    .target = target,
    .optimize = optimize,
});
const astroz_mod = astroz_dep.module("astroz");
exe.root_module.addImport("astroz", astroz_mod);

Examples

Orbital Mechanics

  • Demonstrates interplanetary transfers with mission planning (Hohmann vs Bi-Elliptic comparison) and trajectory propagation.

  • Comprehensive example showing TLE-based orbit propagation with various maneuver types: impulse, plane change, and phase change.

  • Statistical analysis for mission planning with uncertainty.

  • Analytical orbit propagation using SGP4 with TLE input. Demonstrates both direct SGP4 usage and the modular propagator interface.

  • Interactive 3D visualization of the entire near-earth satellite catalog (~13,000 satellites) using Cesium. Features real-time SGP4 propagation at ~6M props/sec, constellation filtering, search, and satellite tracking.

Spacecraft Operations

Telemetry & Data Handling

Astronomy & Astrometry

sample fits image as png

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •