I ran into an odd issue using meshgrids Numpy with FFT features. In particular, either the fft2 function or the ifft2 function seem to fail when used in an array constructed using meshgrids.
x = np.arange(-4, 4, .08)
y = np.arange(-4, 4, .08)
X, Y = np.meshgrid(x, y)
field = (X + i*Y)*np.exp(X**2 + Y**2)
As a check, before I continued my project, I did
fieldCheck1 = np.fft.fft2(field)
fieldCheck2 = np.fft.ifft2(fieldCheck1)
which should give back its original array, but actually removes the real part (the abs(fieldCheck2)**2flat zero section , where it was originally Gaussian) and completely encrypts the phase information (the phase section fieldCheck2looks like a static, not a phase ramp)
I checked the documentation, but I see nothing there to explain this. Any understanding of the source of the problem would be helpful.