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).
Documentation
The wheel ships its documentation inside the package, in gri_trajectory/docs/,
so it is available wherever the package is installed:
overview.md-- the protocol, each trajectory, legs, and trapsapi_summary.md-- every public class, method, and signature (generated)
Print the directory with
python -c "import gri_trajectory, pathlib; print(pathlib.Path(gri_trajectory.__file__).parent / 'docs')".
Every example in those files is run by the test suite.
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(dt) # dt: seconds from traj.epoch_unix_s
vel = traj.velocity_at(dt) # [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
epoch_unix_s: float # absolute time of dt = 0
def position_at(dt: float = 0.0) -> Pos
def velocity_at(dt: float = 0.0) -> NDArray[np.floating] # shape (3,), ECEF m/s
def state_at(dt: float = 0.0) -> Vel # position and velocity
dt is seconds relative to the trajectory's own epoch_unix_s, not an absolute
time: convert with dt = unix_s - traj.epoch_unix_s. state_at() returns both
in one call, which is cheaper 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.
Release files for gri-trajectory 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gri_trajectory-0.1.1.tar.gz | 54.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gri_trajectory-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 97.3 kB
Release files / gri_trajectory-0.1.1.tar.gz
| Download URL | gri_trajectory-0.1.1.tar.gz |
|---|---|
| Size | 54.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1ad2a6e208d8695fa02f29585307c8b95d3cf251315d75ab8b18e8505c02fb04
|
|
BLAKE2b-256 checksum How to use checksums |
9e7b3d57f6e020fb3f1e4ee2edb8d04de88a0baaae60bc0496c97b2abba59eba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","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.1-py3-none-any.whl
| Download URL | gri_trajectory-0.1.1-py3-none-any.whl |
|---|---|
| Size | 43.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
97ed09eda7db06f8c3b8bdab7ccb145f3e0af9c1b85f2fab00f3e25c7871d63b
|
|
BLAKE2b-256 checksum How to use checksums |
b0505a454c45a1767b620ce40a0634dfe24729c2e782eb6744644e73a46bf65e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|