I have a four-dimensional array of the form $A_{ijkl}=\{x_i,y_j,z_k,f(x_i,y_j,z_k)\}$, where $f$ is some known function. I would like to compute the Fourier transform of $f(x,y,z)$ numerically. In order to do this, I apply
B = Fourier[A[[All,All,All,-1]]];
Infamously, Fourier
returns the data with the axes organised in a "funny" way. So my question is, given the array $\bf A$ and $\bf B$, how do I reconstruct the four dimensional array $\bf C$, with $C_{ijkl}=\{k^x_i,k^y_j,k^z_k,\mathcal{F}(k^x_i,k^y_j,k^z_k)\}$ where $\mathcal{F}$ is the Fourier transform of $f$?
Example:
Take $f(x,y,z)=e^{i x}+\frac{1}{4}e^{i y}+\frac{1}{2}e^{i z}$. Take as sampling points
\begin{align}
x_i = -3.2+\frac{i}{10}\,,\quad i=1,\ldots,63
\\
y_j = -3.2+\frac{j}{10}\,,\quad j=1,\ldots,63
\\
z_k = -3.2+\frac{k}{10}\,,\quad k=1,\ldots,63
\end{align}
How do I apply Fourier
, and arrange the axis, so that my array $\bf C$ only has non-zero elements (within numerical error)
$$
\{1,0,0,1\}\,,\quad\{0,1,0,\frac{1}{4}\}\,,\quad\{0,0,1,\frac{1}{2}\}\,.
$$