wavespectra.partition.tracking.track_partitions#

wavespectra.partition.tracking.track_partitions(stats, wspd, ddpm_sea_max=30, ddpm_swell_max=20, dfp_sea_scaling=1, dfp_swell_source_distance=1000000.0)[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). 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.

Returns#

part_ids: xr.Dataset

Dataset containing the partition ids for each partition and each time step.