except: N2 = hmf.N_of_z_SZ(SZProf) * fsky np.savetxt("tempSigN.txt", hmf.sigN) pl = Plotter() pl.plot2d(hmf.sigN) pl.done(outDir + "signRefactor.png") pl = Plotter(scaleY='log') pl.add(zs, N1) pl.add(zs, N2) Ntot1 = np.trapz(N2, zs) print(Ntot1) sn, ntot = hmf.Mass_err(fsky, outmerr, SZProf) print(ntot) #q_arr = np.logspace(np.log10(6.),np.log10(500.),64) qs = [6., 500., 64] qbin_edges = np.logspace(np.log10(qs[0]), np.log10(qs[1]), int(qs[2]) + 1) q_arr = old_div((qbin_edges[1:] + qbin_edges[:-1]), 2.) dnqmz = hmf.N_of_mqz_SZ(outmerr, qbin_edges, SZProf) print((qbin_edges.shape)) print((dnqmz.shape)) N, Nofz = getTotN(dnqmz, Mexp_edges, z_edges, qbin_edges, returnNz=True) print((N * fsky))
#MM = 10**np.linspace(13.,14.,5) #print SZProfExample.quickVar(MM,zz,tmaxN=tmaxN,numts=numts) #sys.exit() #print z_edges #print HMF.N_of_z() Nzs = HMF.N_of_z_SZ(fsky,SZProfExample)*np.diff(z_edges) zcents = old_div((z_edges[1:]+z_edges[:-1]),2.) pl = Plotter() pl.add(zcents,Nzs) pl.done("nz.png") print((HMF.Mass_err(fsky,lndM*24.0,SZProfExample))) #print "quickvar " , np.sqrt(SZProfExample.quickVar(MM,zz,tmaxN=tmaxN,numts=numts)) #print "filtvar " , np.sqrt(SZProfExample.filter_variance(MM,zz)) #print "y_m",SZProfExample.Y_M(MM,zz) #R500 = cc.rdel_c(MM,zz,500.).flatten()[0] #print R500 #print cc.rhoc(0)
noise = listFromConfig(Config, experimentName, 'noises') freq = listFromConfig(Config, experimentName, 'freqs') lmax = int(Config.getfloat(experimentName, 'lmax')) lknee = Config.getfloat(experimentName, 'lknee') alpha = Config.getfloat(experimentName, 'alpha') fsky = Config.getfloat(experimentName, 'fsky') cosmoDict = dictFromSection(Config, cosmologyName) constDict = dictFromSection(Config, 'constants') clusterDict = dictFromSection(Config, clusterParams) cc = ClusterCosmology(cosmoDict, constDict, lmax) mass_err_file = Config.get(experimentName, 'mass_err') mass_err = np.loadtxt(mass_err_file) zbin_temp = np.arange(0.1, 2.01, 0.05) zbin = np.insert(zbin_temp, 0, 0.0) HMF = Halo_MF(clusterCosmology=cc) errs, Ntot = HMF.Mass_err(mass_err, zbin, beam, noise, freq, clusterDict, lknee, alpha, fileFunc) print((np.sqrt(errs))) print(Ntot) #HSC_mass = np.loadtxt('input/HSC_DeltalnM_z0_z1.txt',unpack=True) #HSC_mass = np.transpose(HSC_mass) #print np.shape(HSC_mass), np.shape(dndzdm)
N1 = hmf.N_of_z()*fsky hmf.sigN = siggrid N2 = hmf.N_of_z_SZ(SZProf)*fsky pl = Plotter(scaleY='log') pl.add(zs,N1) pl.add(zs,N2) Ntot0 = np.dot(N1,np.diff(z_edges)) Ntot1 = np.dot(N2,np.diff(z_edges)) print(("All clusters in the Universe ",Ntot0)) print(("All clusters detectable at qmin ",SZProf.qmin," is ",Ntot1)) sn,ntot = hmf.Mass_err(fsky,lndM,SZProf) outmerr = lndM print(("All clusters according to Mass_err ", ntot)) # get s/n q-bins qs = listFromConfig(Config,'general','qbins') qspacing = Config.get('general','qbins_spacing') if qspacing=="log": qbin_edges = np.logspace(np.log10(qs[0]),np.log10(qs[1]),int(qs[2])+1) elif qspacing=="linear": qbin_edges = np.linspace(qs[0],qs[1],int(qs[2])+1) else: raise ValueError q_arr = old_div((qbin_edges[1:]+qbin_edges[:-1]),2.)