Example #1
0
                     (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)
                    i += 1
                    print((i, tellmaxY, pellmaxY, kmax, "delens:",
                           delensTolerance))

                    bin_edges = np.arange(kmin, kmax, dell) + dell
                    myNls.updateBins(bin_edges)
                    myNls.updateNoise(beamX,noiseTX,noisePX,tellminX,tellmaxX, \
                                      pellminX,pellmaxX,beamY=beamY,noiseTY=noiseTY, \
                                      noisePY=noisePY,tellminY=tellminY,tellmaxY=tellmaxY, \
                                      pellminY=pellminY,pellmaxY=pellmaxY)

                    ls, Nls = myNls.getNl(polComb=polComb, halo=halo)

                    fileName = saveRoot + getFileNameString([
                        'gradCut', 'polComb', 'beamY', 'noiseY', 'grad',
                        'tellminY', 'pellminY', 'tellmaxY', 'pellmaxY', 'kmin',
                        'deg', 'px'
                    ], [
                        gradCut, polComb, beamY, noiseY, lab, tellminY,
                        pellminY, tellmaxY, pellmaxY, kmin, deg, px
                    ]) + ".txt"
                    np.savetxt(fileName, np.vstack((ls, Nls)).transpose())

                    if (polComb == 'EB' or polComb
Example #2
0
overdensity = 500.
critical = True
atClusterZ = True
kellmax = 8000

outDir = "/gpfs01/astro/www/msyriac/plots/"

for beam in beamrange:
    beamX = beam
    beamY = beam
    print beam
    myNls.updateNoise(beamX,
                      noiseTX,
                      noisePX,
                      tellmin,
                      tellmax,
                      pellmin,
                      pellmax,
                      beamY=beamY,
                      noiseTY=noiseTY,
                      noisePY=noisePY)
    ls, Nls = myNls.getNl(polComb=polComb, halo=halo)

    #ls,Nls = np.loadtxt("../SZ_filter/data/LA_pol_Nl.txt",unpack=True,delimiter=',')

    sn, kappa = NFWMatchedFilterSN(cc,
                                   Mexp,
                                   c,
                                   z,
                                   ells=ls,
                                   Nls=Nls,
                                   kellmax=kellmax,
Example #3
0
            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, \
                              pellminY=pellminY,pellmaxY=pellmaxY,lkneesX=(lkneeTX,lkneePX), \
                              alphasX=(alphaTX,alphaPX), \
                              lkneesY=(lkneeTY,lkneePY),alphasY=(alphaTY,alphaPY))

            if polComb == 'EB' and delens:
                ls, Nls, efficiency = myNls.iterativeDelens(
                    polComb, delensTolerance, halo)
                print "percentage efficiency ", efficiency, " %"
            else:
                ls, Nls = myNls.getNl(polComb=polComb, halo=halo)

            pl.add(ls, Nls, label=str(beamX))
            #pl.add(myNls.N.cents,myNls.N.wxy,label=str(beamX))

            LF = LensForecast()
            LF.loadKK(frange, Clkk, ls, Nls)
Example #4
0
pellmin = 2
pellmax = 3000

deg = 10.
px = 0.5
arc = deg*60.

bin_edges = np.arange(10,3000,10)

#theory = loadTheorySpectraFromCAMB(cambRoot,unlensedEqualsLensed=False,useTotal=False,lpad=9000)
lmap = lm.makeEmptyCEATemplate(raSizeDeg=arc/60., decSizeDeg=arc/60.,pixScaleXarcmin=px,pixScaleYarcmin=px)
print lmap.data.shape
myNls = NlGenerator(lmap,theory,bin_edges,gradCut=gradCut)

myNls.updateNoise(beam,noiseT,noiseP,tellmin,tellmax,pellmin,pellmax)

#polCombList = ['TT','EE','ET','TE','EB','TB']
#colorList = ['red','blue','green','cyan','orange','purple']
polCombList = ['TT','EE','ET','EB','TB']
colorList = ['red','blue','green','orange','purple']
ellkk = np.arange(2,9000,1)
Clkk = theory.gCl("kk",ellkk)    


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):
    ls,Nls = myNls.getNl(polComb=polComb,halo=halo)
Example #5
0
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)

    pl = Plotter(scaleY='log')
    pl.add(ells,Nells*ells**2.*TCMB**2.)
    pl.add(ells,Nells*ells**2.*TCMB**2.)
    tells,tnlstt = np.loadtxt('data/louisCls.dat',delimiter=',',unpack=True)
    pl.add(tells,tnlstt)
    pl.done("output/compnl.png")
    sys.exit()