コード例 #1
0
# In[3]:

#Cosmological Models:
#               Same cosmology represented differently
M000 = FCPL(H0 = 71. ,Om0  = 0.26479, Ob0 = 0.044793, ns = 0.963, As = 2.16e-9)
M000s  = FCPL(H0 = 71., Om0 = 0.26479, Ob0 = 0.044793, ns = 0.963, sigma8 = 0.8)
#
M000n1 = FCPL(H0 = 71., Om0 = 0.26479, Ob0 = 0.044793, ns = 0.963, sigma8 = 0.8, sigmamnu=0.94) 


# In[4]:

#powerspectrum 
#use power spectrum from CAMB power spectrum output
psfrompk = psu.powerspectrum(koverh = None, asciifile = pkfile)
#use matter power spectrum from CAMB transfer function output, with As
psfromtkm = psu.powerspectrum(koverh = None, pstype ="matter", asciifile =tkfile, cosmo = M000)
#use matter power spectrum from CAMB transfer function output, with sigma8
psfromtkms = psu.powerspectrum(koverh = None, pstype ="matter", sigma8type = "matter", asciifile =tkfile, cosmo = M000s)
#use cb power spectrum from CAMB transfer function output, normalized to matter
psfromtkcbs = psu.powerspectrum(koverh = None, pstype ="cb", sigma8type = "matter", asciifile =tkfile, cosmo = M000s)
#use cb power spectrum from CAMB transfer function output, normalized to cb
psfromtkcbscb = psu.powerspectrum(koverh = None, pstype ="cb", sigma8type = "cb", asciifile =tkfile, cosmo = M000s)
#
#psfrompkn = psu.powerspectrum(koverh = None, asciifile  = npkfile)
#psfromtknm = psu.powerspectrum(koverh = None, asciifile  = ntkfile, pstype ="matter", cosmo = M000n1)


# In[5]:
コード例 #2
0
tkfile  = dirn +"example_data/M000/m000n0_transfer_fin_out.dat"
pkfile = dirn + "example_data/M000/m000n0_matterpower_fin.dat"
#psrunfile = "/home/rbiswas/doc/CAMB_outs/m000r03/m000r03_matterpower_fin.dat"

M000 = FCPL(H0 = 71. ,Om0  = 0.2647, Ob0 = 0., ns = 0.963, As = 2.16e-9)
M000s = FCPL(H0 = 71. ,Om0  = 0.2647, Ob0 = 0., ns = 0.963, sigma8 = 0.8)
M000p = FCPL(H0 = 71. ,Om0  = 0.3647, Ob0 = 0.0, ns = 0.963, As = 2.16e-9)

Tks = cio.loadtransfers(filename = tkfile)
k = Tks[:,0]
Tk = Tks[:,-1]
sumanrhoc    = 2.77536627e11
sumannorm    = fs.Pk_norm(sigma8 = 0.8, ns = 0.963, k = k , Tk=Tk, hubble= 0.71)

	#working power spectrum example
psfrompk = psu.powerspectrum(koverh = None, asciifile =pkfile)
	#working transfer function example
psfromtk = psu.powerspectrum(koverh = None, pstype ="cb", asciifile =tkfile, cosmo = M000)
psfromtkm = psu.powerspectrum(koverh = None, pstype ="matter", asciifile =tkfile, cosmo = M000)
psfromtkms = psu.powerspectrum(koverh = None, pstype ="matter", asciifile =tkfile, cosmo = M000s)
psfromtkcbs = psu.powerspectrum(koverh = None, pstype ="cb", asciifile =tkfile, cosmo = M000s)
psfromtkcbscb = psu.powerspectrum(koverh = None, pstype ="cb",sigma8ype= "cb", asciifile =tkfile, cosmo = M000s)
#psfromtkcbscb = psu.powerspectrum(koverh = None, pstype ="cb", asciifile =tkfile, cosmo = M000s)
#print  len(psfromtk), "now"
pscompfig, pscomp_ax0, pscomp_ax1 = pu.settwopanel(setdifflimits = [0.99,1.01])
#pscompfig, pscomp_ax0, pscomp_ax1 = pu.settwopanel(setdifflimits = None)
pscomp_ax0.loglog(psfromtk[0], psfromtk[1], label = "TKcb As=2.16e-9")
pscomp_ax0.loglog(psfromtkm[0], psfromtkm[1], label = "TKm, As = 2.16e-9")
pscomp_ax0.loglog(psfromtkms[0], psfromtkms[1], label = "TKm, sigma8 =0.8")
pscomp_ax0.loglog(psfromtkcbs[0], psfromtkcbs[1], label = "TKcb, sigma8 =0.8")
pscomp_ax0.loglog(psfromtkcbscb[0], psfromtkcbscb[1], label = "TKcb, sigma8 cb =0.8")