Skip to main content

Read and manipulate Universal Tracking Data Format (UTDF) satellite tracking data

Project description

UTDFpy

A Python library for reading and manipulating Universal Tracking Data Format (UTDF) satellite tracking data.

A direct conversion of https://github.com/trwyant/perl-Astro-UTDF. Thanks go to https://github.com/trwyant for creating the Perl module.

Binary Format

UTDF records are 75-byte big-endian binary structures. The library uses explicit big-endian unpacking (struct format >), so it produces identical results on any architecture (arm64, amd64, etc.).

Prerequisites

  • Task (task runner)
  • Docker (or Podman)

Development

All development tasks run inside a Docker container via Taskfile.yaml. To use Podman instead of Docker:

task tests CONTAINER_BIN=podman

Available tasks

task tests          # Run lint, format check, typecheck, then pytest
task tests:cov      # Run tests with coverage report
task lint           # Run ruff linter
task lint:fix       # Run ruff linter with auto-fix (modifies host files)
task format         # Run ruff formatter (modifies host files)
task format:check   # Check formatting without changes
task typecheck      # Run mypy type checking
task check          # Run all checks (lint, format, typecheck, tests)
task build          # Build distribution packages
task publish        # Build and publish package to PyPI
task utdfpy:install # Install utdfpy from PyPI into local venv
task clean          # Remove build artifacts and caches
task clean:all      # Remove everything including Docker image

Task dependency chain

tests depends on lint, format:check, and typecheck, each of which depends on docker:build. Running task tests will automatically build the Docker image, run the linter, check formatting, and run mypy before executing the test suite. publish depends on tests, so it runs the full check suite before uploading to PyPI.

Installation

pip install utdfpy

Or for development:

pip install -e '.[dev]'

Usage

from utdfpy import UTDFRecord

# Read all records from a UTDF file
records = UTDFRecord.slurp("tracking_data.utd")

for record in records:
    print(record.sic, record.vid, record.decode("measurement_time"))
    print(f"  azimuth:  {record.azimuth}")
    print(f"  elevation: {record.elevation}")
    print(f"  range:    {record.range}")

CLI tool

An interactive query tool is included:

query-utdf tracking_data.utd

Commands: load, count, select, next, list, or type any field name to inspect it.

CI/CD

  • GitHub Actions (.github/workflows/ci.yaml): runs lint, tests, and typecheck on push/PR; publishes to PyPI on release.
  • GitLab CI (.gitlab-ci.yaml): runs lint, tests (Python 3.10-3.13), and typecheck; publishes to PyPI on version tags.

License

Artistic-2.0 OR GPL-1.0-or-later (same as the original Perl module).

Architecture

classDiagram
    class UTDFRecord {
        -bytes _front
        -str _router
        -int _year
        -int _sic
        -int _vid
        -int _seconds_of_year
        -int _microseconds_of_year
        -float _transponder_latency
        -bool _enforce_validity
        -UTDFRecord _prior_record
        -float _factor_K
        -float _factor_M
        +azimuth() float
        +elevation() float
        +range_delay() float
        +doppler_count() float
        +doppler_shift() float
        +range() float
        +range_rate() float
        +measurement_time() float
        +transmit_frequency() int
        +raw_record() bytes
        +hex_record() str
        +clone() UTDFRecord
        +slurp(file) list~UTDFRecord~
        +iter_file(file) Iterator~UTDFRecord~
        +decode(field_name) str
    }

    class UTDFError {
        <<exception>>
    }

    class InvalidRecordError {
        <<exception>>
    }

    class FrequencyBand {
        <<IntEnum>>
        UNSPECIFIED
        VHF
        UHF
        S_BAND
        C_BAND
        X_BAND
        KU_BAND
        VISIBLE
    }

    class TransmissionType {
        <<IntEnum>>
        TEST
        SIMULATED
        RESUBMIT
        REAL_TIME
        PLAYBACK
    }

    class TrackingMode {
        <<IntEnum>>
        AUTOTRACK
        PROGRAM_TRACK
        MANUAL
        SLAVED
    }

    class TrackerType {
        <<IntEnum>>
        C_BAND_PULSE
        SRE
        SGLS
        TDRSS
    }

    class AntennaGeometry {
        <<IntEnum>>
        AZ_EL
        XY_SOUTH
        XY_EAST
        RA_DEC
        HR_DEC
    }

    Exception <|-- UTDFError
    UTDFError <|-- InvalidRecordError
    UTDFRecord --> UTDFRecord : prior_record
    UTDFRecord ..> InvalidRecordError : raises
    UTDFRecord ..> parsing : uses
    UTDFRecord ..> decode : uses

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

utdfpy-0.1.1.tar.gz (29.3 kB view details)

Uploaded Source

Built Distribution

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

utdfpy-0.1.1-py3-none-any.whl (24.9 kB view details)

Uploaded Python 3

File details

Details for the file utdfpy-0.1.1.tar.gz.

File metadata

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

File hashes

Hashes for utdfpy-0.1.1.tar.gz
Algorithm Hash digest
SHA256 968c1d785898fc7e454f1c47d5f34b6db4b1ef69e51ff3b27619448b05c1ef9e
MD5 370776e2779e322b530da1a3c8da011c
BLAKE2b-256 00347e70b9910c7d1bf0a1816c7bf24d5cdbc4161e70bb05e961f91cd76e5225

See more details on using hashes here.

Provenance

The following attestation bundles were made for utdfpy-0.1.1.tar.gz:

Publisher: ci.yaml on haisamido/UTDFpy

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

File details

Details for the file utdfpy-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: utdfpy-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 24.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for utdfpy-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 00d81fc2c5905d207fcf6525df585a9e89398ec7867f40ea7ef73029f99a93c0
MD5 3659aa028514b73e9c48b8453ee7e2e3
BLAKE2b-256 a0a2316264b5845636e5cc0045d46b90c164cbd801e29fe49c4523d5397c3504

See more details on using hashes here.

Provenance

The following attestation bundles were made for utdfpy-0.1.1-py3-none-any.whl:

Publisher: ci.yaml on haisamido/UTDFpy

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