Example #1
0
                    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
                            == 'TB') and (delensTolerance is not None):
                        ls, Nls = myNls.iterativeDelens(
                            polComb, delensTolerance, halo)
Example #2
0
                               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'
        huell, hunl = np.loadtxt(huFile, unpack=True, delimiter=',')
    except:
        huFile = 'data/hu_' + polComb[::-1].lower() + '.csv'
        huell, hunl = np.loadtxt(huFile, unpack=True, delimiter=',')

    pl.add(Ls,
           4. * crosses[polComb + polComb] / 2. / np.pi,
           color=col,
           label=polComb)
    #pl.add(Ls,4.*Nls[polComb]/2./np.pi,color=col,alpha=0.2)
    pl.add(lsold, 4. * Nlsold / 2. / np.pi, color=col, alpha=1.0, ls="-.")
    #pl.add(huell,hunl,ls='--',color=col)