Featuring the fastest CPU based 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 |
Sub-meter accuracy validated against reference implementations. Uses SIMD (AVX512/AVX2) to process 8 satellites simultaneously, with multithreaded constellation propagation across all available cores.
| Implementation | Props/sec | Speedup vs python-sgp4 |
|---|---|---|
| astroz | 30.8M | 11x |
| Rust sgp4 | 5.1M | 1.8x |
| heyoka | 3.8M | 1.3x |
| satkit | 3.5M | 1.2x |
| python-sgp4 | 2.8M | 1x |
| Implementation | 1 Thread | 16 Threads |
|---|---|---|
| astroz | 37.7M/s | 303M/s |
| heyoka | 15.7M/s | 155.6M/s |
| Rust sgp4 (rayon) | 4.4M/s | 47.9M/s |
| satkit | 3.5M/s | 3.5M/s |
| python-sgp4 | 2.7M/s | 2.7M/s |
Benchmarked on AMD Ryzen 7 7840U (16 threads). All implementations using their optimal configurations (SIMD, pre-allocated outputs, batch mode).
Uses SIMD (AVX512 for 8-wide, AVX2/SSE for 4-wide) with multithreaded time-major iteration. Validated against Vallado AIAA 2006-6753 reference vectors (< 10m position error, < 1µm/s velocity error). Set ASTROZ_THREADS environment variable to control thread count (defaults to all available cores).
The Cesium visualization example propagates the entire active satellite catalog (~13,000 satellites) at interactive rates. Try the live demo →
pip install astrozDrop-in replacement for python-sgp4. Just change the import for instant speedup:
# Before # After
from sgp4.api import Satrec, jday → from astroz.api import Satrec, jday| Your Code | python-sgp4 | astroz | Speedup |
|---|---|---|---|
sat.sgp4() loop |
1.3M/s | 2.5M/s | 2x |
sat.sgp4_array() |
2.7M/s | 15M/s | 5x |
SatrecArray.sgp4() |
3M/s | 290M/s | 100x |
See migration guide for optimization tips.
from astroz.api import Satrec, SatrecArray, jday, WGS72
import numpy as np
# Single satellite (same syntax as python-sgp4)
line1 = "1 25544U 98067A 24127.82853009 .00015698 00000+0 27310-3 0 9995"
line2 = "2 25544 51.6393 160.4574 0003580 140.6673 205.7250 15.50957674452123"
sat = Satrec.twoline2rv(line1, line2, WGS72)
jd, fr = jday(2024, 5, 6, 12, 0, 0.0)
error, position, velocity = sat.sgp4(jd, fr)
# Batch propagation (270-330M props/sec with SIMD)
sat_array = SatrecArray([sat1, sat2, ...]) # List of Satrec objects
# Single time point (scalars)
e, r, v = sat_array.sgp4(2460000.5, 0.5)
# Multiple time points (arrays)
jd = np.full(1440, 2460000.5)
fr = np.linspace(0, 1, 1440)
e, r, v = sat_array.sgp4(jd, fr) # (n_sats, n_times, 3)
# Skip velocities for 30% faster propagation
e, r, _ = sat_array.sgp4(jd, fr, velocities=False)Convenience functions for common workflows:
from astroz import propagate, Constellation
import numpy as np
# Load and propagate - automatically optimized for maximum performance
positions = propagate("starlink", np.arange(1440)) # 1 day at 1-min intervals
# shape: (1440, num_satellites, 3) in km, ECEF coordinates
# With options
from datetime import datetime, timezone
positions = propagate(
"starlink",
np.arange(1440),
start_time=datetime(2024, 6, 15, tzinfo=timezone.utc),
output="geodetic", # "ecef" (default), "teme", or "geodetic"
)
# With velocities
positions, velocities = propagate("starlink", np.arange(1440), velocities=True)
# For repeated propagation, pre-parse to avoid overhead
c = Constellation("starlink")
positions = propagate(c, np.arange(1440))- Add
astrozas a dependency in yourbuild.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
astrozas a module in yourbuild.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);-
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 multithreaded SGP4 propagation at ~300M props/sec, constellation filtering, search, and satellite tracking.
- Calculate spacecraft attitude and orientation.
-
VITA Radio Transport (VRT) packet stream parsing.
-
Parse CCSDS space packet protocol from files.
-
Generate CCSDS packets for telemetry.
- Parse and render FITS astronomical image data.
-
Calculate stellar precession to a target epoch.
-
Compute World Coordinate System values from orbital elements.
