def run(self): """ create an inifile from the parameters and run camb on it and store the results in k,pk """ self.printIniFile() os.system(self.cambPath + "/camb " + self.iniName) self.k, self.pk = utils.readColumns(self.cp.output_root + "_matterpower.dat") self.logk, self.logpk = M.log(self.k), M.log(self.pk) self.pkSplineCoeff = SS.cspline1d(self.logpk)
def plotCl(ob=0.05): from pylab import loglog,show #z = M.arange(0.0005,0.5,0.0005) #dNdz = calcdNdz2mass(z) tamas = utils.readColumns("simit3n.dndz") z = tamas[0] dNdz = tamas[1] dNdz = dNdz/utils.trapz(dNdz,z) c = pt.Camb( hubble=70, omega_cdm=0.3-ob, omega_baryon=ob, w=-1.0,transfer_kmax=500, use_physical='F',do_nonlinear=1) c.run() dist = frw.Distance(c.cp,zmax=1) l = M.arange(10.0,1000,1.0) cl = projectCl(l,c,dist,dNdz,z) loglog(l,l**2*cl) show()