myimagelib.corrLib.compute_wavenumber_field

myimagelib.corrLib.compute_wavenumber_field(shape, d)

Compute the wave number field Kx and Ky, and magnitude field k. Note that this function works for even higher dimensional shape.

Parameters
  • shape – shape of the velocity field and velocity fft field, tuple

  • d – sample spacing. This is the distance between adjacent samples, for example, velocities in PIV. The resulting frequency space has the unit which is inverse of the unit of d. The preferred unit of d is um.

Returns

  • k – wavenumber magnitude field

  • K – wavenumber fields in given dimensions

Test

>>> shape = (5, 5)
>>> k, K = compute_wavenumber_field(shape, 0.2)

Edit

12022020

multiply 2pi to the wavenumber to account for the built-in 2pi in the fft method. This factor leads to a difference in the magnitude of 1D energy spectra.

Note

The dimensionless wavenumber should remain unchanged.