wavespectra.partition.partition.np_hp01#
- wavespectra.partition.partition.np_hp01(spectrum, spectrum_smooth, windseamask, freq, dir, wscut=0.3333, swells=3, k=0.5, angle_max=30, hs_min=0.2, ihmax=100, combine_extra_swells=True)[source]#
Hanson and Phillips 2001 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).
windseamask (2darray): Wind-sea mask array with shape (nf, nd).
freq (1darray): Wave frequency array with shape (nf).
dir (1darray): Wave direction array with shape (nd).
wscut (float): Wind sea fraction cutoff.
swells (int): Number of swell partitions to compute, all detected by default.
k (float): Spread factor in Hanson and Phillips (2001)’s eq 9.
angle_max (float): Maximum relative angle for combining partitions.
hs_min (float): Minimum Hs of swell partitions, smaller partitions are always combined with closest ones regardless of minimum distance and angle criteria.
combine_extra_swells (bool): If True and the number of swells partitions from the Hanson and Phillips 2001 algorithm is greater than the requested number given in the swells argument, merge each extra swell with its closest neighbour until the requested number is achieved. If False, extra swells are ignored from the output.
- Returns:
specpart (3darray): Wave spectrum partitions sorted in decreasing order of Hs with shape (np, nf, nd).
- Note:
The smooth spectrum spectrum_smooth is used to define the watershed boundaries which are applied to the original spectrum.
The combine option ensures spectral variance is conserved but could yields multiple peaks into single partitions.