xarray_ifftN

PlasmaCalcs.tools.fft_tools.xarray_fft.xarray_ifftN(array, dim=None, df=None, *, rad=None, pos_dims=None, ds=None, x0=0, **kw_np_ifftn)

calculates ifft(array) along N dimensions.

shifts positions such that the 0-position is in the center.
replaces result dimensions & coordinates appropriately, to indicate which dims were ifft’d.
For convenience, all coordinate names can be pre-fft OR post-fft names,
e.g. ‘x’, ‘freq_x’, ‘freqrad_x’, or ‘k_x’.
“post-fft” names look like ‘freq_dim’, ‘freqrad_dim’,
or any value in DEFAULTS.FFT_FREQ_RAD_DIMNAMES.values(), e.g. ‘k_x’.
Caution: ifft(fft(arr)) == arr only approximately, due to floating point rounding errors.
Can at least ensure coordinate alignment by providing ds during ifft(fft(arr), ds=…)
dim: None, str, or iterable of strs
coordinates(s) of array to take ifft over.
promote_dim(array, coord) for any non-dimension coordinates, as needed.
None –> equivalent to array.dims
df: None, number, or dict of {dim: d}
spacing between elements of array (in frequency-space).
None –> infer from ds if provided, else infer from array.
number –> use this as df for all dims.
rad: None or bool
if True, interpret frequency-spacing (df) like it is “in radians”,
dividing it by 2 * pi before converting to position-space.
None –> infer rad from names of the dims being ifft’d.
ds: None, number, or dict of {dim: d}
spacing between elements of result (in position-space), along dims from result.
number –> use this as ds for all dims.
None –> infer from df if provided, else infer from array.
Note: provide ds to guarantee ifft(fft(arr)) == arr, exactly;
otherwise position coords might include small rounding errors.
x0: None, number, or dict of {dim: value}
if provided, alter position-space coordinates by adding a constant offset,
such that the 0’th position for each dim equals x0[dim].
number –> apply the same number to all dims.
iterable –> use these numbers; kwarg dim must also be provided as an iterable of strs.
dict –> dict of {dim: x0} specifying the value associated with each dim