Skip to main content

Python bindings for astroz - high-performance astrodynamics library

Project description

astroz Python Bindings

High-performance SGP4 satellite propagation, powered by Zig with SIMD acceleration.

Platforms: macOS, Linux | Requires: Python 3.10+

Quick Start

from astroz import load_constellation, propagate_constellation
import numpy as np

# Load Starlink satellites and propagate for 1 day
constellation = load_constellation("starlink")
positions = propagate_constellation(constellation, np.arange(1440))
# positions: (1440, num_satellites, 3) in km, ECEF coordinates

Loading TLEs

from astroz import load_constellation

# CelesTrak groups
constellation = load_constellation("starlink")
constellation = load_constellation("iss")
constellation = load_constellation("gps")
constellation = load_constellation("all")  # ~10k active satellites

# By NORAD ID
constellation = load_constellation(norad_id=25544)  # ISS
constellation = load_constellation(norad_id=[25544, 48274])  # Multiple

# Local file or URL
constellation = load_constellation("satellites.tle")
constellation = load_constellation("https://example.com/tles.txt")

# With metadata (name, norad_id, inclination, period, etc.)
constellation, metadata = load_constellation("starlink", with_metadata=True)
for sat in metadata:
    print(f"{sat['name']}: {sat['inclination']:.1f}° inc, {sat['period']:.1f} min period")

Groups: all, starlink, oneweb, planet, spire, gps, glonass, galileo, beidou, stations/iss, weather, geo

Propagation

from astroz import load_constellation, propagate_constellation
from datetime import datetime, timezone
import numpy as np

constellation = load_constellation("starlink")

# Simple (defaults: now, ECEF)
positions = propagate_constellation(constellation, np.arange(1440))

# With options
positions = propagate_constellation(
    constellation,
    np.arange(14 * 1440),  # 2 weeks
    start_time=datetime(2024, 6, 1, tzinfo=timezone.utc),
    output="geodetic",  # "ecef" (default), "teme", or "geodetic"
)

# With velocities
positions, velocities = propagate_constellation(
    constellation, np.arange(1440), velocities=True
)

Single Satellite

from astroz import Tle, Sgp4
import numpy as np

tle = Tle("""1 25544U 98067A   24127.82853009  .00015698  00000+0  27310-3 0  9995
2 25544  51.6393 160.4574 0003580 140.6673 205.7250 15.50957674452123""")

sgp4 = Sgp4(tle)
pos, vel = sgp4.propagate(30.0)  # 30 min after epoch
positions, velocities = sgp4.propagate_batch(np.arange(1440))

Collision Screening

from astroz import load_constellation, propagate_constellation, coarse_screen, min_distances
import numpy as np

constellation = load_constellation("starlink")
positions = propagate_constellation(
    constellation, np.arange(1440),
    output="teme", layout="satellite_major"
)

# Find pairs within 10km
pairs, t_indices = coarse_screen(positions, threshold=10.0)

# Get exact minimum distances
pairs_array = np.array(pairs, dtype=np.uint32)
min_dists, min_times = min_distances(positions, pairs_array)

Performance

Constellation (13,448 sats × 1,440 steps) Throughput
1 thread 7.7M props/sec
16 threads 56M props/sec

Set ASTROZ_THREADS to control thread count.

Building

Requires Zig and Python 3.10+.

cd bindings/python
pip install -e .

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

astroz-0.4.4.tar.gz (7.1 kB view details)

Uploaded Source

Built Distributions

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

astroz-0.4.4-cp312-cp312-manylinux_2_34_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

astroz-0.4.4-cp312-cp312-macosx_15_0_universal2.whl (472.6 kB view details)

Uploaded CPython 3.12macOS 15.0+ universal2 (ARM64, x86-64)

astroz-0.4.4-cp311-cp311-manylinux_2_34_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

astroz-0.4.4-cp311-cp311-macosx_15_0_universal2.whl (472.6 kB view details)

