NEDAS.diag.metrics.spectral module
- NEDAS.diag.metrics.spectral.pwrspec2d(fld)[source]
Horizontal 2D power spectrum p(k2d), on a regular Cartesian grid
For very large grid, the map factors will cause slight errors in grid spacings but okay for relatively small grids. Of course for global analysis one shall use the spherical harmonics instead.
Input:
fld: np.array, shape (…, ny, nx) n-dimensional input field, the last two dimensions are the horizontal directions (y,x)
Returns:
wn: np.array, shape (nup,) Wavenumber in 2D, int(k2d), nup is the max wavenumber given ny,nx (whichever is larger)
pwr: np.array, shape (…, nup) The power spectrum, leading dimensions the same as fld but ny,nx replaced by nup.