netsse.analys.spec.spec2d_to_params =================================== .. py:function:: netsse.analys.spec.spec2d_to_params(S2D, freq, theta, unit_theta='deg', smooth_peak=False) Computes a set of overall parameters characterizing the sea state from the 2-D wave spectrum. :param S2D: Directional wave spectrum [m^2.s/``unit_theta``], as a function of frequency in Hertz and wave direction in specified unit (``unit_theta``). :type S2D: array_like of shape (...,Nf,Ntheta,...) :param freq: Vector of (discretized) wave frequencies [Hz] (must include :math:`f =` 0 Hz). :type freq: array_like of shape (Nf,) :param theta: 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. :type theta: array_like of shape (Ntheta,) :param unit_theta: 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. :type unit_theta: {'deg','rad'}, optional :param smooth_peak: 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``. :type smooth_peak: bool, optional :returns: * **m** (*array_like of shape (6,)*) -- Spectral moments :math:`[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]. .. seealso:: :obj:`spec1d_to_params` Computes the main sea state parameters from a given 1-D wave spectrum. .. rubric:: 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_Tp=False)