FFT¶
-
nata.containers.GridDataset.fft(dataset: nata.containers.GridDataset, type: Optional[str] = 'abs') → nata.containers.GridDataset¶ Computes the Fast Fourier Transform (FFT) of a single/multiple iteration
nata.containers.GridDatasetalong all grid axes using numpy’s fft module.- Parameters
type (
{'abs', 'real', 'imag', 'full'}, optional) – Defines the component of the FFT selected for output. Available values are'abs'(default),'real','imag'and'full', which correspond to the absolute value, real component, imaginary component and full (complex) result of the FFT, respectively.- Returns
nata.containers.GridDataset– Selected FFT component along all grid axes ofdataset.
Examples
To obtain the FFT of a
nata.containers.GridDataset, a simple call to thefft()method is enough. In the following example, we compute the FFT of a one-dimensionalnata.containers.GridDataset.>>> from nata.containers import GridDataset >>> import numpy as np >>> x = np.linspace(100) >>> arr = np.exp(-(x-len(x)/2)**2) >>> ds = GridDataset(arr[np.newaxis]) >>> ds_fft = ds.fft()