freqs=freq, lknee=lknee, alpha=alpha) h = 0.05 # s80, As = getA(fparams,constDict,zrange,kmax=11.) # s8zs = As*s80 dNFid_dmzq = HMF.N_of_mqz_SZ(lndM * massMultiplier, qbins, SZProf) np.save(bigDataDir + "N_mzq_" + saveId + "_fid_sigma8", getNmzq(dNFid_dmzq, mgrid, zrange, qbins)) origPk = HMF.pk.copy() print("Calculating derivatives for overall power ...") HMF.pk = origPk.copy() HMF.pk[:, :] *= (1. + old_div(h, 2.))**2. dNUp_dmqz = HMF.N_of_mqz_SZ(lndM * massMultiplier, qbins, SZProf) Nup = getNmzq(dNUp_dmqz, mgrid, zrange, qbins) HMF.pk = origPk.copy() HMF.pk[:, :] *= (1. - old_div(h, 2.))**2. dNDn_dmqz = HMF.N_of_mqz_SZ(lndM * massMultiplier, qbins, SZProf) Ndn = getNmzq(dNDn_dmqz, mgrid, zrange, qbins) dNdp = old_div((Nup - Ndn), h) param = "S8All" np.save(bigDataDir + "Nup_mzq_" + saveId + "_" + param, Nup) np.save(bigDataDir + "Ndn_mzq_" + saveId + "_" + param, Ndn)
Config.optionxform = str Config.read(iniFile) lmax = 3000 cosmoDict = dictFromSection(Config, cosmologyName) constDict = dictFromSection(Config, 'constants') clusterDict = dictFromSection(Config, clusterParams) cc = ClusterCosmology(cosmoDict, constDict, lmax, pickling=True) HMF = Halo_MF(cc) cambOutFile = lambda i: "/home/msyriac/software/CAMB_wa/testWaFid_matterpower_" + str( i) + ".dat" zrange = np.arange(0., 3.05, 0.05) kh, z, pk, s8 = HMF.pk(zrange) #pl = Plotter(scaleY='log',scaleX='log') pl = Plotter() Nzs = pk.shape[0] for i, z in enumerate(zrange[::-1]): kh_camb, P_camb = np.loadtxt(cambOutFile(i), unpack=True) if i == 0: kmin = max(kh_camb[0], kh[0]) kmax = min(kh_camb[-1], kh[-1]) keval = np.logspace(np.log10(kmin), np.log10(kmax), 20)