Commit b5fd6a56 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

Merge branch 'bugfix' into 'NIFTy_5'

bug fix

See merge request ift/nifty-dev!32
parents 6c9b81c5 a33c01ff
......@@ -38,7 +38,8 @@ class PointSources(Model):
# FIXME
outer_inv = np.clip(outer_inv, 1e-20, None)
outer = 1/outer_inv
grad = Field.from_local_data(u.domain, inner*outer)
grad = Field.from_local_data(self.position['points'].domain,
inner*outer)
grad = makeOp(MultiField({'points': grad}))
return SelectionOperator(grad.target, 'points')*grad
......
......@@ -7,6 +7,8 @@ from .linear_operator import LinearOperator
class SlopeOperator(LinearOperator):
def __init__(self, domain, target, sigmas):
# MR FIXME: check explicitly for the required domain types etc.
# Maybe compute domain from target automatically?
self._domain = DomainTuple.make(domain)
self._target = DomainTuple.make(target)
......@@ -24,7 +26,7 @@ class SlopeOperator(LinearOperator):
for i in range(self.ndim):
rng = np.arange(target.shape[i])
tmp = np.minimum(
rng, target.shape[i] + 1 - rng) * target.bindistances[i]
rng, target.shape[i]+1-rng) * target.bindistances[i]
self.pos[i] += tmp.reshape(
(1,)*i + (shape[i],) + (1,)*(self.ndim-i-1))
......
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