Skip to content

Commit

Permalink
Ensure J is negated first in fourier_shift (#46)
Browse files Browse the repository at this point in the history
Just to ensure that `J` is negated before graph construction and it is
not rolled into graph construction, enforce the order of operations by
treating `-J` as a quantity by itself. This way we can be sure it is
already computed before graph construction begins and the scalar is
merely inserted into the graph as a single node.
  • Loading branch information
jakirkham committed Sep 1, 2018
1 parent d5b0a4e commit 1050f32
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dask_image/ndfourier/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def fourier_shift(input, shift, n=-1, axis=-1):

# Apply shift
phase_shift = dask.array.exp(
- J * dask.array.tensordot(shift, ang_freq_grid, axes=1)
(-J) * dask.array.tensordot(shift, ang_freq_grid, axes=1)
)
result = input * phase_shift

Expand Down

0 comments on commit 1050f32

Please sign in to comment.