title: 2D-Fourier-Transformation - correct order labeling?
body: <p>I use the 2D-FFT from NumPy to calculate the differential phase of a patterned image. So I have an image with 20x20 spots which shift within several images and I want to get the shift / differential phase.</p>
  <p>Therefore I use the following:</p>
  <pre><code>picfft = np.fft.fft2(data* hanning_window)
  picfft_shifted = np.fft.fftshift(picfft)
  </code></pre>
  <p>Now I want to crop the different parts of the higher 1st order harmonics. From the <a href="https://numpy.org/devdocs/reference/generated/numpy.fft.fft2.html" rel="nofollow noreferrer">documentation of NumPy</a> I read that, before shifting, the zero frequency is in the low-order corner and the positive frequencies are in the first half of the dimensions. After the <code>fftshift</code> this leads to the fact that the zero frequency is in the center and the positive frequencies in the left bottom quarter.</p>
  <p><a href="https://i.stack.imgur.com/CuNFJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CuNFJ.png" alt="in white the cropped areas of specific order" /></a></p>
  <p>If I now crop the 1st order areas as in the image and transform it back I get a quite reliable differential phase. However the sign is changed. I know that my spots shift to the middle of the image, but in the (1,0) and (0,1) orders the signs indicate a shift to the outer area of the image.</p>
  <p>Have I interchanged the directions of crop, so is my (1,0) order in reality the (-1,0) order and so on? Because with this the results would fit to reality. But then my understanding of the documentation is different.</p>
  <p>Hopefully anyone here is familiar with 2D-FFT and phase information.</p>