Trajectory analysis ( TrajAn )
TrajAn is a Python package for working with trajectory datasets that follow the CF-conventions for trajectories. Trajectory datasets contain position time series from e.g. drifting buoys or output from Lagrangian models.
Installation
conda / mamba (recommended):
mamba install -c conda-forge trajan
pip:
pip install trajan
Quick start
TrajAn exposes a .traj accessor on xarray Datasets:
import xarray as xr
import trajan as ta
# Open a CF-trajectory dataset (e.g. from drifting buoys)
ds = xr.open_dataset('barents.nc')
# Basic map plot — geographic projection is chosen automatically
ds.traj.plot()
# Calculate drifter speed, drop unreliable fixes, and plot coloured by speed
ds = ds.traj.drop_where(ds.traj.time_to_next() < np.timedelta64(5, "m"))
speed = ds.traj.speed()
ds.traj.plot(color=speed)
# Interpolate to a regular 1-hour time grid
dh = ds.traj.gridtime("1h")
# Animate the trajectories
ds.traj.animate().show()
For more examples and the full API reference see the documentation.
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 trajan-0.12.0.tar.gz.
File metadata
- Download URL: trajan-0.12.0.tar.gz
- Upload date:
- Size: 4.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a08905e7d405a62a0da6e23d745464b1412d654ed80550de9f8eb7821eb58ce6
|
|
| MD5 |
da53b6715f0c8ff13599e5b7f7547a84
|
|
| BLAKE2b-256 |
5fdd71db6e250d6b8c70ba3dcf00ff1dbdd76037941f29f5e88bb6cba1825319
|
File details
Details for the file trajan-0.12.0-py3-none-any.whl.
File metadata
- Download URL: trajan-0.12.0-py3-none-any.whl
- Upload date:
- Size: 65.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c3b3e2a2bd6d4f85fd920be1f884a64d7c941e5db7181b3e5b2315b53546c4e
|
|
| MD5 |
6ad689d2ee40423dc6d69e82d8cbceb8
|
|
| BLAKE2b-256 |
7503f85eb25c32b55228e7c612525b090773a5cafd5080d74b99c00a520d5fd7
|