wavespectra.partition.tracking.np_track_partitions#
- wavespectra.partition.tracking.np_track_partitions(times, fp, dpm, 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 at a site 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:
times (np.ndarray) – Array containing the time stamps of the spectra statistics.
fp (np.ndarray) – Array containing the peak wave frequency with shape (npart, ntime).
dpm (np.ndarray) – Array containing the peak wave direction with shape (npart, ntime).
wspd (np.ndarray) – Wind speed at 10 metres (m/s), required if nsea > 0.
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:
track_ids (np.ndarray) – Array containing the track ids for each partition and each time step. -999 is for nans.
ntracks (int) – Number of wave systems tracked.
Notes
The time step is evaluated for each pair of consecutive spectra so records with gaps or irregular sampling use matching thresholds consistent with the actual time elapsed.