netsse.analys.emep#
Python implementation of the EMEP algorithm, used for analyzing directional wave spectra from field data.
Copyright (C) 2023-2026 Technical University of Denmark, R.E.G. Mounet
This code is part of the NetSSE software.
NetSSE is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
NetSSE is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.
To credit the author, users are encouraged to use below reference:
Mounet, R. E. G., & Nielsen, U. D. NetSSE: An open-source Python package
for network-based sea state estimation from ships, buoys, and other
observation platforms (version 2.2). Technical University of Denmark,
GitLab. February 2026. https://doi.org/10.11583/DTU.26379811.
Last updated on 20-02-2026 by R.E.G. Mounet
Functions#
|
Applies the Extended Maximum Entropy Principle (EMEP) method to reconstruct the directional |
|
Normalizes the directional spreading function. |
|
Normalizes the response spectra and transfer functions for application of the EMEP method. |
Module Contents#
- netsse.analys.emep.emep(Sxyn, Hn, theta, fi, k, opt=None)[source]#
Applies the Extended Maximum Entropy Principle (EMEP) method to reconstruct the directional spreading function based on the cross-power spectra of measured wave-induced responses.
Note
This implementation is based on the functions EMEP in the DIWASP toolbox and EMEM in the WAFO toolbox.
- Parameters:
Sxyn (ndarray of shape (nf,m*m), where nf is the number of frequencies and m is the number of sensors) â
Real and imaginary parts of the normalised cross-power spectral density:
Sxyn(f,i) = Re(Smn(f)/(Szeta(f)*Wmn(f)))or the imaginary (Im(.)) counterpart.Hn (ndarray of shape (nt,nf,m*m), where nt is the number of theta values) â
Matrix of the real and imaginary parts of the normalised RAO products, in the same order of response pairs as for
Sxyn:Hn(theta,f,i) = Re(Phi_m(theta,f)*conj(Phi_n(theta,f))/Wmn(f))or the imaginary (Im(.)) counterpart.theta (ndarray of shape (nt,)) â
Vector of wave headings.
Warning
The wave heading must be in a wrapped format, corresponding to [0,360] deg. For ship responses, those headings must be the relative wave headings.
fi (ndarray of shape (nf,)) â Frequency vector.
k (array_like) â List of indices corresponding to frequencies where the wave power spectral density is substantially greater than zero.
opt (dict, optional) â
Optional parameters controlling the EMEM calculation. Available options are:
- âerrortolâfloat, default 0.0005
Error tolerance for convergence.
- âmaxiterâint, default 25
Maximum number of iterations for the Newton-Raphson method.
- ârelaxâfloat, default 1
Relaxation parameter for controlling step shape in optimization.
- âmaxcoefâfloat, default 10000
Maximum value for coefficients to prevent divergence.
- âcoefabstolâfloat, default 0.01
Coefficient absolute tolerance for convergence.
- âminmodelorderâint, default 1
Minimum model order for AIC evaluation.
- âmaxmodelorderâint, default M/2 + 1
Maximum model order for AIC evaluation.
- âdiradjustâfloat, default 0
Deviation term to adjust the wave directions to other direction conventions.
Warning
For ship responses, a value of \(-\pi/2\) was necessary to use:
opt = {'diradjust': numpy.pi/2}.
- âmessageâ{0,1}
Display messages during the calculation.
- Returns:
D â Estimated directional spreading distribution matrix of shape (nt, nf).
- Return type:
ndarray
See also
norm_respNormalizes the response spectra and transfer functions.
norm_DSFNormalizes the directional spreading function.
netsse.analys.buoy.Shannon_MEMII_NewtonReconstructs the directional spreading function based on the first four Fourier coefficients of a directional wave spectrum.
References
Hashimoto, N. (1997). âAnalysis of the directional wave spectra from field data.â Advances in Coastal and Ocean Engineering, Vol.3., pp.103-143.
DIWASP, a directional wave spectra toolbox for MATLAB: User Manual. Research Report WP-1601-DJ (V1.1), Centre for Water Research, University of Western Australia.
Brodtkorb, P.A., Johannesson, P., Lindgren, G., Rychlik, I., RydĂ©n, J. and Sö, E. (2000). âWAFO - a Matlab toolbox for analysis of random waves and loadsâ, Proc. 10th Int. Offshore and Polar Eng. Conf., Seattle, USA, Vol III, pp. 343-350.
Example
>>> D = emep(Sxyn, Hn, theta, fi, k, opt=None)
- netsse.analys.emep.norm_DSF(D, theta)[source]#
Normalizes the directional spreading function.
The function ensures that the output has a unit integral over wave directions.
- Parameters:
D (array_like of shape (nt,nf)) â Directional spreading function.
theta (array_like of shape (nt,)) â Vector of wave directions.
- Returns:
Dn â Normalized spreading function.
- Return type:
array_like of shape (nt,nf)
Example
>>> Dn = norm_DSF(D, theta)
- netsse.analys.emep.norm_resp(Rxy_ReIm, TRF, S1D, f, mn=None, ReIm=None, Na=None, axy=None)[source]#
Normalizes the response spectra and transfer functions for application of the EMEP method.
Note
The normalization factors are found in Bendat & Piersol (2010).
- Parameters:
Rxy_ReIm (array_like of shape (Nfreq,Nxy)) â Response spectra as a function of frequency
f, considering Nxy pairs of responses.TRF (Multidimensional array of shape (Nresp,Ntheta,Nfreq)) â Transfer functions for Nresp different responses, as functions of wave direction and frequency
f.S1D (array_like of shape (Nfreq,)) â 1-D wave spectrum, as a function of frequency
f.f (array_like of shape (Nfreq,)) â Vector of wave frequencies.
mn (array_like of shape (Nxy,2), optional) â
Definition of the considered responses in
Rxy_ReIm. Elements inmncorrespond to the indices of the pairs of responses along the first dimension ofTRF, i.e., from 0 to Nresp-1. Default isNone; in that case, the response pairs are ordered in the following order (illustrated for Nresp = 3):Rxy_ReIm = [Re(R00),Re(R11),Re(R22),Re(R01),Re(R02),Re(R12),Im(R01),Im(R02),Im(R12)]mn = [[0, 0], [1, 1], [2, 2], [0, 1], [0, 2], [1, 2], [0, 1], [0, 2], [1, 2]]ReIm (array_like of shape (Nxy,) or (Nxy,1), optional) â
Vector indicating whether the real part (
'R') or imaginary part ('I') of the response cross-spectrum is considered inRxy_ReIm. Default isNone; in that case, the real and imaginary parts of the response pairs are ordered in the order shown above, thus:ReIm = ['R', 'R', 'R', 'R', 'R', 'R', 'I', 'I', 'I']Na (str, or array_like of shape (Nxy,), optional) â Number of the ensembled average for computation of the response spectra variance. Default is
None, for which caseNa = 1.axy (array_like of shape (Nxy,), optional) â Additional weights (must be positive). Any weight greater than zero increases the importance given to a corresponding pair of responses in the EMEP method. Default is
None, for which case the weights are set to zero.
- Returns:
Rxy_ReIm_n (array_like of shape (Nfreq,Nxy)) â Normalized version of the response spectra.
Hn (array_like of shape (Ntheta,Nfreq,Nxy)) â Normalized version of the real and imaginary parts of the product of the transfer functions for pairs of responses. The real and imaginary parts for the pairs of responses are output in the same order as
Rxy_ReIm.
See also
emepExtended Maximum Entropy Principle (EMEP) method for reconstructing the directional spreading function based on the cross-power spectra of measured wave-induced responses.
References
Bendat, J. S., & Piersol, A. G. (2010). Random Data: Analysis and Measurement Procedures. In Measurement Science and Technology (Vol. 11, Issue 12). Wiley. https://doi.org/10.1002/9781118032428
Example
>>> Rxy_ReIm_n, Hn = norm_resp(Rxy_ReIm,TRF,S1D,f,mn=None,ReIm=None,Na=None,axy=None)