Skip to main content

TART Catalogue Python Client

Fetches TLE data from the catalogue server and computes satellite positions in ECEF, celestial (RA/Dec), or horizontal (Az/El) coordinates.

Setup

uv sync

CLI Usage

# ECEF positions (default)
uv run python -m tart_client.cli ecef

# Celestial (RA/Dec) positions
uv run python -m tart_client.cli celestial

# Horizontal (Az/El) positions
uv run python -m tart_client.cli horizontal

# Benchmark (default 1000 queries over last week)
uv run python -m tart_client.cli benchmark 5000

# Custom server and date
uv run python -m tart_client.cli ecef \
  --url http://localhost:8876 \
  --date 2026-06-16T12:00:00Z

Set TART_CATALOGUE_URL to avoid repeating --url:

export TART_CATALOGUE_URL=http://localhost:8876
uv run python -m tart_client.cli celestial

Library API

from tart_client import CatalogueClient

client = CatalogueClient()  # defaults to https://tart.elec.ac.nz/catalog
# Or: CatalogueClient(base_url="http://localhost:8876")

Fetch raw TLEs

tles = client.fetch_tles()
# Returns: [{"name": "...", "line1": "...", "line2": "..."}, ...]

ECEF positions

positions = client.ecef_positions()

Returns Earth-Centered Earth-Fixed coordinates:

[
  {
    "name": "GPS BIIR-2  (PRN 13)",
    "ecef_km": [12345.678, -23456.789, 3456.78],
    "velocity_km_s": [1.234, -2.345, 5.678]
  }
]

Transform: SGP4 → TEME → rotate by −GMST → ECEF.

Celestial positions (RA/Dec)

positions = client.celestial_positions()

Derived from ECEF. Returns ICRS right ascension and declination:

[
  {
    "name": "GPS BIIR-2  (PRN 13)",
    "ra_hours": 12.345678,
    "dec_degrees": -45.678901,
    "distance_km": 26500.0
  }
]

Transform: ECEF → ITRS → ICRS (via astropy).

Horizontal positions (Az/El)

positions = client.horizontal_positions(
    lat=-45.87,       # observer latitude (degrees)
    lon=170.60,       # observer longitude (degrees)
    alt=100.0,        # observer altitude (meters)
    min_elevation=10,  # min elevation to include (default -90 = all)
    name_regex="GPS",  # optional regex to filter by name (default None)
)

Derived from ECEF. Returns topocentric azimuth and elevation:

[
  {
    "name": "GPS BIIR-2  (PRN 13)",
    "azimuth_deg": 45.123456,
    "elevation_deg": 30.654321,
    "range_km": 20200.123
  }
]

Transform: ECEF → observer-relative ENU → Az/El (WGS84 ellipsoid).

Fast satellite count

count = client.count_satellites()
# Returns: number of TLE records (no propagation)

Caching

TLE data is cached in ~/.cache/tart-catalogue/:

  • Nearest-match: any cached entry within 12 hours of the requested time is reused
  • LRU eviction: oldest 100+ entries are removed
  • In-memory: parsed SGP4 satellite objects are cached per cache key to avoid re-parsing TLE lines

Server fetch requests are logged to stderr with the request datetime.

Coordinate transforms

Method Input Frame Output Frame Transform
ecef_positions TEME (SGP4) ITRS (ECEF) Rotate by −GMST
celestial_positions ITRS (ECEF) ICRS (RA/Dec) astropy ITRS→ICRS
horizontal_positions ITRS (ECEF) ENU → Az/El WGS84 geodetic + rotation

Testing

uv run pytest tart_client/ -v

Tests validate against astropy-generated reference vectors in test-vectors/test_vectors.json.

Download files

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

Source Distribution

tart_catalogue_client-0.5.2.tar.gz (40.9 kB view details)

Uploaded Source

Built Distribution

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

tart_catalogue_client-0.5.2-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file tart_catalogue_client-0.5.2.tar.gz.

File metadata

  • Download URL: tart_catalogue_client-0.5.2.tar.gz
  • Upload date:
  • Size: 40.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for tart_catalogue_client-0.5.2.tar.gz
Algorithm Hash digest
SHA256 c5cf1b0ba53d76d82e356b02342a0a5e10e681d73a246409abe0c117193e11a1
MD5 e4c893328e7316d3d1dc982142d6e473
BLAKE2b-256 276cb9c9c8fcb2960a4cf7280d7319cb3bd76003836f0534a84bc7bdfa1562ba

See more details on using hashes here.

File details

Details for the file tart_catalogue_client-0.5.2-py3-none-any.whl.

File metadata

  • Download URL: tart_catalogue_client-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for tart_catalogue_client-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f98cc67da3a45a4d296040b78c76b324547656fa8a0788095fe4309302688d17
MD5 416f02ca1d30eae9d6cdfa34cd110dd7
BLAKE2b-256 d43e0e52f826af2190ec4150d73701844fba34be0c094a75a57cd7a639653449

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.5.2 This release

2 files

0.5.1

2 files

0.5.0

2 files

0.4.1

2 files

0.4.0

2 files

0.3.3

2 files

0.3.2

2 files

Supported by

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