beamTemplate = fmaps.makeTemplate(l,beamells,modLMap)*0.+1. # !!!!!!!!!!!!! fMaskCMB = fmaps.fourierMask(lx,ly,modLMap,lmin=cmbellmin,lmax=cmbellmax) fMask = fmaps.fourierMask(lx,ly,modLMap,lmin=kellmin,lmax=kellmax) ellNoise = np.arange(0,modLMap.max()) Ntt = ellNoise*0.+np.nan_to_num(whiteNoiseT) Npp = ellNoise*0.+np.nan_to_num(whiteNoiseP) Ntt[0] = 0. Npp[0] = 0. gGenT = fmaps.GRFGen(lensedTLm.copy(),ellNoise,Ntt,bufferFactor=1) gGenP1 = fmaps.GRFGen(lensedTLm.copy(),ellNoise,Npp,bufferFactor=1) gGenP2 = fmaps.GRFGen(lensedTLm.copy(),ellNoise,Npp,bufferFactor=1) lensedULm.data = -lensedULm.data lensedQLm.data = -lensedQLm.data lensedTLm.data = fmaps.convolveBeam(lensedTLm.data,modLMap,beamTemplate)/TCMB lensedQLm.data = fmaps.convolveBeam(lensedQLm.data,modLMap,beamTemplate)/TCMB lensedULm.data = fmaps.convolveBeam(lensedULm.data,modLMap,beamTemplate)/TCMB if noiseT>1.e-3: lensedTLm.data = lensedTLm.data + gGenT.getMap(stepFilterEll=None) if noiseP>1.e-3: lensedQLm.data = lensedQLm.data + gGenP1.getMap(stepFilterEll=None) if noiseP>1.e-3: lensedULm.data = lensedULm.data + gGenP2.getMap(stepFilterEll=None) # lensedTLm.data = lensedTLm.data*maskMap.data # lensedQLm.data = lensedQLm.data*maskMap.data # lensedULm.data = lensedULm.data*maskMap.data fot,foe,fob = fmaps.TQUtoFourierTEB(lensedTLm.data.copy().astype(float),lensedQLm.data.copy().astype(float),lensedULm.data.copy().astype(float),modLMap,thetaMap)
pix = thetaMap.sky2pix(pos, safe=False) lensedTQU = lensing.displace_map(map, pix, order=5) + 0.j lensedMapX = lensedTQU lensedMapY = lensedMapX.copy() if szX: lensedMapX += (szMap / TCMB) * 10. if szY: lensedMapY += (szMap / TCMB) * 10. if int(pxDown / px) > 1: lensedMapX = enmap.downgrade(lensedMapX, pxDown / px) lensedMapY = enmap.downgrade(lensedMapY, pxDown / px) lensedMapX = fmaps.convolveBeam(lensedMapX, modLMap, beamTemplate) lensedMapY = fmaps.convolveBeam(lensedMapY, modLMap, beamTemplate) if noiseT > 1.e-3: lensedMapX = lensedMapX + gGenT.getMap(stepFilterEll=None) if noiseT > 1.e-3: lensedMapY = lensedMapY + gGenT.getMap(stepFilterEll=None) # lensedMapYRot = np.rot90(lensedMapY.copy(),2) lensedMapX = lensedMapX * win lensedMapY = lensedMapY * win # lensedMapYRot = lensedMapYRot*win if i == 0: pl = Plotter()