wavespectra.partition.tracking.match_consecutive_partitions#

wavespectra.partition.tracking.match_consecutive_partitions(fp, dpm, dfp_max, dfp_min, ddpm_max)[source]#

Match partitions of consecutive spectra based on evolution of peak frequency and peak direction.

Candidate pairs within the thresholds are assigned in ascending order of their normalised distance in frequency-direction space so that the closest pairs are always matched first, independently of partition ordering.

Parameters:
  • fp (np.ndarray) – Array containing the peak wave frequency for all partitions and the two consecutive time steps. Shape (npartitions, 2).

  • dpm (np.ndarray) – Array containing the mean peak wave direction for all partitions and the two consecutive time steps. Shape (npartitions, 2).

  • dfp_max (np.ndarray) – Maximum (most positive) delta fp for a match onto each partition of the previous time step, shape (npartitions,).

  • dfp_min (np.ndarray) – Minimum (most negative) delta fp for a match onto each partition of the previous time step, shape (npartitions,).

  • ddpm_max (np.ndarray) – Maximum absolute delta dpm for a match onto each partition of the previous time step, shape (npartitions,).

Returns:

matches – Array of matches between partitions of consecutive spectra. The value in the nth position contains the partition number in the previous time step that matches the partition number n in the current time step. -999 is for nans and -888 is for partitions that have no match.

Return type:

np.ndarray