ocetrac is a Python package for labelling and tracking geospatial features in gridded datasets. It provides two tracking algorithms:
- DeepTrack — 4-D connected-component labelling and temporal tracking across
(time, depth, lat, lon), designed for subsurface features such as volumetric marine heatwaves. - SurfTrack — 3-D connected-component labelling and temporal tracking across
(time, lat, lon), designed for surface features. SurfTrack supports two temporal connectivity modes:- Permissive — any spatial overlap between consecutive timesteps links two features as the same event.
- Restrictive — a user-defined overlap threshold (e.g. 0.45) must be exceeded to link two features.
Both trackers operate lazily with Dask for memory-efficient, parallelised execution on large datasets.
Mamba (Recommended)
We recommend mamba for installation. Mamba is a fast drop-in replacement for conda. If you don't have mamba, install Miniforge which ships with mamba by default, or install mamba into an existing conda environment:
conda install -n base -c conda-forge mambaThen install ocetrac:
mamba install -c conda-forge ocetracPyPI
pip install ocetracFrom source
git clone https://github.com/ocetrac/ocetrac.git
cd ocetrac
pip install -e .Development environment
mamba env create -f environment.yml
mamba activate ocetrac
python -m pytest tests/ -vocetrac/
├── preprocessing/ — anomaly computation, morphological cleaning, thresholding
├── DeepTrack/ — 4-D tracker (time, depth, lat, lon)
└── SurfTrack/ — 3-D tracker (time, lat, lon)
Issues and pull requests are welcome on GitHub. Please file a bug report if you find a problem, or open a pull request if you make an improvement.
SurfTrack — When using the SurfTrack module, please cite the original software and Spatiotemporal Evolution of Marine Heatwaves Globally.
DeepTrack — The DeepTrack module is currently being prepared for publication. Citation details will be added here upon publication.
- We rely heavily on scikit-image and its community of contributors.
- This work is currently supported through a collaboration with the UW eScience Institute.
- This work originally grew from a collaboration with NCAR during the ASP Graduate Visitor Program attended by Hillary Scannell. This project received support from the Leonardo DiCaprio Foundation, Microsoft, and the Gordon and Betty Moore Foundation.