Commit 69792e0f authored by Theo Steininger's avatar Theo Steininger

Merge branch 'master' of gitlab.mpcdf.mpg.de:ift/NIFTy

parents f8fcace5 ea96116b
Pipeline #13483 passed with stages
in 11 minutes and 12 seconds
......@@ -53,10 +53,13 @@ class DirectSmoothingOperator(SmoothingOperator):
wgt = []
expfac = 1. / (2. * sigma*sigma)
for i in range(x.size):
if nval[i]>0:
t = x[ibegin[i]:ibegin[i]+nval[i]]-x[i]
t = np.exp(-t*t*expfac)
t *= 1./np.sum(t)
wgt.append(t)
else:
wgt.append(np.array([]))
return ibegin, nval, wgt
......@@ -146,7 +149,7 @@ class DirectSmoothingOperator(SmoothingOperator):
#MR FIXME: this causes calls of log(0.) which should probably be avoided
if self.log_distances:
np.log(distance_array, out=distance_array)
np.log(np.maximum(distance_array,1e-15), out=distance_array)
# collect the local data + ghost cells
local_data_Q = False
......
......@@ -55,5 +55,5 @@ def create_power_operator(domain, power_spectrum, dtype=None,
fp = Field(power_domain, val=power_spectrum, dtype=dtype,
distribution_strategy=distribution_strategy)
f = fp.power_synthesize(mean=1, std=0, real_signal=False)
f **= 2
return DiagonalOperator(domain, diagonal=f, bare=True)
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