clgg[zbin],
							   clkg_slash_binned[zbin],
							   clgg_slash_binned[zbin], lbmax=i) 
							   for i in xrange(1,clgg[zbin].size)]

# embed()

# exit()

cw = '#E9724C'
cnow = '#255F85'

z_ = np.logspace(-4,3,1000)
cosmo_ = Cosmo(Giannantonio15Params)

d0 = cosmo_.D_z_norm(z_)   
s8 = cosmo_.sigma_Rz(8./cosmo_.h)  
om = cosmo_.omegam


def D_z_norm(z, omegam, gamma=0.55):
	if np.isscalar(z) or (np.size(z) == 1):
		def func(x, omegam, gamma): 
			return f_z(x, omegam=omegam, gamma=gamma)/(1+x)
		return np.exp( -integrate.quad( func, 0, z, args=(omegam,gamma,))[0])
	else:
		return np.asarray([ D_z_norm(tz, omegam, gamma=gamma) for tz in z ])

def f_z(z, omegam, gamma=0.55): # [unitless]
	return (omegam*(1+z)**3/E_z(z, omegam)**2)**gamma
Example #2
0
# D_G errors from sims
dgs_err = [np.std(GetAllDg(clkg_sims['sims'],clgg_sims['sims'],clkg_slash_binned,clgg_slash_binned, err_kg=np.std(clkg_sims[zbin]['sims'], axis=(0)), err_gg=np.std(clgg_sims[zbin]['sims'], axis=(0)),lbmax=i)) for i in xrange(2,clkg_slash_binned.size+1)]
dgs_err_nl = [np.std(GetAllDg(clkg_sims['sims'],clgg_sims['sims'],clkg_slash_binned_nl,clgg_slash_binned_nl, err_kg=np.std(clkg_sims[zbin]['sims'], axis=(0)), err_gg=np.std(clgg_sims[zbin]['sims'], axis=(0)),lbmax=i)) for i in xrange(2,clkg_slash_binned.size+1)]

# D_G Data 
dgs_data = [GetDg(clkg,clgg,clkg_slash_binned,clgg_slash_binned,err_kg=err_clkg, err_gg=err_clgg, lbmax=i) for i in xrange(2,clgg.size+1)]
dgs_data_nl = [GetDg(clkg,clgg,clkg_slash_binned_nl,clgg_slash_binned_nl, err_kg=err_clkg, err_gg=err_clgg,lbmax=i) for i in xrange(2,clgg.size+1)]


DNDZ = dNdzInterpolation(z, nz, bins=[zmin,zmax], sigma_zph=0.015, z_min=0, z_max=1)
zmed = DNDZ.z_med_bin(0)

fig, ax = plt.subplots(figsize=(5,5))
ax.set_title(r'2MPZ - $%.2f < z < %.2f$'%(zmin,zmax))
# plt.fill_between(lb[1:], [cosmo.D_z_norm(zmed) for i in xrange(len(lb[1:]))]+np.asarray(dgs_err[zbin]), [cosmo.D_z_norm(zmed) for i in xrange(len(lb[1:]))]-np.asarray(dgs_err[zbin]),alpha=0.6, color='lightgrey', label=r'$1\sigma$ from sims')
ax.axhline(cosmo.D_z_norm(zmed), ls='--', color='k')#, label=r'$D_G(z_{\rm med}=%.3f)$'%zmed)
ax.errorbar([1,2], [dgs_data[lbmax],dgs_data_nl[lbmax]], yerr=[dgs_err[lbmax],dgs_err_nl[lbmax]], fmt='o')#, label='2MPZ Data')
ax.legend()
labels = ['Linear', 'Non-linear']#[str(ks) for ks in K_S_mins]
# ax.set_xticklabels(labels)
plt.xticks([1,2], labels)
ax.set_ylim(0.75,1.5)
ax.set_xlim(0.,3)
# ax.set_xlabel(r'Minimum $K_S$')#, size=15)
ax.set_ylabel(r'$D_G$')#, size=15)
plt.tight_layout()
# plt.savefig('plots/D_G_dl'+str(delta_ell)+'_lmin_'+str(lmin)+'_lmax'+str(lmax)+'_various_KS_min_KS_max_'+str(K_S_max)+'_nside256_2.pdf')
plt.show()
plt.close()

