All Projects → traja-team → traja

traja-team / traja

Licence: MIT license
Python tools for spatial trajectory and time-series data analysis

Programming Languages

Jupyter Notebook
11667 projects
python
139335 projects - #7 most used programming language
TeX
3793 projects

Projects that are alternatives of or similar to traja

t2vec
t2vec: Deep Representation Learning for Trajectory Similarity Computation
Stars: ✭ 68 (+4.62%)
Mutual labels:  spatial-data-analysis
yupi
Python package designed for collecting and processing trajectory data.
Stars: ✭ 30 (-53.85%)
Mutual labels:  trajectory-analysis
swaRm
A R package to process and analyze collective behavior data
Stars: ✭ 22 (-66.15%)
Mutual labels:  animal-behavior
cellrouter
Reconstruction of complex single-cell trajectories using CellRouter
Stars: ✭ 38 (-41.54%)
Mutual labels:  trajectory-analysis
neuralRDEs
Code for: "Neural Rough Differential Equations for Long Time Series", (ICML 2021)
Stars: ✭ 102 (+56.92%)
Mutual labels:  time-series-analysis
Trajectory-Analysis-and-Classification-in-Python-Pandas-and-Scikit-Learn
Formed trajectories of sets of points.Experimented on finding similarities between trajectories based on DTW (Dynamic Time Warping) and LCSS (Longest Common SubSequence) algorithms.Modeled trajectories as strings based on a Grid representation.Benchmarked KNN, Random Forest, Logistic Regression classification algorithms to classify efficiently t…
Stars: ✭ 41 (-36.92%)
Mutual labels:  trajectory-analysis
st-hadoop
ST-Hadoop is an open-source MapReduce extension of Hadoop designed specially to analyze your spatio-temporal data efficiently
Stars: ✭ 17 (-73.85%)
Mutual labels:  spatial-data-analysis
timemachines
Predict time-series with one line of code.
Stars: ✭ 342 (+426.15%)
Mutual labels:  time-series-analysis
tsa4
R code for Time Series Analysis and Its Applications, Ed 4
Stars: ✭ 108 (+66.15%)
Mutual labels:  time-series-analysis
tianchi-trajectory-data-mining
天池DCIC2020船只轨迹数据挖掘比赛算法阶段Rank 3解决方案:
Stars: ✭ 92 (+41.54%)
Mutual labels:  trajectory-analysis
TrackViz
Recorded tracks visualization plugin built on Unreal Engine. Airsim compatible.
Stars: ✭ 19 (-70.77%)
Mutual labels:  trajectory-analysis
comparing-trajectory-clustering-methods
Comparing Different Clustering Methods and Similarity Metrics on Trajectory Datasets
Stars: ✭ 82 (+26.15%)
Mutual labels:  trajectory-analysis
membrane-curvature
MDAnalysis tool to calculate membrane curvature.
Stars: ✭ 19 (-70.77%)
Mutual labels:  trajectory-analysis
pytraj
Python interface of cpptraj
Stars: ✭ 106 (+63.08%)
Mutual labels:  trajectory-analysis
rsgislib
Remote Sensing and GIS Software Library; python module tools for processing spatial data.
Stars: ✭ 103 (+58.46%)
Mutual labels:  spatial-data-analysis
recmap
Draw your own Rectangular Statistical Cartogram - CRAN package
Stars: ✭ 18 (-72.31%)
Mutual labels:  spatial-data-analysis
NAGPythonExamples
Examples and demos showing how to call functions from the NAG Library for Python
Stars: ✭ 46 (-29.23%)
Mutual labels:  time-series-analysis
CoronaDash
COVID-19 spread shiny dashboard with a forecasting model, countries' trajectories graphs, and cluster analysis tools
Stars: ✭ 20 (-69.23%)
Mutual labels:  time-series-analysis
pssa
Singular Spectrum Analysis for time series forecasting in Python
Stars: ✭ 119 (+83.08%)
Mutual labels:  time-series-analysis
Time-Series-Analysis-and-Forecasting-with-Python
No description or website provided.
Stars: ✭ 24 (-63.08%)
Mutual labels:  time-series-analysis

Traja Python 3.6+ Travis PyPI Conda Documentation Status Gitter Black License: MIT Binder Codecov DOI JOSS

Colab

Traja is a Python library for trajectory analysis. It extends the capability of pandas DataFrame specific for animal trajectory analysis in 2D, and provides convenient interfaces to other geometric analysis packages (eg, R and shapely).

Introduction

The traja Python package is a toolkit for the numerical characterization and analysis of the trajectories of moving animals. Trajectory analysis is applicable in fields as diverse as optimal foraging theory, migration, and behavioral mimicry (e.g. for verifying similarities in locomotion). A trajectory is simply a record of the path followed by a moving animal. Traja operates on trajectories in the form of a series of locations (as x, y coordinates) with times. Trajectories may be obtained by any method which provides this information, including manual tracking, radio telemetry, GPS tracking, and motion tracking from videos.

The goal of this package (and this document) is to aid biological researchers, who may not have extensive experience with Python, to analyze trajectories without being restricted by a limited knowledge of Python or programming. However, a basic understanding of Python is useful.

If you use traja in your publications, please cite the repo

@software{justin_shenk_2019_3237827,
  author       = {Justin Shenk and
                  the Traja development team},
  title        = {justinshenk/traja},
  month        = jun,
  year         = 2019,
  publisher    = {Zenodo},
  version      = {latest},
  doi          = {10.5281/zenodo.3237827},
  url          = {https://doi.org/10.5281/zenodo.3237827}
}

Installation and setup

To install traja with conda, run

conda install -c conda-forge traja

or with pip

pip install traja.

Import traja into your Python script or via the Python command-line with import traja.

Trajectories with traja

Traja stores trajectories in pandas DataFrames, allowing any pandas functions to be used.

Load trajectory with x, y and time coordinates:

import traja

df = traja.read_file('coords.csv')

Once a DataFrame is loaded, use the .traja accessor to access the visualization and analysis methods:

df.traja.plot(title='Cage trajectory')

Analyze Trajectory

The following functions are available via traja.trajectory.[method]
Function Description
calc_derivatives Calculate derivatives of x, y values
calc_turn_angles Calculate turn angles with regard to x-axis
transitions Calculate first-order Markov model for transitions between grid bins
generate Generate random walk
resample_time Resample to consistent step_time intervals
rediscretize_points Rediscretize points to given step length

For up-to-date documentation, see https://traja.readthedocs.io.

Random walk

Generate random walks with

df = traja.generate(n=1000, step_length=2)
df.traja.plot()

walk\_screenshot.png

Resample time

traja.trajectory.resample_time allows resampling trajectories by a step_time.

Flow Plotting

df = traja.generate()
traja.plot_surface(df)

3D plot

traja.plot_quiver(df, bins=32)

quiver plot

traja.plot_contour(df, filled=False, quiver=False, bins=32)

contour plot

traja.plot_contour(df, filled=False, quiver=False, bins=32)

contour plot filled

traja.plot_contour(df, bins=32, contourfplot_kws={'cmap':'coolwarm'})

streamplot

Acknowledgements

traja code implementation and analytical methods (particularly rediscretize_points) are heavily inspired by Jim McLean's R package trajr. Many thanks to Jim for his feedback.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].