EWDM

Python toolkit for estimating directional wave spectra of ocean waves based on wavelet transform.
https://github.com/dspelaez/extended-wdm

Category: Hydrosphere
Sub Category: Waves and Currents

Keywords

adcps directional-spectrum spotter wavelets waves wavestaffs wdm

Last synced: about 17 hours ago
JSON representation

Repository metadata

Python toolkit for estimating directional wave spectra of ocean waves based on wavelet transform

README.md

Documentation Status
Python package
PyPI version
Binder
DOI
status

EWDM: Extended Wavelet Directional Method

Welcome to the GitHub repository for the Extended Wavelet Directional Method (EWDM) - a toolkit for estimating directional spectra of ocean waves using the Continuous Wavelet Transform (CWT).

This package implements the algorithms of the original WDM proposed by Donelan et al. (1985) that are suitable for spatially-distributed arrays of wave staffs; as well as the algorithms presented by Peláez-Zapata et al. (2024) for single-point triplets of wave-induced displacements, velocities, accelerations or slopes (see also Krogstad et al., 2006).

Therefore, EWDM allows the estimation of the directional wave spectrum for a variety of sources, including GPS-based buoys, pitch-roll-heave buoys, acoustic Doppler current profilers (ADCPs) and sampled points from stereo-imaging recordings.

Key features of the EWDM include:

  • Implementation of the wavelet-based algorithms for extracting directional
    information from wave time series.
  • Tools for processing and visualising directional wave data.
  • Powered by xarray labelled multi-dimensional arrays.
  • Helper functions to handle commonly used data sources such as
    Spotter buoys and
    CDIP.
  • Documentation, examples, and comparison with conventional methods.

Whether you are a researcher, student, or engineer in physical oceanography, EWDM provides a powerful, user-friendly toolkit for in-depth analysis of directional ocean wave spectra. We welcome contributions, feedback, and collaboration from the community to further enhance the capabilities of EWDM.

Getting Started

Installation

Stable release

You can install EWDM using pip. First, make sure you have Python 3.8 or higher installed.

pip install ewdm

This is the preferred method to install EWDM, as it will always install the most recent stable release.

If you don't have pip installed, these Python installation instructions can guide
you through the process.

From sources

The sources for EWDM can be downloaded from the Github repo.

You can either clone the public repository:

git clone git://github.com/dspelaez/extended-wdm

Or download the tarball:

curl -OJL https://github.com/dspelaez/extended-wdm/tarball/master

Once you have a copy of the source, you can install it with:

python setup.py install

Or using pip:

pip install .

Running tests

To install the necessary packages for development and testing, you can run the following command:

pip install -e '.[test]'

To run the tests, you can use the pytest framework by executing the following command:

pytest tests

Usage

After installation, you can import and use the ewdm package in your Python code:

import ewdm

Quick example

This example uses a CDIP buoy time series of wave-induced displacements to estimate the directional wave spectrum.

import numpy as np
import xarray as xr
from matplotlib import pyplot as plt

import ewdm
from ewdm.sources import CDIPDataSourceRealTime
from ewdm.plots import plot_directional_spectrum
plt.ion()

cdip =  CDIPDataSourceRealTime(166)
dataset = cdip.read_dataset(time_start='2024-06-09T08:30')
spec = ewdm.Triplets(dataset)
output = spec.compute()

fig, ax = plt.subplots()
plot_directional_spectrum(
    output["directional_spectrum"], ax=ax, levels=None
)

This will produce a plot like this:

Further examples

For a curated collection of examples, please refer to the Gallery in the documentation.

Related projects

Several tools complement the functionality of EWDM in the analysis of ocean
wave data. Some of the most relevant projects are:

  • WAFO provides advanced statistical
    and engineering analysis of wave fields and wave-induced loads.

  • FOWD offers a rich dataset of wave
    parameters tailored for machine learning applications. It also provides
    routines to compute frequently used wave parameters.

  • DIWASP implements classical
    Fourier-based methods for directional spectrum estimation.

  • Special mention to modern Python packages like
    wavespectra and
    oceanwaves-python, that
    support spectral data manipulation and visualization. While these tools do not
    estimate directional spectra from raw measurements, they can be integrated
    with EWDM to enhance wave data processing workflows.

