Beispiel #1
0
 def power_lin_nw(self):
     """
     A 'pygcl.LinearPS' object holding the linear power spectrum at z = 0,
     using the Eisenstein-Hu no-wiggle transfer function
     """
     cosmo = self.cosmo.clone(tf=pygcl.transfers.EH_NoWiggle)
     return pygcl.LinearPS(cosmo, 0.)
Beispiel #2
0
 def power_lin(self):
     """
     A 'pygcl.LinearPS' object holding the linear power spectrum at z = 0
     """
     return pygcl.LinearPS(self.cosmo, 0.)
Beispiel #3
0
def pygcl_overview(*args):

    from pyRSD.rsd.cosmology import Planck15
    from pyRSD import pygcl

    class_cosmo = Planck15.to_class()

    # initialize at z = 0
    Plin = pygcl.LinearPS(class_cosmo, 0)

    # renormalize to different SetSigma8AtZ
    Plin.SetSigma8AtZ(0.62)

    # evaluate at k
    k = numpy.logspace(-2, 0, 100)
    Pk = Plin(k)

    # plot
    plt.loglog(k, Pk, c='k')

    # format
    plt.xlabel(r"$k$ $[h \mathrm{Mpc}^{-1}]$", fontsize=10)
    plt.ylabel(r"$P$ $[h^{-3} \mathrm{Mpc}^3]$", fontsize=10)
    savefig("Plin_plot.png")

    # density auto power
    P00 = pygcl.ZeldovichP00(class_cosmo, 0)

    # density - radial momentum cross power
    P01 = pygcl.ZeldovichP01(class_cosmo, 0)

    # radial momentum auto power
    P11 = pygcl.ZeldovichP11(class_cosmo, 0)

    # plot
    k = numpy.logspace(-2, 0, 100)
    plt.loglog(k, P00(k), label=r'$P_{00}^\mathrm{zel}$')
    plt.loglog(k, P01(k), label=r'$P_{01}^\mathrm{zel}$')
    plt.loglog(k, P11(k), label=r'$P_{11}^\mathrm{zel}$')

    # format
    plt.legend(loc=0)
    plt.xlabel(r"$k$ $[h \mathrm{Mpc}^{-1}]$", fontsize=10)
    plt.ylabel(r"$P$ $[h^{-3} \mathrm{Mpc}^3]$", fontsize=10)
    savefig("Pzel_plot.png")

    # linear correlation function
    CF = pygcl.CorrelationFunction(Plin)

    # Zeldovich CF at z = 0.55
    CF_zel = pygcl.ZeldovichCF(class_cosmo, 0.55)

    # plot
    r = numpy.logspace(0, numpy.log10(150), 1000)
    plt.plot(r, r**2 * CF(r), label=r'$\xi^\mathrm{lin}$')
    plt.plot(r, r**2 * CF_zel(r), label=r'$\xi^\mathrm{zel}$')

    # format
    plt.legend(loc=0)
    plt.xlabel(r"$r$ $[h^{-1} \mathrm{Mpc}]$", fontsize=10)
    plt.ylabel(r"$r^2 \xi$ $[h^{-2} \mathrm{Mpc}^{2}]$", fontsize=10)
    savefig("cf_plot.png")