Skip to main content

Marine Extremes Detection and Tracking

Project description

logo

CI codecov PyPI version Documentation Status PyPI Downloads DOI

Marine Extremes Detection and Tracking

Efficient & scalable marine extremes detection, identification, & tracking for exascale climate data.

marEx is a high-performance Python framework for identifying and tracking extreme oceanographic events (such as Marine Heatwaves or Acidity Extremes) in massive climate datasets. Built on advanced statistical methods and distributed computing, it processes decades of daily-resolution global ocean data with unprecedented efficiency and scalability.


Key Features

  • โšก Extreme Performance: Process 100+ years of high-resolution daily global data in minutes
  • ๐ŸŒ Universal Grid Support: Native support for both regular (lat/lon) grids and unstructured ocean models
  • ๐Ÿ“ˆ Advanced Event Tracking: Handles coherent object splitting, merging, and evolution
  • ๐Ÿ“Š Multiple Detection Methods: Scientifically rigorous algorithms for robust extreme event identification
  • โ˜๏ธ Cloud-Native Scaling: Identical codebase scales from laptop to supercomputer using up to 1024+ cores
  • ๐Ÿง  Memory Efficient: Intelligent chunking and lazy evaluation for datasets larger than memory

https://github.com/user-attachments/assets/501537ff-5adb-4e13-ba08-6a333bac2a02

marEx_front


Quick Start

import xarray as xr
import marEx

# Load sea surface temperature data
sst = xr.open_dataset('sst_data.nc', chunks={'time': 30}).sst

# Identify extreme events
extreme_events_ds = marEx.preprocess_data(
    sst,
    threshold_percentile=95,
    method_anomaly='shifting_baseline',
    method_extreme='hobday_extreme'
)

# Track events through time
events_ds = marEx.tracker(
    extreme_events_ds.extreme_events,
    extreme_events_ds.mask,
    R_fill=8,
    area_filter_absolute=100,
    allow_merging=True
).run()

# Visualise results
fig, ax, im = (events_ds.ID_field > 0).mean("time").plotX.single_plot(
    marEx.PlotConfig(var_units="MHW Frequency", cmap="hot_r", cperc=[0, 96])
)

Installation

pip install marEx[full,hpc]

For detailed installation instructions, including HPC environments and optional dependencies, see the Installation Guide.


Core Workflow

marEx follows a three-stage pipeline:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  1. Detect      โ”‚  โ†’   โ”‚  2. Track       โ”‚  โ†’   โ”‚  3. Visualise   โ”‚
โ”‚    Extremes     โ”‚      โ”‚    Events       โ”‚      โ”‚     & Analyse   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
        โ†“                        โ†“                        โ†“
preprocess_data()           tracker()                  plotX()
        โ†“                        โ†“                        โ†“
Binary extreme map        Tracked objects          Maps, animations,
                            with unique IDs           & statistics

Learn more: Core Concepts | User Guide


Documentation

For detailed guides, tutorials, and API reference, visit the full documentation:

๐Ÿ“š marEx Documentation on ReadTheDocs

Quick Links:

  • Quickstart Guide - Get started in 5 minutes
  • Why marEx? - Learn about the unique capabilities
  • Core Concepts - Understanding marEx's design and workflow
  • User Guide - Comprehensive usage guide with method selection, parameter tuning, and performance optimisation
  • API Reference - Complete function documentation
  • Examples - Jupyter notebooks for gridded, regional, and unstructured data
  • Troubleshooting - Common issues and solutions

Examples

Explore complete workflows in the example notebooks:

  • Gridded Data: Standard analysis for regular lat/lon grids (satellite data, CMIP6 models)
  • Regional Data: Regional analysis with boundary handling (EURO-CORDEX)
  • Unstructured Data: Analysis for irregular meshes (FESOM, ICON-O, MPAS-Ocean)

Each example demonstrates the full pipeline from preprocessing to visualisation.


Key Capabilities

Detection Methods

marEx provides multiple scientifically rigorous methods for anomaly calculation and extreme identification:

Anomaly Detection:

  • Shifting Baseline: Rolling climatology (most accurate, research standard)
  • Detrend Fixed Baseline: Polynomial detrending + fixed climatology (preserves full time series)
  • Fixed Baseline: Simple daily climatology (trend-inclusive)
  • Harmonic Detrending: Fast polynomial + harmonic model (efficient screening)

Extreme Identification:

  • Hobday Method: Day-of-year specific thresholds with spatial window extension (literature standard, Hobday et al. 2016)
  • Global Method: Single threshold across time (fast, exploratory analysis)

โ†’ Learn more about method selection

Advanced Tracking

  • Morphological Operations: Fill spatial gaps and smooth event boundaries
  • Temporal Gap Filling: Maintain event continuity across short interruptions
  • Merge/Split Handling: Track event genealogy with improved nearest-neighbor partitioning
  • Area Filtering: Remove spurious small events with percentile or absolute thresholds

โ†’ Explore tracking algorithms

Performance & Scalability

  • Dask-First Architecture: Parallel computation with automatic memory management
  • JAX Acceleration: Optional GPU/TPU support for 10-50ร— speedup
  • HPC Integration: SLURM cluster support for supercomputing environments
  • Memory Optimisation: Process datasets 100-1000ร— larger than available RAM

โ†’ Performance tuning guide


Getting Help

Support Channels

Reporting Issues

When reporting issues, please include:

  • marEx version (marEx.__version__)
  • Python version and operating system
  • Dependency status (marEx.print_dependency_status())
  • Minimal reproducible example
  • Full error traceback

Citation

When using marEx in publications, please cite:


Funding

This project has received funding through:

  • The EERIE (European Eddy-Rich ESMs) Project
  • The European Union's Horizon Europe research and innovation programme under Grant Agreement No. 101081383
  • The Swiss State Secretariat for Education, Research and Innovation (SERI) under contract #22.00366

Contact

For questions, comments, or collaboration opportunities, please contact Aaron Wienkers.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

marex-4.0.tar.gz (11.4 MB view details)

Uploaded Source

Built Distribution

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

marex-4.0-py3-none-any.whl (112.8 kB view details)

Uploaded Python 3

File details

Details for the file marex-4.0.tar.gz.

File metadata

  • Download URL: marex-4.0.tar.gz
  • Upload date:
  • Size: 11.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for marex-4.0.tar.gz
Algorithm Hash digest
SHA256 bb1baf78ddf2022972eaa67c86897ffe8a7bcf2407d2f260b8597185670a6509
MD5 31ee7bb3cd9b4854c1bd5c6347b7aed9
BLAKE2b-256 a7d54af2ba32a8b847efdc5373e9672eb6c03e468a93aa355f0ea31d5ab0a495

See more details on using hashes here.

Provenance

The following attestation bundles were made for marex-4.0.tar.gz:

Publisher: release.yml on wienkers/marEx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file marex-4.0-py3-none-any.whl.

File metadata

  • Download URL: marex-4.0-py3-none-any.whl
  • Upload date:
  • Size: 112.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for marex-4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4f86c9747c0332eff7f3519fd1b7102579d6cd60334bef4a0f489d0295b2aa39
MD5 6f5866abd999557c7763ce086b6b6355
BLAKE2b-256 69227ecf31ea590d9292c77ff2f07abe14a15415a35c70c5d56cd36444e62f36

See more details on using hashes here.

Provenance

The following attestation bundles were made for marex-4.0-py3-none-any.whl:

Publisher: release.yml on wienkers/marEx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page