def test(): map_nl = mapper_nl(tod, model, hypers=2*[1.], norms=[norm2_ellipsoid(invntt)] + 2*[norm2], tol=1.e-4, maxiter=1000, callback=None if tamasis.var.verbose else Callback(), ) print 'Elapsed time: ' + str(map_nl.header['TIME']) + ' after ' + \ str(map_nl.header['NITER']) + ' iterations.' if map_nl.header['NITER'] > 150: raise TestFailure()
# naive map map_naive = mapper_naive(tod, model) # iterative map, taking all map pixels class Callback(): def __init__(self): self.niterations = 0 def __call__(self, x): self.niterations += 1 invntt = DiagonalOperator(1 / obs.get_detector_stddev(100)**2, broadcast='rightward') norm = tamasis.linalg.norm2_ellipsoid(invntt) precond = 1. / map_naive.coverage precond[precond > 1] = 0 map_nl = mapper_nl(tod, model, tol=1.e-6, maxiter=1000, norms=[norm], M=DiagonalOperator(precond), callback=Callback()) print('Elapsed time:', map_nl.header['TIME']) if map_nl.header['NITER'] > 21: raise TestFailure()
masking_tod = MaskOperator(tod.mask) masking_map = MaskOperator(projection.get_mask()) model = masking_tod * projection * masking_map # naive map map_naive = mapper_naive(tod, model) # iterative map, taking all map pixels class Callback(): def __init__(self): self.niterations = 0 def __call__(self, x): self.niterations += 1 invntt = DiagonalOperator(1/obs.get_detector_stddev(100)**2, broadcast='rightward') norm = tamasis.linalg.norm2_ellipsoid(invntt) precond = 1./map_naive.coverage precond[precond > 1] = 0 map_nl = mapper_nl(tod, model, tol=1.e-6, maxiter=1000, norms=[norm], M=DiagonalOperator(precond), callback=Callback()) print('Elapsed time:', map_nl.header['TIME']) if map_nl.header['NITER'] > 21: raise TestFailure()