Skip to content

Implement our own FFT functions for xr.DataArray#677

Draft
santisoler wants to merge 5 commits intomainfrom
fft
Draft

Implement our own FFT functions for xr.DataArray#677
santisoler wants to merge 5 commits intomainfrom
fft

Conversation

@santisoler
Copy link
Copy Markdown
Member

Add our own private functions to compute the fft and ifft of a xr.DataArray. Remove xrft as a dependency.

Relevant issues/PRs:

Related to #646

Add our own private functions to compute the fft and ifft of
a `xr.DataArray`.
Remove other mentions of xrft in docs.
@leouieda
Copy link
Copy Markdown
Member

@santisoler could you make the FFT functions public? I've been using xrft a lot in classes along with Harmonica and it would be useful to have this.

}

# Compute FFT
fft = np.fft.fftshift(np.fft.fftn(grid.values))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@santisoler it would be good to include parts of xrft that calculate the theoretical Fourier Transform instead of just the FFT result. That's in the true_phase and true_amplitude parts of the code: https://github.com/xgcm/xrft/blob/master/xrft/xrft.py#L462

For amplitude based filters this doesn't matter too much since it's all relative. But for spectrum analysis and other possible filters it could matter. So maybe we should add it always to be safe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants