xscale.spectral.fft.fft

xscale.spectral.fft.fft(array, nfft=None, dim=None, dx=None, detrend=None, tapering=False, shift=True, sym=False, chunks=None)

Compute the spectrum on several dimensions of xarray.DataArray objects using the Fast Fourrier Transform parrallelized with dask.

Parameters:
array : xarray.DataArray

Array from which compute the spectrum

dim : str or sequence

Dimensions along which to compute the spectrum

dx : float or sequence, optional

Define the resolution of the dimensions. If not precised, the resolution is computed directly from the coordinates associated to the dimensions.

detrend : {None, ‘mean’, ‘linear’}, optional

Remove the mean or a linear trend before the spectrum computation

tapering : bool, optional

If True, tapper the data with a Tukey window

shift : bool, optional

If True, the frequency axes are shifted to center the 0 frequency, otherwise negative frequencies follow positive frequencies as in numpy.fft.ftt

sym : bool, optional

If True, force the spectrum to be symmetrical even if the input data is real

chunks : int, tuple or dict, optional

Chunk sizes along each dimension, e.g., 5, (5, 5) or {'x': 5, 'y': 5}

Returns:
res : DataArray

A multi-dimensional complex DataArray with the corresponding dimensions transformed in the Fourier space.

Notes

If the input data is real, a real fft is performed over the first dimension, which is faster. Then the transform over the remaining dimensions are computed with the classic fft.