Platform motion trajectories: stationary, linear, turns, great-circle, orbits, SGP4, waypoint/Hermite splines, and segmented composition
Project description
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,).
Sgp4Trajectoryconverts TEME to ECEF internally.KeplerianTrajectoryis a two-body approximation (no J2, drag, or third-body); for high fidelity useSgp4Trajectorywith real TLE data.- Downstream,
gri-geosim'sPlatformandEmitteraccept aPosdirectly and wrap it in aStationaryTrajectoryinternally.
License
MIT -- see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gri_trajectory-0.1.0.tar.gz.
File metadata
- Download URL: gri_trajectory-0.1.0.tar.gz
- Upload date:
- Size: 82.3 kB
- Tags: Source
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9fcecf1057e8e1940e06a5524dee4a4deeb266fd2cc287b378478f4d53de98b
|
|
| MD5 |
6418db056cc68b31851686e5353a252e
|
|
| BLAKE2b-256 |
b8c1a1634939bbae941a163bfad0d20b98152b907fc8ec7f84899f01fe685170
|
File details
Details for the file gri_trajectory-0.1.0-py3-none-any.whl.
File metadata
- Download URL: gri_trajectory-0.1.0-py3-none-any.whl
- Upload date:
- Size: 36.2 kB
- Tags: Python 3
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6825d8b31ea9217245342ab81e10727bb0f5d5ff788f0e79fd090476ff248ff6
|
|
| MD5 |
96b105f5e49cb8fd53f3a73db725f531
|
|
| BLAKE2b-256 |
3d424a9f5c679cae532c70001b162794d9e88e62e52ef4f8f38501644e2a825d
|