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
39b6628e
Commit
39b6628e
authored
Aug 14, 2017
by
Theo Steininger
Browse files
Merge branch 'master' into real_fft
parents
b3fdc443
1cb7af7a
Changes
1
Show whitespace changes
Inline
Side-by-side
nifty/field.py
View file @
39b6628e
...
...
@@ -406,7 +406,6 @@ class Field(Loggable, Versionable, object):
distribution_strategy
=
distribution_strategy
,
logarithmic
=
logarithmic
,
nbin
=
nbin
,
binbounds
=
binbounds
)
power_spectrum
=
cls
.
_calculate_power_spectrum
(
field_val
=
work_field
.
val
,
pdomain
=
power_domain
,
...
...
@@ -437,6 +436,7 @@ class Field(Loggable, Versionable, object):
target_shape
=
field_val
.
shape
,
target_strategy
=
field_val
.
distribution_strategy
,
axes
=
axes
)
power_spectrum
=
pindex
.
bincount
(
weights
=
field_val
,
axis
=
axes
)
rho
=
pdomain
.
rho
...
...
@@ -462,14 +462,14 @@ class Field(Loggable, Versionable, object):
"A slicing distributor shall not be reshaped to "
"something non-sliced."
)
semiscaled_shape
=
[
1
,
]
*
len
(
target_shape
)
for
i
in
axes
:
semiscaled_shape
[
i
]
=
target
_shape
[
i
]
semiscaled_
local_
shape
=
[
1
,
]
*
len
(
target_shape
)
for
i
in
range
(
len
(
axes
))
:
semiscaled_
local_
shape
[
axes
[
i
]
]
=
pindex
.
local
_shape
[
i
]
local_data
=
pindex
.
get_local_data
(
copy
=
False
)
semiscaled_local_data
=
local_data
.
reshape
(
semiscaled_shape
)
semiscaled_local_data
=
local_data
.
reshape
(
semiscaled_
local_
shape
)
result_obj
=
pindex
.
copy_empty
(
global_shape
=
target_shape
,
distribution_strategy
=
target_strategy
)
result_obj
.
set_full_data
(
semiscaled_local_data
,
copy
=
False
)
result_obj
.
data
[:]
=
semiscaled_local_data
return
result_obj
...
...
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