Exemple #1
0
    if dispersion: 
      fact = 1
    else:
      fact = np.sqrt(len(y[ok]))
    dy[i] = np.std(y[ok])/fact
  if plot: errorbar(xc, yval, xerr=dx, yerr=dy, fmt=fmt)
  return xc, yval, dx, dy




xmax = 4000 #Mpc
nnx= 3000

theseed=3
lightcone_cst = ln.lightcone_1d(xmax, nnx, seed=theseed, pklib=pklib, omegam=(omegac+omegab)/h2)
lightcone_cst.alldelta = lightcone_cst.alldelta * 0 + 1

clf()
plot(lightcone_cst.xx, lightcone_cst(0, lightcone_cst.xx))
ylim(0,2)

zrec_cst = inhodist.x2z_inho_lightcone(lightcone_cst, h)

theseed=None
lightcone = ln.lightcone_1d(xmax, nnx, seed=theseed, pklib=pklib, omegam=(omegac+omegab)/h2, smoothing=None)
clf()
plot(lightcone.xx, lightcone.alldelta[0,:])
np.mean(lightcone.alldelta[0,:])

Exemple #2
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)

nbvals = 2**19
zz = linspace(0, zmax*0.99, nbvals)
dd = np.interp(zz, thezinit, dinit)


fg = cosmolopy.perturbation.fgrowth(lightcone.z, 0.3)
clf()
plot(lightcone.z, lightcone.allvar)
plot(lightcone.z, fg**2*lightcone.allvar[0]/(fg[0]**2))
yscale('log')