wavespectra.core.utils.regrid_spec#
- wavespectra.core.utils.regrid_spec(dset, freq=None, dir=None, maintain_m0=True)[source]#
Regrid spectra onto new spectral basis.
- Parameters:
dset (-) – Spectra to interpolate.
freq (-) – Frequencies of interpolated spectra (Hz).
dir (-) – Directions of interpolated spectra (deg).
maintain_m0 (-) – Ensure variance is conserved in interpolated spectra.
- Returns:
Regridded spectra.
- Return type:
dsi (Dataset, DataArray)
Note
All freq below lowest freq are interpolated assuming \(E_d(f=0)=0\).
\(Ed(f)\) is set to zero for new freq above the highest freq in dset.
Only the ‘linear’ method is currently supported.
Duplicate wrapped directions (e.g., 0 and 360) are removed when regridding directions because indices must be unique to intepolate.