Implement our own FFT functions for xr.DataArray#677
Draft
santisoler wants to merge 5 commits intomainfrom
Draft
Implement our own FFT functions for xr.DataArray#677santisoler wants to merge 5 commits intomainfrom
xr.DataArray#677santisoler wants to merge 5 commits intomainfrom
Conversation
Add our own private functions to compute the fft and ifft of a `xr.DataArray`.
Remove other mentions of xrft in docs.
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. |
leouieda
reviewed
Apr 28, 2026
| } | ||
|
|
||
| # Compute FFT | ||
| fft = np.fft.fftshift(np.fft.fftn(grid.values)) |
Member
There was a problem hiding this comment.
@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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add our own private functions to compute the fft and ifft of a
xr.DataArray. Removexrftas a dependency.Relevant issues/PRs:
Related to #646