Skip to main content

Wave Spectra Partitioning - Watershed algorithm for ocean wave spectra

Project description

WASP - WAve Spectra Partitioning

Watershed Algorithm for partitioning ocean wave spectra from model and observation

PyPI version Python Version

📋 What is WASP?

WASP focuses exclusively on spectral partitioning - the process of separating ocean wave spectra into individual wave systems (partitions) via watershed algorithm. Each partition represents a distinct wave system characterized by significant wave height (Hs), peak period (Tp), and direction (Dp).

WASP handles:

  • ✅ Spectral partitioning using watershed algorithm
  • ✅ Processing SAR (Sentinel-1 and CFOSAT), NDBC and WW3 model spectra
  • ✅ Extracting wave parameters (Hs, Tp, Dp) for each partition

🚀 Installation

⚠️ IMPORTANT: Python 3.10 or higher is required.

Install from PyPI (Recommended)

pip install wasp-ocean

Verify Installation

# Test the import
python -c "import wasp; print(f'WASP version: {wasp.__version__}')"

# Test main functions
python -c "from wasp import partition_spectrum, calculate_wave_parameters; print('✓ Installation successful!')"

Development Installation

For development or local modifications:

# Clone the repository
git clone https://github.with/jtcarvalho/wasp.git
cd wasp

# Install in editable mode
pip install -e .

📦 Key Dependencies

  • Python >= 3.10 (required)
  • NumPy >= 2.1.0 (required for np.trapezoid)
  • pandas >= 2.2.0
  • xarray >= 2024.11.0
  • matplotlib >= 3.8.0
  • scipy >= 1.14.0
  • scikit-image >= 0.22.0
  • netCDF4 >= 1.5.4

⚠️ Note: NumPy < 2.1.0 will cause errors as np.trapezoid is not available.

📚 Documentation

For detailed usage examples and API documentation, please see the examples/ directory in the repository:

  • 01_partition_sar.py: Process SAR (Sentinel-1) spectra
  • 02_partition_ww3.py: Process WaveWatch III model spectra
  • 03_partition_ndbc.py: Template for processing NDBC buoy data
  • 04_validatete.py: Compare and validatete SAR vs WW3 results

🏗️ Project Structure

wasp/
├── src/
│   └── wasp/              # Main package
│       ├── partition.py   # Watershed partitioning algorithm
│       ├── wave_params.py # Wave parameter calculations
│       ├── io_sar.py      # SAR Sentinel data I/O
│       ├── io_cfosat.py   # SAR CFOSAT data I/O
│       ├── io_ww3.py      # WW3 data I/O
│       ├── io_ndbc.py     # NDBC data I/O
│       └── utils.py       # Utility functions
└── examples/              # Usage examples

📄 License

This project is licensed under the MIT License.

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📧 Contact

For questions or issues, please open an issue on GitHub.

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

wasp_ocean-1.0.1.tar.gz (32.6 kB view details)

Uploaded Source

Built Distribution

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

wasp_ocean-1.0.1-py3-none-any.whl (35.6 kB view details)

Uploaded Python 3

File details

Details for the file wasp_ocean-1.0.1.tar.gz.

File metadata

  • Download URL: wasp_ocean-1.0.1.tar.gz
  • Upload date:
  • Size: 32.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for wasp_ocean-1.0.1.tar.gz
Algorithm Hash digest
SHA256 f939fb5b8228a9ec5d14d17203a9c1415e0c2f358e5dbfdee6a0a29f3889fb82
MD5 65f8a311a0fc3e2e815b272280d1dfde
BLAKE2b-256 b3c0746f05f7eeb6d1d790cb2a3c242f743ffd5d1e3bca836f9f57f27de48e93

See more details on using hashes here.

File details

Details for the file wasp_ocean-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: wasp_ocean-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 35.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for wasp_ocean-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d6cbbeab365dbff24dd975b218f670f34eee45e7037d49a6c00f8f61fd05e839
MD5 96c898a99faf8a31479e305a3a8ad777
BLAKE2b-256 8da48abd211b6cfee694e745140955505bea19f02ec977383d026fc40ac8d115

See more details on using hashes here.

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