Uploaded CPython 3.11macOS 15.0+ universal2 (ARM64, x86-64)

astroz-0.4.4-cp310-cp310-manylinux_2_34_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

File details

Details for the file astroz-0.4.4.tar.gz.

File metadata

  • Download URL: astroz-0.4.4.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for astroz-0.4.4.tar.gz
Algorithm Hash digest
SHA256 73e0f8df9ae6d5fa35a2a1b88bfc1eb4421bfc1b94786d8da0b0d36e890e50d2
MD5 afb3010395ff71bd20bac46804253ccc
BLAKE2b-256 fe6f20b3f3c2ba680ba1a51714da88d0a189b248db13f4bfed5cf07e261a418a

See more details on using hashes here.

Provenance

The following attestation bundles were made for astroz-0.4.4.tar.gz:

Publisher: python.yaml on ATTron/astroz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file astroz-0.4.4-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for astroz-0.4.4-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 f1d9c2807dc5d98aede072162c33ef683a79e023ee5092b84791d7bdda89cb59
MD5 89072b2c0ecbd781bcd18515469f2b44
BLAKE2b-256 018ccea2e2d7bb28316a02cf3d440b45520628c1bd6b101320b0b67e890234a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for astroz-0.4.4-cp312-cp312-manylinux_2_34_x86_64.whl:

Publisher: python.yaml on ATTron/astroz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file astroz-0.4.4-cp312-cp312-macosx_15_0_universal2.whl.

File metadata

File hashes

Hashes for astroz-0.4.4-cp312-cp312-macosx_15_0_universal2.whl
Algorithm Hash digest
SHA256 e4ff9998052fdc06249ee3f3b61f265ce13f099d8b9fcf1067ed96166ec88e09
MD5 001e26ec0c377c86eefb5c390a144569
BLAKE2b-256 173fd56478624367dea6ebf8e969d5b2c454ba662f3fc3073bb8590199427d51

See more details on using hashes here.

Provenance

The following attestation bundles were made for astroz-0.4.4-cp312-cp312-macosx_15_0_universal2.whl:

Publisher: python.yaml on ATTron/astroz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file astroz-0.4.4-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for astroz-0.4.4-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 83aad06a4f6effa3fdc278c6dc811bac4f7bdaf51fd16cc96991567497bb153c
MD5 54232b76d16358fb379e4c6d766b77f7
BLAKE2b-256 42d5ea506d8d8eafd2744f9f48ec03e8130bfbfa092deb1def0c5884452372fc

See more details on using hashes here.

Provenance

The following attestation bundles were made for astroz-0.4.4-cp311-cp311-manylinux_2_34_x86_64.whl:

Publisher: python.yaml on ATTron/astroz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file astroz-0.4.4-cp311-cp311-macosx_15_0_universal2.whl.

File metadata

File hashes

Hashes for astroz-0.4.4-cp311-cp311-macosx_15_0_universal2.whl
Algorithm Hash digest
SHA256 9d00decaa75324266b49cd8108f64b8f0f354673dabe37f526250e6699d89066
MD5 1a1014a55a522c84c053497e89f9bd5d
BLAKE2b-256 5ecbc8b2728b3d1f77e3039805f23f04a270c569db247bb95c932fa16a861d66

See more details on using hashes here.

Provenance

The following attestation bundles were made for astroz-0.4.4-cp311-cp311-macosx_15_0_universal2.whl:

Publisher: python.yaml on ATTron/astroz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file astroz-0.4.4-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for astroz-0.4.4-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 294d42af9053ddcb0222872a78648e136d950e67e21a3b1cb16145318477f742
MD5 0919fa7e88661b56419ee38467408f68
BLAKE2b-256 92dd322babea863b224548b85cdb7e977716bb8925fff6db143ce2cf094c6044

See more details on using hashes here.

Provenance

The following attestation bundles were made for astroz-0.4.4-cp310-cp310-manylinux_2_34_x86_64.whl:

Publisher: python.yaml on ATTron/astroz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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