wavespectra.partition.partition.np_ptm2#

wavespectra.partition.partition.np_ptm2(spectrum, spectrum_smooth, freq, dir, wspd, wdir, dpt, agefac=1.7, wscut=0.3333, swells=3, ihmax=100)[source]#

PTM2 spectra partitioning on numpy arrays.

Parameters:
  • spectrum (-) – Wave spectrum array with shape (nf, nd).

  • spectrum_smooth (-) – Smoothed wave spectrum array with shape (nf, nd).

  • freq (-) – Wave frequency array with shape (nf).

  • dir (-) – Wave direction array with shape (nd).

  • wspd (-) – Wind speed.

  • wdir (-) – Wind direction.

  • dpt (-) – Water depth.

  • agefac (-) – Age factor.

  • wscut (-) – Wind sea fraction cutoff.

  • swells (-) – Number of swell partitions to compute, all detected if None.

  • ihmax (-) – Number of discrete spectral levels in WW3 Watershed code.

Returns:

Wave spectrum partitions sorted in decreasing order of Hs

with shape (np, nf, nd) with np indices 0 and 1 reserved for primary and secondary wind sea partitions and remaining ones for ordered swells.

Return type:

  • specpart (3darray)

Note

  • The smooth spectrum spectrum_smooth is used to define the watershed boundaries which are applied to the original spectrum.

  • The option in WW3 to leave secondary wind seas as separate partitions is not available as it makes it harder to distinguish them from swells in the output.