How to cite this work

If you find this software useful, please cite it using the DOI: 10.21105/joss.07942 or copy the following bibtex entry:

@article{Pelaez-Zapata2025,
  doi = {10.21105/joss.07942},
  url = {https://doi.org/10.21105/joss.07942},
  year = {2025},
  publisher = {The Open Journal},
  volume = {10},
  number = {109},
  pages = {7942},
  author = {Daniel Peláez-Zapata and Frédéric Dias},
  title = {EWDM: A wavelet-based method for estimating directional spectra of ocean waves},
  journal = {Journal of Open Source Software}
}

How to contribute

EWDM is an open-source package and we welcome feedback and contributions.

You can open an issue in the GitHub issues page if you:

  • find a bug in the package;
  • need some new features;
  • want some supports;
  • show your own examples.

Please refer to the Contributing guide in the documentation for further information.

Citation (CITATION.cff)

cff-version: 1.2.0
title:
  EWDM: A wavelet-based method for estimating directional spectra of ocean waves
message: 'If you use this software, please cite it as below.'
type: software
authors:
  - family-names: Peláez-Zapata
    given-names: Daniel
    orcid: 'https://orcid.org/0000-0001-5862-6194'
    affiliation: ENS Paris-Saclay
  - family-names: Dias
    given-names: Frédéric
    orcid: 'https://orcid.org/0000-0002-5123-4929'
    affiliation: ENS Paris-Saclay
identifiers:
  - type: doi
    value: 10.21105/joss.07942
repository-code: 'https://github.com/dspelaez/extended-wdm'
url: 'https://extended-wdm.readthedocs.io/'
keywords:
  - ocean waves
  - wavelets
  - directional wave spectrum
version: 1.1
date-released: '2025-05-02'

Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 4 days ago

Total Commits: 122
Total Committers: 6
Avg Commits per committer: 20.333
Development Distribution Score (DDS): 0.533

Commits in past year: 122
Committers in past year: 6
Avg Commits per committer in past year: 20.333
Development Distribution Score (DDS) in past year: 0.533

Name Email Commits
Daniel Pelaez-Zapata d****a@e****r 57
Daniel Pelaez Zapata d****z@g****m 50
Daniel Pelaez-Zapata d****a@p****e 10
Romain Caneill r****l@e****g 3
yangleir y****r@q****m 1
miniufo m****o@1****m 1

Committer domains:


Issue and Pull Request metadata

Last synced: 3 days ago

Total issues: 14
Total pull requests: 6
Average time to close issues: 10 days
Average time to close pull requests: about 1 month
Total issue authors: 2
Total pull request authors: 3
Average comments per issue: 1.57
Average comments per pull request: 1.0
Merged pull request: 6
Bot issues: 0
Bot pull requests: 0

Past year issues: 14
Past year pull requests: 6
Past year average time to close issues: 10 days
Past year average time to close pull requests: about 1 month
Past year issue authors: 2
Past year pull request authors: 3
Past year average comments per issue: 1.57
Past year average comments per pull request: 1.0
Past year merged pull request: 6
Past year bot issues: 0
Past year bot pull requests: 0

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/dspelaez/extended-wdm

Top Issue Authors

  • rcaneill (12)
  • miniufo (2)

Top Pull Request Authors

  • yangleir (3)
  • rcaneill (2)
  • miniufo (1)

Top Issue Labels

Top Pull Request Labels


Dependencies

docs/requirements.txt pypi
  • sphinx ==7.3.7
  • sphinx-rtd-theme ==2.0.0
setup.py pypi
  • matplotlib *
  • numpy *
  • scipy *
  • tqdm *
  • xarray *

Score: 4.189654742026425