Commit b19f65d6 authored by Theo Steininger's avatar Theo Steininger

Fixed power_analyze

parent 89ff8afe
Pipeline #16531 failed with stages
in 5 minutes and 8 seconds
...@@ -406,7 +406,6 @@ class Field(Loggable, Versionable, object): ...@@ -406,7 +406,6 @@ class Field(Loggable, Versionable, object):
distribution_strategy=distribution_strategy, distribution_strategy=distribution_strategy,
logarithmic=logarithmic, nbin=nbin, logarithmic=logarithmic, nbin=nbin,
binbounds=binbounds) binbounds=binbounds)
power_spectrum = cls._calculate_power_spectrum( power_spectrum = cls._calculate_power_spectrum(
field_val=work_field.val, field_val=work_field.val,
pdomain=power_domain, pdomain=power_domain,
...@@ -437,6 +436,7 @@ class Field(Loggable, Versionable, object): ...@@ -437,6 +436,7 @@ class Field(Loggable, Versionable, object):
target_shape=field_val.shape, target_shape=field_val.shape,
target_strategy=field_val.distribution_strategy, target_strategy=field_val.distribution_strategy,
axes=axes) axes=axes)
power_spectrum = pindex.bincount(weights=field_val, power_spectrum = pindex.bincount(weights=field_val,
axis=axes) axis=axes)
rho = pdomain.rho rho = pdomain.rho
...@@ -462,14 +462,14 @@ class Field(Loggable, Versionable, object): ...@@ -462,14 +462,14 @@ class Field(Loggable, Versionable, object):
"A slicing distributor shall not be reshaped to " "A slicing distributor shall not be reshaped to "
"something non-sliced.") "something non-sliced.")
semiscaled_shape = [1, ] * len(target_shape) semiscaled_local_shape = [1, ] * len(target_shape)
for i in axes: for i in axes:
semiscaled_shape[i] = target_shape[i] semiscaled_local_shape[i] = pindex.local_shape[i]
local_data = pindex.get_local_data(copy=False) 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, result_obj = pindex.copy_empty(global_shape=target_shape,
distribution_strategy=target_strategy) distribution_strategy=target_strategy)
result_obj.set_full_data(semiscaled_local_data, copy=False) result_obj.data[:] = semiscaled_local_data
return result_obj return result_obj
......
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