wavespectra.partition.partition.Partition.ptm1_track#
- Partition.ptm1_track(wspd, wdir, dpt, agefac=1.7, wscut=0.3333, swells=3, smooth=False, freq_window=3, dir_window=3, ihmax=100, ddpm_sea_max=30, ddpm_swell_max=20, dfp_sea_scaling=1, dfp_swell_source_distance=1000000.0)[source]#
Partition and combine spectra from the same wave system over time.
Partition spectra using the PTM1 method and track the partitions using 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.
- Args:
wspd (xr.DataArray): Wind speed DataArray.
wdir (xr.DataArray): Wind direction DataArray.
dpt (xr.DataArray): Depth DataArray.
swells (int): Number of swell partitions to compute.
agefac (float): Age factor.
wscut (float): Wind sea fraction cutoff.
smooth (bool): Compute watershed boundaries from smoothed spectra as described in Portilla et al., 2009.
freq_window (int): Size of running window along freq for smoothing spectra.
dir_window (int): Size of running window along dir for smoothing spectra.
ihmax (int): Number of discrete spectral levels in WW3 Watershed code.
ddpm_sea_max (float): Maximum peak direction difference for wind sea partition. Default is 30 degrees.
ddpm_swell_max (float): Maximum peak direction difference for swell partitions. Default is 20 degrees.
dfp_sea_scaling (float): Scaling factor for maximum peak frequency difference for wind sea partition. Default is 1.
dfp_swell_source_distance (float): Distance to source for swell peak frequency difference. Default is 1e6 m.
- Returns:
dspart (xr.Dataset): Partitioned spectra with extra part dimension where the 0th index are the wind sea and remaining indices are the swells sorted by descending order of Hs. Plus array part_id containing an integer representing the partition id for each time step and partition. Plus array npart_id containing the existing partition ids.