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, geocentric
uv run python -m tart_client.cli celestial

# Topocentric RA/Dec as seen from an observer
uv run python -m tart_client.cli celestial --lat -45.87 --lon 170.60 --alt 100

# 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)

# Geocentric: direction as seen from the centre of the Earth
positions = client.celestial_positions()

# Topocentric: direction as seen from an observer (what a telescope needs)
positions = client.celestial_positions(lat=-45.87, lon=170.60, alt=100.0)

Derived from ECEF. Returns right ascension and declination, geocentric by default and topocentric when lat/lon are given:

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

distance_km is the distance from the geocentre, or the range from the observer in topocentric mode.

Transform: ECEF → ITRS → GCRS (geocentric). In topocentric mode the observer's GCRS position is subtracted from the satellite's and the direction of that baseline is returned. The ICRS frame is deliberately not used: it is centred on the Solar System barycentre, so transforming a satellite position into ICRS adds the Earth's ~1 AU offset and returns the Earth's own direction as seen from the Sun for every satellite (issue #14).

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) GCRS (RA/Dec), geocentric or topocentric astropy ITRS→GCRS
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.

Metadata

Release files for tart-catalogue-client 0.6.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tart-catalogue-client 0.6.5
File Size Uploaded Provenance Actions
tart_catalogue_client-0.6.5.tar.gz 44.2 kB Without provenance Details for tart_catalogue_client-0.6.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tart-catalogue-client 0.6.5
File Interpreter ABI Platform Actions
tart_catalogue_client-0.6.5-py3-none-any.whl Python 3 none any Details for tart_catalogue_client-0.6.5-py3-none-any.whl

Total release size: 56.5 kB

Release files / tart_catalogue_client-0.6.5.tar.gz

Download URL tart_catalogue_client-0.6.5.tar.gz
Size 44.2 kB
Tags Source
SHA-256 checksum
How to use checksums
0b65084cc4e077f582dea91d1ba0c6ef1780c6e74fca7edffc63a0164e1243b9
BLAKE2b-256 checksum
How to use checksums
01449c8868e9f3bd51663621e7a91a61b209ddee8093780334225bd0c5e26100
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","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}

Release files / tart_catalogue_client-0.6.5-py3-none-any.whl

Download URL tart_catalogue_client-0.6.5-py3-none-any.whl
Size 12.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ce7206ace9bd6c5e5e6a3f940f2194b87ac7424bd28224cf510c5d53b888841e
BLAKE2b-256 checksum
How to use checksums
70c20aa90f76f8d3807d180bb0d2373872a540362b17fe9e987e89cab45512c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","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}

Security for tart-catalogue-client 0.6.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page