wavespectra.partition.tracking.np_track_partitions#

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

dpm: np.ndarray

Array containing the mean peak wave direction.

wspd: np.ndarray

Wind speed at 10 metres (m/s).

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: np.ndarray

Array containing the partition ids for each partition and each time step. -999 is for nans.

n_parts: int

Number of partitions tracked.