Skip to main content

topsocnww3sp

Actions Status Documentation Status PyPI version Conda-Forge PyPI platforms GitHub Discussion Coverage

Python library to co-localize Sentinel-1 OCN Level-2 OSW (Ocean Swell Wave) products with WW3 (WaveWatch III) spectral data.

Table of Contents

Overview

The topsocnww3sp package provides tools to associate Sentinel-1 OSW (Ocean Swell Wave) data with WW3 (WaveWatch III) wave model spectra. The co-localization can be performed using different matching strategies depending on the scientific use case.

Features

  • Multiple matching modes:

    • 1to1: One-to-one matching (closest WW3 point per SAR tile)
    • unique: Multiple SAR tiles can share the same WW3 point (pointer array)
    • many: Many-to-many mapping table (all matches within radius)
    • lasso: All WW3 points within buffered SAR subswath footprint
  • Multi-grid WW3 support: Handles IRI configuration with Arctic, Antarctic and mid-latitude grids

  • CF-compliant NetCDF output: L2C products with full metadata and provenance tracking

  • Interactive visualization: GIF animations and static maps for validation

  • SAR SAFE processing: Process entire SAFE directories (all subswaths IW1/IW2/IW3 or EW1..EW5) in one run

Installation

From PyPI

pip install topsocnww3sp

From Conda-Forge

conda install -c conda-forge topsocnww3sp

For development

git clone https://github.com/umr-lops/topsocnww3sp.git
cd topsocnww3sp
pip install -e ".[dev]"

Configuration

Create a config.yml file with the following structure:

# WW3 data directory
directory_ww3spectra_output: /path/to/ww3/data

# Temporal and spatial thresholds
TIME_THRESHOLD_MINUTES: 30
DISTANCE_THRESHOLD_KM: 20
BUFFER_DEG: 0.1

# Product version (will be appended to output filename)
product_version: "v1.0"

# Multi-grid WW3 configuration (for IRI grids)
ww3_grids:
  arctic:
    pattern: "ARC-*/YYYY-*/TRACK_NC/WW3-ARC-*_*_trck.nc"
  antarctic:
    pattern: "ANTARC-*/YYYY-*/TRACK_NC/WW3-ANTARC-*_*_trck.nc"
  midlatitude:
    pattern: "IRIGLOB-*/YYYY-*/TRACK_NC/WW3-IRIGLOB-*_*_trck.nc"

Usage

Command Line Interface

SAFE directory processing (all subswaths)

procl2c \
  --ocn-safe /path/to/S1A_IW_OCN__2SDV_*.SAFE \
  --config config.yml \
  --mode lasso \
  --output-dir ./output \
  --overwrite

Modes of Operation

Mode Description Output Structure
1to1 Closest WW3 point per SAR tile WW3_{group} with dimension all_tiles
unique Multiple SAR tiles can share WW3 point Pointer array in MATCH_MAP
many All WW3 points within distance threshold Pair table with sar_index and ww3_index
lasso All WW3 points within buffered footprint. Default mode. Single WW3 group per subswath, no MATCH_MAP

Output Structure

For a SAFE directory, the output files are organized as:

output/
└── YYYY/
    └── MM/
        └── DD/
            └── SAFE_NAME/
                ├── s1a-iw1-osw-..._v1.0.nc
                ├── s1a-iw2-osw-..._v1.0.nc
                └── s1a-iw3-osw-..._v1.0.nc

Each output NetCDF file contains:

  • SAR_intraburst group: Original SAR OSW data
  • SAR_interburst group: Interburst SAR data
  • WW3 group: Filtered WW3 spectra (lasso mode)
  • MATCH_MAP group: Association table (other modes)

Visualization Tools

Interactive GIF animation

python scripts/l2c_map_gif.py \
  --l2c-file /path/to/L2C_lasso.nc \
  --tile 10 \
  --output colocation.gif

Static maps for SAFE validation

python scripts/l2c_map_safe.py \
  --safe-dir /path/to/SAFE \
  --output-dir ./maps \
  --tile-zoom 8

Generated maps:

  • Map 1: SAR intraburst tiles only
  • Map 2: SAR intraburst + interburst tiles
  • Map 3: SAR tiles + WW3 spectra positions

Testing

# Run all tests
pytest

# Run with coverage
pytest --cov=topsocnww3sp

# Run specific test
pytest tests/test_l2c_processor.py

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Run pre-commit hooks: pre-commit run --all-files
  4. Submit a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Citation

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

@software{topsocnww3sp,
  author = {Grouazel, Antoine},
  title = {topsocnww3sp: Sentinel-1 OSW and WW3 co-localization},
  year = {2024},
  url = {https://github.com/umr-lops/topsocnww3sp}
}

Acknowledgments

  • Ifremer / LOPS laboratory
  • ESA for Sentinel-1 data
  • WW3 model developers

Metadata

Release files for topsocnww3sp 2026.6.3.post3

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

Source distribution (sdist)

Source distribution for topsocnww3sp 2026.6.3.post3
File Size Uploaded
topsocnww3sp-2026.6.3.post3.tar.gz 56.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for topsocnww3sp 2026.6.3.post3
File Interpreter ABI Platform
topsocnww3sp-2026.6.3.post3-py3-none-any.whl Python 3 none any Details

Total release size: 110.0 kB

Release files / topsocnww3sp-2026.6.3.post3.tar.gz

Download URL topsocnww3sp-2026.6.3.post3.tar.gz
Size 56.5 kB
Tags Source
SHA-256 checksum
How to use checksums
9235b6924c99226b6412c5c3598ff73220c448c698a892ff096b7c30cf7ae1e2
BLAKE2b-256 checksum
How to use checksums
69b815eb1920c181cd673028ab712e658341a15dd1c202418ec6cc5bbd0636f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 3, 2026.

Transparency log

Release files / topsocnww3sp-2026.6.3.post3-py3-none-any.whl

Download URL topsocnww3sp-2026.6.3.post3-py3-none-any.whl
Size 53.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
792f01ace9edc45b52be8cdcdcfb67c6cee848f4ad8cf4068c830998f885e040
BLAKE2b-256 checksum
How to use checksums
639b862acac5b1ac9210b465a25d0f881731d95c2600011c8b3c440bca4cc4d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 3, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2026.6.3.post3 This release

2 release 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