wavespectra.partition.tracking.track_partitions#

wavespectra.partition.tracking.track_partitions(stats, wspd=None, ddpm_sea_max=30, ddpm_swell_max=20, dfp_sea_scaling=1, dfp_swell_source_distance=1000000.0, nsea=1)[source]#

Track partitions in a series of consecutive spectra based on the evolution of peak frequency and peak direction. Partitions are matched with the closest partition in the frequency-direction space of the previous time step for which the difference in direction with less than ddpm_max and the difference in peak frequency is less than dfp_max. ddpm_max differs for sea and swell partitions and is set manually. dfp_max also differs for sea and swell partitions. In the case of sea partitions it is a function of wind speed and is set to the rate of change of the wind-sea peak wave frequency estimated from fetch-limited relationships, (Ewans & Kibblewhite, 1986). In the case of swell partitions it is set to the rate of change of the swell peak wave frequency based on the swell dispersion relationship derived by Snodgrass et al (1966) assuming the distance to the source is 1e6 m.

Parameters:
  • stats (xr.Dataset) – Statistics of the spectral partitions. Requires fp and dpm.

  • wspd (xr.DataArray) – Wind speed (m/s), required if nsea > 0. Time/site should match that of stats.

  • ddpm_sea_max (float) – Maximum delta dpm for sea partitions. Default is 30 degrees.

  • ddpm_swell_max (float) – Maximum delta dpm for swell partitions. Default is 20 degrees.

  • dfp_sea_scaling (float) – Scaling parameter for the rate of change of the wind-sea peak wave frequency. Default is 1.

  • dfp_swell_source_distance (float) – Distance to the swell source (m) for the rate of change of the swell peak wave frequency. Default is 1e6 m.

  • nsea (int) – Number of leading partitions that represent wind seas, e.g., 1 for partitions from the ptm1 and hp01 methods, 2 for the ptm2 method and 0 for the ptm3 method whose partitions are not classified. Wind-sea matching thresholds are applied to the first nsea partitions and swell thresholds to the remaining ones.

Returns:

tracks – Dataset with the track_id of each partition at each time step and the number of wave systems tracked ntracks.

Return type:

xr.Dataset