Last updated on Feb 20, 2026.

netsse.analys.enc_spec#

Functions to compute spectra in a body-fixed reference system.

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#

resp_spec_1d(f0, ws, TRF1, TRF2, fe, U, beta)

Computes a response cross-spectrum in both the absolute and encountered

resp_spec_2d(freq0, mu, ws0, beta_TRF, TRF1, TRF2, ...)

Computes a response cross-spectrum in the encounter-frequency domain, in a case of

Module Contents#

netsse.analys.enc_spec.resp_spec_1d(f0, ws, TRF1, TRF2, fe, U, beta)[source]#

Computes a response cross-spectrum in both the absolute and encountered frequency domains, in a case of long-crested seas.

Parameters:
  • f0 (array_like of shape (Nf0,1)) – Vector of absolute frequencies [Hz].

  • ws (array_like of shape (Nf0,1) in 1-D) – 1-D wave spectrum, as a function of (absolute) wave frequency f0 [Hz].

  • TRF1 (array_like of shape (Nf0,1)) – Transfer functions of two response components, as a function of frequency f0 [Hz].

  • TRF2 (array_like of shape (Nf0,1)) – Transfer functions of two response components, as a function of frequency f0 [Hz].

  • fe (array_like of shape (Nfe,1)) – Vector of encounter frequencies [Hz].

  • U (float) – Ship speed [m/s].

  • beta (float) – Ship heading, relative to the wave direction [deg].

Returns:

  • RspecAbs (array_like of shape (Nf0,1)) – Response spectrum, as a function of absolute wave frequency f0 [Hz].

  • RspecEnc (array_like of shape (Nfe,1)) – Response spectrum, as a function of encountered frequency fe [Hz].

See also

resp_spec_2d

Computes a response cross-spectrum in the encounter-frequency domain, in case of short-crested sea.

Example

>>> RspecAbs, RspecEnc = resp_spec_1d(f0,ws,TRF1,TRF2,fe,U,beta)
netsse.analys.enc_spec.resp_spec_2d(freq0, mu, ws0, beta_TRF, TRF1, TRF2, freqE, U, psi, conv='from', unit_freq='rad/s')[source]#

Computes a response cross-spectrum in the encounter-frequency domain, in a case of short-crested seas.

Note

This is a Python implementation of the algorithm given in Nielsen et al. (2021).

Parameters:
  • freq0 (array_like of shape (Nf0,)) – Vector of absolute frequencies, in which the wave spectrum and the transfer functions are expressed.

  • mu (array_like of shape (Nmu,)) – Vector of wave directions [deg], relative to North (in a NED-reference frame).

  • ws0 (array_like of shape (Nf0,Nmu) in 2-D) – 2-D wave spectrum, as a function of (absolute) wave frequency freq0 and wave direction mu [rad].

  • beta_TRF (array_like of shape (Nbeta,)) – Vector of relative wave headings [deg], in which the transfer functions are expressed.

  • TRF1 (array_like of shape (Nf0,Nbeta)) – Transfer function of the first and second response component, respectively, as a function of frequency freq0 and relative wave heading.

  • TRF2 (array_like of shape (Nf0,Nbeta)) – Transfer function of the first and second response component, respectively, as a function of frequency freq0 and relative wave heading.

  • freqE (array_like of shape (Nfe,)) – Vector of encounter frequencies for the output response spectrum.

  • U (float) – Ship speed [m/s]

  • psi (float) – Ship heading [deg], relative to North (in a NED-reference frame).

  • conv ({'from','to'}, optional) –

    The convention that is used to express the direction mu of wave spectrum:

    • ’from’ :

      The naval architecture convention, indicating where the waves are COMING FROM.

    • ’to’ :

      The oceanographic convention, indicating where the waves are GOING TO. The default is “from” direction.

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

    Unit of the frequencies:

    • ’rad/s’ :

      The variables freq0 and freqE denote the angular frequencies in radians per second.

    • ’Hz’ :

      The 2-D wave spectrum ws0 is expressed as a function of frequency in Hertz. The default is ‘rad/s’.

Returns:

RspecEnc – Response spectrum, as a function of encounter frequency freqE.

Return type:

array_like of shape (Nfe,)

See also

resp_spec_1d

Computes a response cross-spectrum in both the absolute and encountered frequency domains, in a case of long-crested seas.

References

Nielsen, U. D., Mounet, R. E. G., & Brodtkorb, A. H. (2021). Tuning of transfer functions for analysis of wave-ship interactions. Marine Structures, 79, 103029. https://doi.org/10.1016/j.marstruc.2021.103029

Example

>>> RspecEnc =
...     resp_spec_2d(freq0,mu,ws0,beta_TRF,TRF1,TRF2,freqE,U,psi,'from','rad/s')