Skip to main content

gps_frames

Reference frame representation, transformations, and operations for GPS.

Test Python package Coverage PyPI version PyPI pyversions License CodeQL Upload Python Package

Documentation | GitHub | PyPI

Installation

This module can be installed using PyPI:

pip install gps-frames

Quick Start

Here is a simple example of how to calculate the distance between a ground station and a satellite.

import numpy as np
from datetime import datetime
from gps_time import GPSTime
from gps_frames import Position, distance

# 1. Define the time of interest
time = GPSTime.from_datetime(datetime(2023, 1, 1, 12, 0, 0))

# 2. Define a Ground Station (Los Angeles) in Geodetic coordinates (LLA)
ground_station = Position(
    np.array([34.05 * np.pi / 180, -118.25 * np.pi / 180, 100.0]), # Lat (rad), Lon (rad), Alt (m)
    time,
    "LLA"
)

# 3. Define a Satellite (GPS) in ECEF coordinates
# (Simplified position for demonstration)
satellite = Position(
    np.array([15000e3, 15000e3, 15000e3]), # x, y, z in meters
    time,
    "ECEF"
)

# 4. Calculate distance
dist = distance(ground_station, satellite)
print(f"Distance: {dist/1000:.2f} km")

# 5. Convert frames easily
ground_station_ecef = ground_station.get_position("ECEF")
print(f"Ground Station ECEF: {ground_station_ecef.coordinates}")

Running Tests

This module includes tests for all of the major functionality. To run the tests, you can use the commands in the makefile make test. Because some of the functions use JIT compilation via Numba, make test-nojit runs all of the tests without JIT compilation to enable better code coverage analysis.

Using gps_frames

The motivating use case of this module is to determine distances between two points in space while accounting for non-inertial reference frames and non-simultaneous position measures. The examples/ directory contains scripts demonstrating the library's capabilities:

  • examples/example.py: A basic walkthrough of creating Positions, checking visibility, and calculating ranges/azimuths.
  • examples/case_study_satellite_tracking.py: An advanced case study simulating a 3-day satellite pass from a ground station, demonstrating orbit propagation, coordinate frame rotations, and custom basis projections.

To run the examples:

# Basic example
python examples/example.py

# Advanced Case Study (requires matplotlib)
pip install .[examples]
python examples/case_study_satellite_tracking.py

Note: When first run, gps-frames has significant overhead due to JIT compliation. This should only occur on the first run. Additionally, you may see NumbaPerformanceWarning messages related to the @ (matrix multiplication) operator. These can be disregarded and should only appear the first time gps-frames is run.

AI Disclosure

Generative AI was used to assist in the development of this module. All logic and techniques were developed without the use of AI. Following AI models were used: Gemini 3 Pro (High), Gemini 3 Flash, Claude Opus 4.5. The first version containing any AI generated information is version 3.0.0. The final version without any AI generated information is version 2.8.2.

Licence

The gps_frames module is released under the GNU AGPL v3 license.

Copyright (c) 2022 The Aerospace Corportation.

Open Source Licenses

EGM96 Data Source

This module makes use of data related to the EGM96 gravity model. This data was generated by the National Geospatial-intelligence Agency (NGA) and the data used is derived from https://github.com/vectorstofinal/geoid_heights, used under the MIT License Copyright (c) 2015 vectorstofinal.

pdoc3

An earlier version of this module used pdoc3 for documentation. The documentation templates are based on the default template provided from pdoc3 and used under the AGPL v3 license.

Metadata

Release files for gps-frames 3.0.1

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

Source distribution (sdist)

Source distribution for gps-frames 3.0.1
File Size Uploaded
gps_frames-3.0.1.tar.gz 364.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gps-frames 3.0.1
File Interpreter ABI Platform
gps_frames-3.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 675.6 kB

Release files / gps_frames-3.0.1.tar.gz

Download URL gps_frames-3.0.1.tar.gz
Size 364.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f12f8d9aefcd04eaa5774a87ddf80a0bf3627f04706cb80d5ffdd00f50679835
BLAKE2b-256 checksum
How to use checksums
f3831a310a4471c87678d0ede3e61e62a550aaf305c8366b9612408a768c6643
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 27, 2026.

Transparency log

Release files / gps_frames-3.0.1-py3-none-any.whl

Download URL gps_frames-3.0.1-py3-none-any.whl
Size 311.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d47fdab7c876968afa4c6c66f5a994a325d736878d7d964990ebf911e083107e
BLAKE2b-256 checksum
How to use checksums
4d15d2caec51bdc9e1d17af9059dd5c460554bf3811b78eeceeb1640332bdcab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 27, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

3.0.1 This release

2 release files

3.0.0

2 release files

2.8.2

2 release files

2.8.0

1 release file

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