Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ift
NIFTy
Commits
2b40dd7a
Commit
2b40dd7a
authored
Apr 20, 2017
by
Theo Steininger
Browse files
Fixed RGSpace.get_distance_array for odd grid size.
parent
94c83d36
Changes
1
Hide whitespace changes
Inline
Side-by-side
nifty/spaces/rg_space/rg_space.py
View file @
2b40dd7a
...
...
@@ -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
.
i
fftshift
(
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
)
...
...
Theo Steininger
@theos
mentioned in issue
#74 (closed)
·
Apr 20, 2017
mentioned in issue
#74 (closed)
mentioned in issue #74
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment