wavespectra.core.utils.interp_spec#
- wavespectra.core.utils.interp_spec(inspec, infreq, indir, outfreq=None, outdir=None, method='linear')[source]#
Interpolate onto new spectral basis.
- Parameters:
inspec (2D ndarray) – input spectrum E(infreq,indir) to be interpolated.
infreq (1D ndarray) – frequencies of input spectrum.
indir (1D ndarray) – directions of input spectrum.
outfreq (1D ndarray) – frequencies of output interpolated spectrum, same as infreq by default.
outdir (1D ndarray) – directions of output interpolated spectrum, same as infreq by default.
method – {‘linear’, ‘nearest’, ‘cubic’}, method of interpolation to use with griddata.
- Returns:
interpolated ouput spectrum E(outfreq,outdir).
- Return type:
outspec (2D ndarray)
Note
If either outfreq or outdir is None or False this coordinate is not interpolated Choose indir=None if spectrum is 1D.
TODO: Deprecate in favour of new regrid_spec function.