Skip to main content

gri-trajectory

Platform and emitter motion models for geolocation simulation. A trajectory defines how an entity moves through space over time; all trajectories implement a common Trajectory protocol providing position, velocity, and combined state queries at any time instant.

This package was factored out of gri-geosim so the motion models can be reused without pulling in the full simulation stack (it depends only on gri-nsepoch, gri-pos, and gri-utils, plus numpy/scipy/sgp4).

Install

uv add gri-trajectory

Import and use

from gri_trajectory import StationaryTrajectory, Sgp4Trajectory, WaypointTrajectory
from gri_pos import Pos

traj = StationaryTrajectory(Pos.LLA(38.0, -77.0, 100.0))
pos = traj.position_at(time)    # always the same Pos
vel = traj.velocity_at(time)    # [0, 0, 0]

Available trajectories

Trajectory Description
StationaryTrajectory Fixed position, zero velocity
LinearTrajectory Constant ECEF velocity from an initial Vel
CoordinatedTurnTrajectory Constant-rate level/climbing turn (local ENU tangent)
GreatCircleTrajectory Great-circle motion fixed in ECEF (aircraft, vehicles)
CircularOrbitTrajectory Circular orbit fixed in ECI (satellite approximation)
KeplerianTrajectory Two-body orbital mechanics (gri-utils backend)
Sgp4Trajectory SGP4/SDP4 TLE propagation (python-sgp4 backend)
WaypointTrajectory Interpolated path through waypoints (linear or cubic spline)
HermiteTrajectory Hermite spline interpolation through state vectors
SegmentedTrajectory Piecewise composition of sub-trajectories (C0-continuous)

Composing segmented paths

The legs submodule builds a SegmentedTrajectory from kinematic primitives (Straight, Turn, Climb, Hold):

from gri_trajectory import SegmentedTrajectory
from gri_trajectory.legs import Straight, Turn
from gri_pos import Vel

start = Vel.LLA(38.0, -77.0, 0.0, 10.0, 0.0, 0.0)   # east at 10 m/s
racetrack = SegmentedTrajectory.from_legs(
    start,
    [Straight(20.0), Turn(180.0, radius_m=50.0),
     Straight(20.0), Turn(180.0, radius_m=50.0)],
)

The placement submodule provides builders for positioning a point over a ground origin by look angle (sky_point, by slant range or target altitude) -- compose with the orbit constructors for an overhead collector.

Trajectory protocol

def position_at(time: Time) -> Pos
def velocity_at(time: Time) -> NDArray[np.floating]   # shape (3,), ECEF m/s
def state_at(time: Time) -> tuple[Pos, NDArray[np.floating]]

state_at() returns position and velocity in one call, which is more efficient than separate queries for some trajectory types.

Notes

  • All positions are ECEF (XYZ) in meters; velocities are ECEF m/s, shape (3,).
  • Sgp4Trajectory converts TEME to ECEF internally.
  • KeplerianTrajectory is a two-body approximation (no J2, drag, or third-body); for high fidelity use Sgp4Trajectory with real TLE data.
  • Downstream, gri-geosim's Platform and Emitter accept a Pos directly and wrap it in a StationaryTrajectory internally.

License

MIT -- see LICENSE.

Release files for gri-trajectory 0.1.0

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

Source distribution (sdist)

Source distribution for gri-trajectory 0.1.0
File Size Uploaded
gri_trajectory-0.1.0.tar.gz 82.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gri-trajectory 0.1.0
File Interpreter ABI Platform
gri_trajectory-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 118.5 kB

Release files / gri_trajectory-0.1.0.tar.gz

Download URL gri_trajectory-0.1.0.tar.gz
Size 82.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e9fcecf1057e8e1940e06a5524dee4a4deeb266fd2cc287b378478f4d53de98b
BLAKE2b-256 checksum
How to use checksums
b8c1a1634939bbae941a163bfad0d20b98152b907fc8ec7f84899f01fe685170
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / gri_trajectory-0.1.0-py3-none-any.whl

Download URL gri_trajectory-0.1.0-py3-none-any.whl
Size 36.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6825d8b31ea9217245342ab81e10727bb0f5d5ff788f0e79fd090476ff248ff6
BLAKE2b-256 checksum
How to use checksums
3d424a9f5c679cae532c70001b162794d9e88e62e52ef4f8f38501644e2a825d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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