def test_times(space, sigma): op = ift.HarmonicSmoothingOperator(space, sigma=sigma) fld = np.zeros(space.shape, dtype=np.float64) fld[0] = 1. rand1 = ift.Field.from_global_data(space, fld) tt1 = op.times(rand1) assert_allclose(1, tt1.sum())
def test_adjoint_times(space, sigma): op = ift.HarmonicSmoothingOperator(space, sigma=sigma) rand1 = ift.Field.from_random('normal', domain=space) rand2 = ift.Field.from_random('normal', domain=space) tt1 = rand1.vdot(op.times(rand2)) tt2 = rand2.vdot(op.adjoint_times(rand1)) assert_allclose(tt1, tt2)
def test_smooth_regular2(sz1, sz2, d1, d2, sigma, tp): tol = _get_rtol(tp) sp = ift.RGSpace([sz1, sz2], distances=[d1, d2]) smo = ift.HarmonicSmoothingOperator(sp, sigma=sigma) inp = ift.Field.from_random(domain=sp, random_type='normal', std=1, mean=4, dtype=tp) out = smo(inp) assert_allclose(inp.sum(), out.sum(), rtol=tol, atol=tol)
def testHarmonicSmoothingOperator(sp, dtype): _check_repr(ift.HarmonicSmoothingOperator(sp, 0.1))
def testHarmonicSmoothingOperator(sp, dtype): op = ift.HarmonicSmoothingOperator(sp, 0.1) ift.extra.consistency_check(op, dtype, dtype)
def test_property(space, sigma): op = ift.HarmonicSmoothingOperator(space, sigma=sigma) if op.domain[0] != space: raise TypeError
def psf_response(position_space): C = ift.HarmonicSmoothingOperator(position_space, 0.01) G = ift.GeometryRemover(C.target) return G @ C