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.

Args:
  • spectrum (2darray): Wave spectrum array with shape (nf, nd).

  • spectrum_smooth (2darray): Smoothed wave spectrum array with shape (nf, nd).

  • freq (1darray): Wave frequency array with shape (nf).

  • dir (1darray): Wave direction array with shape (nd).

  • wspd (float): Wind speed.

  • wdir (float): Wind direction.

  • dpt (float): Water depth.

  • agefac (float): Age factor.

  • wscut (float): Wind sea fraction cutoff.

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

  • ihmax (int): Number of discrete spectral levels in WW3 Watershed code.

Returns:
  • specpart (3darray): 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.

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.