wavespectra.partition.hanson_and_phillips_2001.combine_partitions_hp01#

wavespectra.partition.hanson_and_phillips_2001.combine_partitions_hp01(partitions, freq, dir, swells=None, kappa=0.4, zeta=0.65, angle_max=30.0, hs_min=0.0, noise_a=None, noise_b=0.0, combine_extra_swells=True)[source]#

Combine swell partitions according to Hanson and Phillips (2001).

Parameters:
  • partitions (-) – List of 2darray spectra partitions (m2/Hz/deg) with non-overlapping support, e.g. from a watershed algorithm.

  • freq (-) – Frequency array (Hz).

  • dir (-) – Direction array (deg).

  • swells (-) – Exact number of swell partitions to return, extra partitions are either combined or dropped depending on combine_extra_swells. All combined partitions returned if None.

  • kappa (-) – Spread factor in the peak separation criterion, HP01 eq 9.

  • zeta (-) – Peak minimum factor, the fraction of the smaller peak density the saddle point between two partitions must exceed for the partitions to be combined.

  • angle_max (-) – Maximum angle (deg) between partition mean directions for combining as per Hanson et al. (2009), disabled if None.

  • hs_min (-) – Minimum Hs of individual partitions, any partition below this value is merged onto its most connected neighbour. Hanson et al. (2009) used 0.2 m for open-ocean data, smaller values are appropriate in low-energy environments such as sheltered sites.

  • noise_a (-) – Factor A in HP01’s noise threshold eq 10, e <= A / (fp^4 + B). Disabled if None.

  • noise_b (-) – Factor B in HP01’s noise threshold eq 10.

  • combine_extra_swells (-) – If True and more than swells partitions remain after combining, merge the extra ones onto their closest neighbours; if False drop the smallest ones.

Returns:

List of combined partitions sorted by

descending total energy.

Return type:

  • combined_partitions (list)

Criteria for combining two adjacent partitions:
  • The saddle point between them exceeds zeta times the smaller peak, or

  • Their peaks are closer in (fx, fy) space than kappa times the spread of either partition (and within angle_max if specified).

Partitions failing the hs_min / noise thresholds are always merged onto their most connected (highest saddle) neighbour so that no energy is lost.