Commit 2b40dd7a authored by Theo Steininger's avatar Theo Steininger
Browse files

Fixed RGSpace.get_distance_array for odd grid size.

parent 94c83d36
......@@ -298,13 +298,13 @@ class RGSpace(Space):
dists = ((np.float128(0) + cords[0] - shape[0] // 2) * dk[0])**2
# apply zerocenterQ shift
if self.zerocenter[0] == False:
dists = np.fft.fftshift(dists)
if not self.zerocenter[0]:
dists = np.fft.ifftshift(dists)
# only save the individual slice
dists = dists[slice_of_first_dimension]
for ii in range(1, len(shape)):
temp = ((cords[ii] - shape[ii] // 2) * dk[ii])**2
if self.zerocenter[ii] == False:
if not self.zerocenter[ii]:
temp = np.fft.fftshift(temp)
dists = dists + temp
dists = np.sqrt(dists)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment