Skip to main content

PyStormTracker

DOI

PyStormTracker provides the implementation of the "Simple Tracker" algorithm used for cyclone trajectory analysis in Yau and Chang (2020). It was originally developed at the National Center for Atmospheric Research (NCAR) as part of the 2015 Summer Internships in Parallel Computational Science (SIParCS) program, utilizing a task-parallel strategy with temporal decomposition and a tree reduction algorithm to process large climate datasets.

Features

  • Modern Python 3 Support: Fully migrated from Python 2 with comprehensive type hints.
  • Flexible Data Support: Works with netCDF4 and handles various coordinate naming conventions (lat/lon vs latitude/longitude).
  • Parallel Backends:
    • Dask (Default): Automatically scales to all available CPU cores on local machines.
    • MPI: Supports distributed execution via mpi4py.
    • Serial: Standard sequential execution for smaller datasets or debugging.
  • Robust Detection: Handles masked/missing data correctly and includes automated unit/integration tests.
  • User-Friendly Output: Results are exported directly to CSV with readable datetime strings and formatted numeric values.

Technical Methodology

PyStormTracker treats meteorological fields as 2D images and leverages scipy.ndimage for robust feature detection:

  • Local Extrema Detection: Uses generic_filter with a sliding window (default 5x5) to identify local minima (cyclones) or maxima (anticyclones/vorticity).
  • Intensity & Refinement: Applies the Laplacian operator (laplace) to measure the "sharpness" of the field at each detected center point. This is used to resolve duplicates and ensure only the most physically intense point is kept when multiple adjacent pixels are flagged.
  • Spherical Continuity: Utilizes mode='wrap' for all filters to correctly handle periodic boundaries across the Prime Meridian, enabling seamless tracking across the entire globe.
  • Heuristic Linking: Implements a nearest-neighbor linking strategy to connect detected centers into trajectories across successive time steps.

Installation

Prerequisites

  • Python 3.10+
  • (Optional) MS-MPI or OpenMPI for MPI support.

You can install the latest stable version of PyStormTracker directly from PyPI:

pip install PyStormTracker

From Source

  1. Clone the repository:

    git clone https://github.com/mwyau/PyStormTracker.git
    cd PyStormTracker
    
  2. Install the package in editable mode:

    pip install -e .
    

Usage

Once installed, you can use the stormtracker command directly:

stormtracker -i data/test/slp.2012.nc -v slp -o my_tracks

Command Line Arguments

Argument Short Description
--input -i Required. Path to the input NetCDF file.
--var -v Required. Variable name to track (e.g., slp, vo).
--output -o Required. Path to the output CSV file (appends .csv if missing).
--num -n Number of time steps to process.
--mode -m min (default) for low pressure, max for vorticity/high pressure.
--backend -b dask (default), serial, or mpi.
--workers -w Number of Dask workers (defaults to CPU core count).

Examples

Run with Dask (Auto-detected cores):

stormtracker -i input.nc -v slp -o tracks

Run with MPI (Distributed):

mpiexec -n 4 stormtracker -i input.nc -v slp -o tracks -b mpi

Project Structure

  • src/pystormtracker/models/: Data structures (Center, Grid, Tracks).
  • src/pystormtracker/simple/: Implementation of the Simple Tracker logic (SimpleDetector, SimpleLinker).
  • src/pystormtracker/stormtracker.py: CLI orchestration and parallel backends.

Testing

Run the full test suite (unit and integration tests) using pytest:

pytest

Citations

If you use this software in your research, please cite the following:

References

  • Yau, A. M. W., K. Paul and J. Dennis, 2016: PyStormTracker: A Parallel Object-Oriented Cyclone Tracker in Python. 96th American Meteorological Society Annual Meeting, New Orleans, LA. Zenodo, https://doi.org/10.5281/zenodo.18868625.

License

This project is licensed under the terms found in the LICENSE file.

Metadata

Release files for PyStormTracker 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PyStormTracker 0.2.2
File Size Uploaded Provenance Actions
pystormtracker-0.2.2.tar.gz 615.8 kB With provenance Details for pystormtracker-0.2.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for PyStormTracker 0.2.2
File Interpreter ABI Platform Actions
pystormtracker-0.2.2-py3-none-any.whl Python 3 none any Details for pystormtracker-0.2.2-py3-none-any.whl

Total release size: 629.8 kB

Release files / pystormtracker-0.2.2.tar.gz

Download URL pystormtracker-0.2.2.tar.gz
Size 615.8 kB
Tags Source
SHA-256 checksum
How to use checksums
731ef12c40a1409a3cba7f5f7d502221fcb708c3e5d6ce2b85f09d0325f2b3d5
BLAKE2b-256 checksum
How to use checksums
2a28a6c717b8d13df98ba729ca64c8ee7ae3f96ebe6655c0092f2272931b91e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 5, 2026.

Transparency log

Release files / pystormtracker-0.2.2-py3-none-any.whl

Download URL pystormtracker-0.2.2-py3-none-any.whl
Size 13.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bed0c2d200c6af043d76a313f11d73a7abd5d0ad03fbbfbebdc828cd9b552ce0
BLAKE2b-256 checksum
How to use checksums
03907bce8e18cf5179bb902ce90a37199302f3ce9d0ac46a284d475b5b5b00e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 5, 2026.

Transparency log

Security for PyStormTracker 0.2.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pystormtracker-0.2.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 5, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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