TCMB = 2.7255e6 hugeTemplate = lm.makeEmptyCEATemplate(degx,degy,pixScaleXarcmin=px,pixScaleYarcmin=px) lxMap,lyMap,modLMap,thetaMap,lx,ly = fmaps.getFTAttributesFromLiteMap(hugeTemplate) nfreq = modLMap.max() assert nfreq>cmbellmax assert nfreq>kellmax from orphics.tools.cmb import loadTheorySpectraFromCAMB cambRoot = os.environ['HOME']+"/repos/cmb-lensing-projections/data/TheorySpectra/ell28k_highacc" theory = loadTheorySpectraFromCAMB(cambRoot,unlensedEqualsLensed=True,useTotal=False,TCMB = 2.7255e6,lpad=9000) #theory = loadTheorySpectraFromCAMB(cambRoot,unlensedEqualsLensed=False,useTotal=False,TCMB = 2.7255e6,lpad=9000) Nlfuncdict={} Nlfuncdict['TT'] = cmb.get_noise_func(beamArcmin,noiseT,TCMB=TCMB) Nlfuncdict['EE'] = cmb.get_noise_func(beamArcmin,noiseP,TCMB=TCMB) Nlfuncdict['BB'] = cmb.get_noise_func(beamArcmin,noiseP,TCMB=TCMB) print modLMap.shape dlx = np.diff(lxMap,axis=1)[0,0] dly = np.diff(lyMap,axis=0)[0,0] Lmin = kellmin #10. Lmax = kellmax #2000. #Ls = np.logspace(np.log10(Lmin),np.log10(Lmax),num_ells) Ls = np.linspace(Lmin,Lmax,num_ells) lx1 = lyMap
alpha = -4.6 bin_edges = np.arange(ellmin_cmb,ellmax_cmb,dell_cmb) ellfine = np.arange(ellmin_cmb,ellmax_cmb,1) binner = stats.bin2D(modLMap,bin_edges) cents, pcls = binner.bin(pwindow) cc = Cosmology(lmax=lmax,pickling=True) theory = cc.theory cltt = theory.lCl('TT',ellfine) cltt2d = theory.lCl('TT',modLMap) nfunc = cmb.get_noise_func(beamArcmin,noiseMukArcmin,ellmin=ellmin_cmb,ellmax=ellmax_cmb,TCMB=2.7255e6,lknee=lknee,alpha=alpha) nells = nfunc(ellfine) n2d = nfunc(modLMap) n2dp = n2d/pwindow**2. cents, nclsp = binner.bin(n2dp) cents, ncls = binner.bin(n2d) pl = io.Plotter(scaleY='log',scaleX='log') pl.add(ellfine,cltt*ellfine**2.) pl.add(ellfine,nells*ellfine**2.,ls="--") pl.add(cents,nclsp*cents**2.,ls="-.") pl.legendOn()
clkk.resize((clkk.shape[-1])) pl = io.Plotter(scaleY='log', scaleX='log') pl.add(fine_ells, clkk) pl.add(cents, bclkk) pl.done(out_dir + "clkk.png") phi, fphi = lt.kappa_to_phi(kappa_map, modlmap_sim, return_fphi=True) io.quickPlot2d(kappa_map, out_dir + "kappa_map.png") io.quickPlot2d(phi, out_dir + "phi.png") alpha_pix = enmap.grad_pixf(fphi) # === EXPERIMENT === if deconvolve_beam: ntfunc = cmb.get_noise_func(beam_arcmin, noise_T_uK_arcmin, ellmin=tellmin, ellmax=tellmax, TCMB=TCMB) npfunc = cmb.get_noise_func(beam_arcmin, noise_P_uK_arcmin, ellmin=pellmin, ellmax=pellmax, TCMB=TCMB) else: ntfunc = lambda x: modlmap_dat * 0. + (np.pi / ( 180. * 60))**2. * noise_T_uK_arcmin**2. / TCMB**2. npfunc = lambda x: modlmap_dat * 0. + (np.pi / ( 180. * 60))**2. * noise_P_uK_arcmin**2. / TCMB**2. kbeam_sim = cmb.gauss_beam(modlmap_sim, beam_arcmin) ps_noise = np.zeros((3, 3, pix_ells.size))
# beam = 7.0 # noiseT = 27.0 # noiseP = 56.5 tellmin = 100. tellmax = 3000. pellmin = 100. pellmax = 5000. beam = 1.0 noiseT = 3.0 noiseP = np.sqrt(2.) * noiseT noiseFuncTX = cmb.get_noise_func(beam, noiseT, ellmin=tellmin, ellmax=tellmax, TCMB=TCMB) noiseFuncEX = cmb.get_noise_func(beam, noiseP, ellmin=pellmin, ellmax=pellmax, TCMB=TCMB) noiseFuncTY = noiseFuncTX noiseFuncEY = noiseFuncBY = noiseFuncBX = noiseFuncEX Ls, Nls, crosses, Nmv = isotropic_noise_full_lensing_covariance( polCombList, theory, noiseFuncTX, noiseFuncEX,