Exemplo n.º 1
0
Omegav = 0.
Omegak = 1. - Omegam - Omegav

print 'Omegab = ',omegab/h2,'Omegam = ',(omegac+omegab)/h2,'Omegav = ',Omegav, 'Omegak = ', Omegak

params = {'H0':H0,'omegab':Omegab,'omegac':Omegac,'omegak':Omegak,'scalar_index':0.9624,
         'reion__use_optical_depth':True,'reion__optical_depth':0.0925}


nz = 100
zmin = 0
zmax = 1100
# BUILD IT ###############################################################################
#pklib = ln.build_pklib(params, zmin, zmax, nz, extra_name='nolambda_',log=True)
# RESTORE IT ##############################################################################
pklib = ln.read_pklib(zmin, zmax, nz, extra_name = 'nolambda_')








def profile(x,y,range=None,nbins=10,fmt=None,plot=True, dispersion=True, median=False):
  if range == None:
    mini = np.min(x)
    maxi = np.max(x)
  else:
    mini = range[0]
    maxi = range[1]
Exemplo n.º 2
0
clf()
subplot(2,1,1)
errorbar(nbtry, allmeans, yerr=allerrmeans)
xscale('log')
subplot(2,1,2)
errorbar(nbtry, allvars, yerr=allerrvars)
xscale('log')

#### P(K) library at various redshifts 
nz = 100
zmin = 0
zmax = 1100
# BUILD IT ###############################################################################
#pklib = ln.build_pklib(params, zmin, zmax, nz)
# RESTORE IT ##############################################################################
pklib = ln.read_pklib(zmin, zmax, nz)

#### Skewers library with the same seed at different reshifts
# set the x range so that it extends well beyond the distance at maximum redshift
zvals = np.linspace(0,zmax,1000)
lcdm = cd.set_omega_k_0({'omega_M_0' : 0.3, 'omega_lambda_0' : 0.7, 'h' : 0.7})
d_lcdm = cd.comoving_distance_transverse(zvals, **lcdm)
maxd = np.max(d_lcdm)*1.2

theseed = 1
nn = 2**18
lightcone = ln.lightcone_1d(maxd, nn, pklib, seed=theseed)


thezinit = linspace(0,zmax, 10000)
dinit = cd.comoving_distance_transverse(thezinit, **lcdm)