kmin = 100 kmax = getMax(polComb, tellmax, pellmax) deg = 10. px = 0.5 dell = 10 bin_edges = np.arange(kmin, kmax, dell) + dell theory = loadTheorySpectraFromCAMB(cambRoot, unlensedEqualsLensed=False, useTotal=False, lpad=9000) lmap = lm.makeEmptyCEATemplate(raSizeDeg=deg, decSizeDeg=deg, pixScaleXarcmin=px, pixScaleYarcmin=px) myNls = NlGenerator(lmap, theory, bin_edges, gradCut=gradCut) ellkk = np.arange(2, 9000, 1) Clkk = theory.gCl("kk", ellkk) pl = Plotter(scaleY='log', scaleX='log') sns = [] snsM = [] overdensity = 500. critical = True atClusterZ = True kellmax = 8000 outDir = "/gpfs01/astro/www/msyriac/plots/"
#px = 0.2 px = 0.5 dell = 10 theory = loadTheorySpectraFromCAMB(cambRoot, unlensedEqualsLensed=False, useTotal=False, lpad=9000) lmap = lm.makeEmptyCEATemplate(raSizeDeg=deg, decSizeDeg=deg, pixScaleXarcmin=px, pixScaleYarcmin=px) print((lmap.data.shape)) i = 0 for gradCut in [10000, 2000]: myNls = NlGenerator(lmap, theory, gradCut=gradCut) for polComb in ['TT', 'TE', 'EE', 'EB', 'ET', 'TB']: for beamY in beamRange: beamell = beamscale(beamY) for tellmaxY, pellmaxY in [(3000, 5000), (beamell, beamell)]: for noiseX,beamX,lab,tellminX,tellmaxX,pellminX,pellmaxX in \ [(noiseY,beamY,"sameGrad",tellminY,tellmaxY,pellminY,pellmaxY), \ (30.,7.0,"planckGrad",2,3000,2,3000)]: noiseTX = noiseX noisePX = np.sqrt(2.) * noiseTX noiseTY = noiseY noisePY = np.sqrt(2.) * noiseTY kmax = getMax(polComb, tellmaxY, pellmaxY)
noiseRange = np.arange(3.0, 30.0, 4.0) swap = False #for polComb in ['TT','EB']: for polComb in ['EB']: for delens in [False, True]: if polComb == 'TT' and delens: continue pl = Plotter(scaleY='log', labelX="$L$", labelY="$C_L$") sns = [] #for beamX in beamRange: for noiseTX in noiseRange: noisePX = np.sqrt(2.) * noiseTX myNls = NlGenerator(lmap, theory, gradCut=gradCut) kmax = getMax(polComb, tellmaxY, pellmaxY) bin_edges = np.arange(kmin, kmax, dell) + dell myNls.updateBins(bin_edges) if swap: tempB = beamY beamY = beamX beamX = tempB nTX,nPX,nTY,nPY = myNls.updateNoise(beamX,noiseTX,noisePX,tellminX,tellmaxX, \ pellminX,pellmaxX,beamY=beamY,noiseTY=noiseTY, \ noisePY=noisePY,tellminY=tellminY,tellmaxY=tellmaxY, \
import flipper.liteMap as lm from alhazen.quadraticEstimator import NlGenerator, getMax dell = 10 gradCut = 2000 kellmin = 10 lmap = lm.makeEmptyCEATemplate(raSizeDeg=deg, decSizeDeg=deg, pixScaleXarcmin=px, pixScaleYarcmin=px) kellmax = max(tellmax, pellmax) from orphics.theory.cosmology import Cosmology cc = Cosmology(lmax=int(kellmax), pickling=True) theory = cc.theory bin_edges = np.arange(kellmin, kellmax, dell) myNls = NlGenerator(lmap, theory, bin_edges, gradCut=gradCut) from scipy.interpolate import interp1d from orphics.tools.io import Plotter ellkk = np.arange(2, 9000, 1) Clkk = theory.gCl("kk", ellkk) clfunc = interp1d(ellkk, Clkk, bounds_error=False, fill_value="extrapolate") kellmax = 8000 cc = ClusterCosmology(cosmoDict, constDict, kellmax, pickling=True) theory = cc.theory pl = Plotter(labelX="Beam (arcmin)", labelY="$\\sigma(M)/M$ for $N=1000$",
deg = 10. px = 0.5 dell = 10 kellrange = np.arange(80.,2100.,10.) Nlmvinv = 0. pl = Plotter(scaleY='log') for polComb in ['TT','TE','EE','EB']: kmax = getMax(polComb,tellmaxY,pellmaxY) bin_edges = np.arange(kmin,kmax,dell)+dell lmap = lm.makeEmptyCEATemplate(raSizeDeg=deg, decSizeDeg=deg,pixScaleXarcmin=px,pixScaleYarcmin=px) myNls = NlGenerator(lmap,theory,bin_edges,gradCut=gradCut) myNls.updateBins(bin_edges) nTX,nPX,nTY,nPY = myNls.updateNoise(beamX,noiseTX,noisePX,tellminX,tellmaxX, \ pellminX,pellmaxX,beamY=beamY,noiseTY=noiseTY, \ noisePY=noisePY,tellminY=tellminY,tellmaxY=tellmaxY, \ pellminY=pellminY,pellmaxY=pellmaxY,lkneesX=(lkneeTX,lkneePX),alphasX=(alphaTX,alphaPX), \ lkneesY=(lkneeTY,lkneePY),alphasY=(alphaTY,alphaPY),lxcutTX=lxcutTX, \ lxcutTY=lxcutTY,lycutTX=lycutTX,lycutTY=lycutTY, \ lxcutPX=lxcutPX,lxcutPY=lxcutPY,lycutPX=lycutPX,lycutPY=lycutPY, \ fgFileX=fgFileX,beamFileX=beamFileX,fgFileY=fgFileY,beamFileY=beamFileY ) cbinner = bin2D(myNls.N.modLMap,cmb_bin_edges) ells, Nells = cbinner.bin(nTX)
degy=5., px=px, TCMB=TCMB, halo=halo, gradCut=gradCut) ### Nlgenerator cross-check deg = 10. px = 0.5 arc = deg * 60. lmap = lm.makeEmptyCEATemplate(raSizeDeg=arc / 60., decSizeDeg=arc / 60., pixScaleXarcmin=px, pixScaleYarcmin=px) bin_edges = np.arange(kellmin, kellmax, num_ells) myNls = NlGenerator(lmap, theory, bin_edges, gradCut=gradCut) myNls.updateNoise(beam, noiseT, noiseP, tellmin, tellmax, pellmin, pellmax) #### pl = Plotter(scaleY='log') #,scaleX='log') pl.add(ellkk, 4. * Clkk / 2. / np.pi) # CHECK THAT NORM MATCHES HU/OK for polComb, col in zip(polCombList, colorList): if polComb == 'EB': lsold, Nlsold, eff = myNls.iterativeDelens(polComb, 1.0, True) else: lsold, Nlsold = myNls.getNl(polComb=polComb, halo=halo) try: huFile = 'data/hu_' + polComb.lower() + '.csv'
px = 1.0 arc = deg * 60. kellmin = 10 kellmax = 5000 bin_edges = np.arange(kellmin, kellmax, 10) from orphics.theory.cosmology import Cosmology cc = Cosmology(lmax=int(max(tellmax, pellmax, kellmax)), pickling=True) theory = cc.theory lmap = lm.makeEmptyCEATemplate(raSizeDeg=arc / 60., decSizeDeg=arc / 60., pixScaleXarcmin=px, pixScaleYarcmin=px) myNls = NlGenerator(lmap, theory, bin_edges, gradCut=gradCut) myNls.updateNoise(beam, noiseT, noiseP, tellmin, tellmax, pellmin, pellmax) polCombList = ['TT', 'EE', 'ET', 'EB', 'TB'] colorList = ['red', 'blue', 'green', 'orange', 'purple'] ellkk = np.arange(2, 9000, 1) Clkk = theory.gCl("kk", ellkk) lsmv, Nlmv, ells, dclbb, efficiency = myNls.getNlIterative(polCombList, kellmin, kellmax, tellmax, pellmin, pellmax, dell=10, halo=True,