wavespectra.partition.partition.np_hp01#
- wavespectra.partition.partition.np_hp01(spectrum, spectrum_smooth, windseamask, freq, dir, wscut=0.3333, swells=3, kappa=0.4, zeta=0.65, angle_max=30, hs_min=0.2, noise_a=None, noise_b=0.0, ihmax=100, combine_extra_swells=True)[source]#
Hanson and Phillips 2001 spectra partitioning on numpy arrays.
The spectrum is partitioned with the watershed algorithm, wind sea partitions are identified by the wind sea fraction criterion and combined into partition 0 as in the PTM1 method, and adjacent swell partitions belonging to the same wave system are combined following the criteria in Hanson and Phillips (2001) and Hanson et al. (2009).
- Parameters:
spectrum (-) – Wave spectrum array with shape (nf, nd).
spectrum_smooth (-) – Smoothed wave spectrum array with shape (nf, nd).
windseamask (-) – Wind-sea mask array with shape (nf, nd).
freq (-) – Wave frequency array with shape (nf).
dir (-) – Wave direction array with shape (nd).
wscut (-) – Wind sea fraction cutoff.
swells (-) – Number of swell partitions to compute, all detected by default.
kappa (-) – Spread factor in the peak separation criterion of Hanson and Phillips (2001)’s eq 9, larger values combine more partitions.
zeta (-) – Peak minimum factor, the fraction of the smaller peak density that the saddle point between two partitions must exceed for the partitions to be combined, smaller values combine more partitions.
angle_max (-) – Maximum angle (deg) between partition mean directions for combining partitions as per Hanson et al. (2009), disabled if None.
hs_min (-) – Minimum Hs of swell partitions, smaller ones are always combined with their most connected neighbours regardless of other criteria being satisfied. The default of 0.2 m follows Hanson et al. (2009) and is appropriate for open-ocean data, consider reducing it in low-energy environments such as sheltered sites so genuine small wave systems are not combined.
noise_a (-) – Factor A in Hanson and Phillips (2001)’s noise threshold eq 10, e <= A / (fp^4 + B), partitions with total energy below this threshold are treated as noise and merged onto their most connected neighbours. Disabled if None.
noise_b (-) – Factor B in Hanson and Phillips (2001)’s eq 10.
ihmax (-) – Number of discrete spectral levels in WW3 Watershed code.
combine_extra_swells (-) – If True and more swell partitions remain after combining than the number requested in the swells argument, merge each extra swell with its closest neighbour until the requested number is achieved. If False, the smallest extra swells are excluded from the output.
- Returns:
- Wave spectrum partitions with shape (np, nf, nd)
where the 0th index is the wind sea and the remaining indices are the swells sorted in decreasing order of Hs.
- Return type:
specpart (3darray)
Note
The smooth spectrum spectrum_smooth is used to define the watershed boundaries which are applied to the original spectrum.
Spectral variance is conserved unless combine_extra_swells is False and there are more combined swells than requested.