embed()
Example #3
0
# # ax.set_xticklabels(labels)
# plt.xticks([0,1,2,3], labels)
# ax.set_ylim(0.75,1.5)
# ax.set_xlabel(r'Minimum $K_S$')#, size=15)
# ax.set_ylabel(r'$D_G$')#, size=15)
# plt.tight_layout()
# # plt.savefig('plots/D_G_dl'+str(delta_ell)+'_lmin_'+str(lmin)+'_lmax'+str(lmax)+'_various_KS_min_KS_max_'+str(K_S_max)+'_nside256_2.pdf')
# plt.show()
# plt.close()

embed()

fig, ax = plt.subplots(figsize=(6, 5))
ax.set_title(r'2MPZ - $%.2f < z < %.2f$' % (zmin, zmax))
# plt.fill_between(lb[1:], [cosmo.D_z_norm(zmed) for i in xrange(len(lb[1:]))]+np.asarray(dgs_err[zbin]), [cosmo.D_z_norm(zmed) for i in xrange(len(lb[1:]))]-np.asarray(dgs_err[zbin]),alpha=0.6, color='lightgrey', label=r'$1\sigma$ from sims')
ax.axhline(cosmo.D_z_norm(zmed), ls='--',
           color='k')  #, label=r'$D_G(z_{\rm med}=%.3f)$'%zmed)
ax.errorbar(0,
            DGs[0],
            yerr=err_DGs[0],
            fmt='o',
            label='Fiducial',
            color='#083D77',
            ms=8)
ax.errorbar(1,
            DGs[-2],
            yerr=err_DGs[-2],
            fmt='s',
            label=r'$K_S^{\rm min}=12$',
            color='#8C2F39',
            ms=8)
Example #4
0
              clkg_slash_binned[zbin],
              clgg_slash_binned[zbin],
              lbmax=i) for i in xrange(1, clgg[zbin].size)
    ]

# embed()

# exit()

cw = '#E9724C'
cnow = '#255F85'

z_ = np.logspace(-4, 3, 1000)
cosmo_ = Cosmo(Giannantonio15Params)

d0 = cosmo_.D_z_norm(z_)
s8 = cosmo_.sigma_Rz(8. / cosmo_.h)
om = cosmo_.omegam


def D_z_norm(z, omegam, gamma=0.55):
    if np.isscalar(z) or (np.size(z) == 1):

        def func(x, omegam, gamma):
            return f_z(x, omegam=omegam, gamma=gamma) / (1 + x)

        return np.exp(-integrate.quad(func, 0, z, args=(
            omegam,
            gamma,
        ))[0])
    else:
     color=cnow,
     linewidth=0.0)  #, label=r'$1\sigma$ from sims w/o weights')
 plt.plot(lb[1:],
          dgs_data_uw[zbin],
          color=cnow,
          ls='-.',
          label='2MPZ Data (no weights)')
 plt.fill_between(
     lb[1:],
     dgs_data[zbin] + np.asarray(dgs_err[zbin]),
     dgs_data[zbin] - np.asarray(dgs_err[zbin]),
     alpha=0.2,
     color=cw,
     linewidth=0.0)  #, label=r'$1\sigma$ from sims w/o weights')
 plt.plot(lb[1:], dgs_data[zbin], color=cw, label='2MPZ Data')
 plt.axhline(cosmo_nl.D_z_norm(zmed),
             ls='--',
             color='k',
             label=r'$D_G(z_{\rm med}=%.2f)$' % zmed)
 # plt.axvline(180./np.rad2deg(1./cosmo_nl.k_NL(zmed)/cosmo_nl.f_K(zmed)),ls=':', color='darkgrey', label=r'$\ell_{\rm NL}(z_{\rm med}=%.2f)$'%zmed)
 plt.axvline(70,
             ls=':',
             color='darkgrey',
             label=r'$\ell_{\rm NL}(z_{\rm med}=%.2f)$' % zmed)
 # plt.axvline(cosmo_nl.k_NL(zmed)*cosmo_nl.f_K(zmed),ls=':', color='darkgrey', label=r'$\ell_{\rm NL}(z_{\rm med}=%.2f)$'%zmed)
 plt.legend(loc='upper right')
 plt.ylim(0.7, 2.2)
 plt.xlabel(r'$\ell_{\rm max}$')  #, size=15)
 # plt.xlabel(r'Maximum $L$-bin')#, size=15)
 # if i == 0:
 plt.ylabel(r'$D_G$')  #, size=15)