Skip to content

Add fftshift/ifftshift - #2321

Merged
jcrist merged 5 commits into
dask:masterfrom
jakirkham:add_fftshift
May 10, 2017
Merged

jcrist merged 5 commits into
dask:masterfrom
jakirkham:add_fftshift

Conversation

@jakirkham

Copy link
Copy Markdown
Member

Fixes #2124

Adds equivalents of NumPy's fftshift and ifftshift functions for Dask Arrays. Also includes tests to ensure that the results with Dask are equivalent to those with NumPy. Further add some identity tests to ensure that applying fftshift and then ifftshift or vice versa return the original array unchanged.

jakirkham added 5 commits May 9, 2017 22:20
As there is a lot of similarity between the `ifftshift` and `fftshift`
functions, this refactors out a common more general function that
applies to both use cases. Should help reduce the amount of code
involved and keep things maintainable.
Simply compares the results of Dask Array's [i]fftshift with results
from NumPy's [i]fftshift. Tries various combinations of axes to make
sure the same results are gotten for all cases.
To ensure that applying `fftshift` and then `ifftshift` or vice versa
always yields the original array unchanged, add a test along these lines
for Dask Arrays.
@jcrist

jcrist commented May 10, 2017

Copy link
Copy Markdown
Member

LGTM.

@jcrist
jcrist merged commit 9f96b46 into dask:master May 10, 2017
@jakirkham
jakirkham deleted the add_fftshift branch May 10, 2017 04:28
Comment thread dask/array/fft.py
return r


@wraps(np.fft.fftshift)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This wrapper is not strictly needed here. It is only here as it is a holdover from the code being refactored. Added PR ( #2323 ) to address this.

@jakirkham jakirkham mentioned this pull request May 10, 2017
@sinhrks sinhrks added this to the 0.15.0 milestone Aug 30, 2017
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.

3 participants