Skip to main content

Trajectory analysis ( TrajAn )

Build (python) Docs PyPI version Anaconda-Server Badge

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.

Barents Sea drifter trajectories coloured by speed

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

trajan-0.12.1.tar.gz (4.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

trajan-0.12.1-py3-none-any.whl (65.6 kB view details)

Uploaded Python 3

File details

Details for the file trajan-0.12.1.tar.gz.

File metadata

  • Download URL: trajan-0.12.1.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

Hashes for trajan-0.12.1.tar.gz
Algorithm Hash digest
SHA256 88c7097449da48681b11aa6535cd148f1282de70224947616db330f5dbe049e7
MD5 f60aeeedb1d26c144023f11d38f6bacc
BLAKE2b-256 ebe1868fda1fc60f2ee873e8ed1076023391601f2b1887bd91b22e7cd5a59acc

See more details on using hashes here.

File details

Details for the file trajan-0.12.1-py3-none-any.whl.

File metadata

  • Download URL: trajan-0.12.1-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

Hashes for trajan-0.12.1-py3-none-any.whl
Algorithm Hash digest
SHA256 89d0f98bb915ad419380164676a74c84f2efab13534631b59defa996e6ff90bc
MD5 c4c335880bf378e776f85c29d8f4aca3
BLAKE2b-256 9677f2882e0b97efc3e625b8dbd5220581fe09f1fad8c0119df8d464b903934e

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.12.1 This release

2 files

0.12.0

2 files

0.11.0

2 files

0.10.4

2 files

0.8.0

2 files

0.7.0

2 files

0.6.3

2 files

0.6.2

2 files

0.6.1

2 files

0.6.0

2 files

0.5.1

2 files

0.5.0

2 files

0.4.0

2 files

0.3.3

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.0

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 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