Last updated on May 12, 2026.

netsse.analys.spec#

Functions to compute sea state parameters from wave spectra.

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#

spec1d_to_params(S, freq[, unit_freq, smooth_Tp])

Computes the main sea state parameters from a given 1-D wave spectrum.

spec2d_to_params(S2D, freq, theta[, unit_theta, ...])

Computes a set of overall parameters characterizing the sea state from the

spec2d_to_spread_dist(S2D, theta)

Converts the given 2-D wave spectrum into a directional spreading function

spread_dist_to_spec2d(Sf, D, theta)

Converts the given 1-D wave spectrum and directional spreading function

Module Contents#

netsse.analys.spec.spec1d_to_params(S, freq, unit_freq='rad/s', smooth_Tp=False)[source]#

Computes the main sea state parameters from a given 1-D wave spectrum.

Parameters:
  • S (array_like) – 1-D wave spectrum. If S has more than one dimension, then one axis must have a length Nfreq.

  • freq (array_like of shape (Nfreq,)) – Set of discretized frequencies.

  • unit_freq ({'rad/s','Hz'}, optional) –

    Unit of the frequencies:

    • ’rad/s’ :

      The variable freq denotes the circular frequencies in radians per second.

    • ’Hz’ :

      The 1-D wave spectrum is expressed as a function of frequency in Hertz.

  • smooth_Tp (bool, default False) – Specify whether the output Tp value should be smoothened by fitting a polynomial of order 3 in the vicinity of the spectral peak and estimating the peak period through the fitted polynomial.

Returns:

  • m (array_like of shape (6,…,)) – Spectral moments \([m_{-1},m_0,m_1,m_2,m_3,m_4]\).

  • Hm0 (float, or array_like) – Spectral significant wave height [m].

  • Tp (float, or array_like) – Peak wave period [s].

  • Tm01 (float, or array_like) – Mean wave period [s].

  • Tm02 (float, or array_like) – Zero up-crossing period [s].

  • Tm24 (float, or array_like) – Mean crest period [s].

  • TE (float, or array_like) – Mean energy period [s].

  • Sm02 (float, or array_like) – Significant wave steepness [-].

  • epsilon (float, or array_like) – Spectral bandwidth [-].

  • Qp (float, or array_like) – Goda’s peakedness parameter [-].

See also

spec2d_to_params

Computes a set of overall parameters characterizing the sea state from the 2-D wave spectrum.

Example

>>> m, Hm0, Tp, Tm01, Tm02, Tm24, TE, Sm02, epsilon, Qp =
...     spec1d_to_params(S,freq,unit_freq='rad/s',smooth_Tp=False)
netsse.analys.spec.spec2d_to_params(S2D, freq, theta, unit_theta='deg', smooth_peak=False)[source]#

Computes a set of overall parameters characterizing the sea state from the 2-D wave spectrum.

Parameters:
  • S2D (array_like of shape (...,Nf,Ntheta,...)) – Directional wave spectrum [m^2.s/unit_theta], as a function of frequency in Hertz and wave direction in specified unit (unit_theta).

  • freq (array_like of shape (Nf,)) – Vector of (discretized) wave frequencies [Hz] (must include \(f =\) 0 Hz).

  • theta (array_like of shape (Ntheta,)) –

    Vector of wave headings [the unit is specified in unit_theta].

    Attention

    theta must be in a wrapped format, i.e., corresponding to [0,360] deg.

  • unit_theta ({'deg','rad'}, optional) – Unit of the wave directions. This applies for the expression of the wave spectrum too. Can be 'deg' (for degrees), or 'rad' (for radians). 'deg' is the default.

  • smooth_peak (bool, optional) – Specify whether the output Tp and theta_p values should be smoothened by fitting a polynomial of order 3 in the vicinity of the spectral peak and estimating the peak period and direction through the fitted polynomial. The default is False.

Returns:

  • m (array_like of shape (6,)) – Spectral moments \([m_{-1},m_0,m_1,m_2,m_3,m_4]\).

  • Hm0 (float, or array_like) – Spectral significant wave height [m].

  • Tp (float, or array_like) – Peak wave period [s].

  • Tm01 (float, or array_like) – Mean wave period [s].

  • Tm02 (float, or array_like) – Zero up-crossing period [s].

  • Tm24 (float, or array_like) – Mean crest period [s].

  • TE (float, or array_like) – Mean energy period [s].

  • Sm02 (float, or array_like) – Significant wave steepness [-].

  • epsilon (float, or array_like) – Spectral bandwidth [-].

  • Qp (float, or array_like) – Goda’s peakedness parameter [-].

  • theta_p (float, or array_like) – Peak wave direction [deg].

  • theta_m (float, or array_like) – Mean overall wave direction [deg].

  • sigma_m (float, or array_like) – Mean directional spreading [deg].

See also

spec1d_to_params

Computes the main sea state parameters from a given 1-D wave spectrum.

Example

>>> m, Hm0, Tp, Tm01, Tm02, Tm24, TE, Sm02, epsilon, Qp, theta_p, theta_m, sigma_m =
...     spec2d_to_params(S2D, freq, theta, unit_theta='deg', smooth_peak=False)
netsse.analys.spec.spec2d_to_spread_dist(S2D, theta)[source]#

Converts the given 2-D wave spectrum into a directional spreading function and a 1-D wave spectrum.

Parameters:
  • S2D (array_like of shape (...,Nf,Ntheta,...)) – Directional wave spectrum, as a function of frequency and wave direction (with arbitrary units).

  • theta (array_like of shape (Ntheta,)) – Vector of wave headings (with arbitrary unit).

Returns:

  • Sf (array_like of shape (…,Nf,…)) – One-sided variance spectrum of the waves, as a function of frequency.

  • D (array_like of shape (…,Nf,Ntheta,…)) – Directional spreading function.

See also

spread_dist_to_spec2d

Converts the given 1-D wave spectrum and directional spreading function into a 2-D wave spectrum.

Example

>>> Sf, D = spec2d_to_spread_dist(S2D,theta)
netsse.analys.spec.spread_dist_to_spec2d(Sf, D, theta)[source]#

Converts the given 1-D wave spectrum and directional spreading function into a 2-D wave spectrum.

Parameters:
  • Sf (array_like of shape (...,Nf,...)) – One-sided variance spectrum of the waves, as a function of frequency.

  • D (array_like of shape (...,Nf,Ntheta,...)) – Directional spreading function.

  • theta (array_like of shape (Ntheta,)) – Vector of wave headings (with arbitrary unit).

Returns:

S2D – Directional wave spectrum, as a function of frequency and wave direction (with arbitrary units).

Return type:

array_like of shape (…,Nf,Ntheta,…)

See also

spec2d_to_spread_dist

Converts the given 2-D wave spectrum into a directional spreading function and a 1-D wave spectrum.

Example

>>> S2D = spread_dist_to_spec2d(Sf,D,theta)