API¶
The Cosmology object¶
Methods that return various cosmological parameters:
-
class
pyRSD.pygcl.
Cosmology
(*args)¶ Proxy of C++ Cosmology class.
-
H0
()¶ the present-day Hubble constant in units of km/s/Mpc
-
h
()¶ the dimensionless Hubble constant
-
Tcmb
()¶ CMB temperature today in Kelvin
-
Omega0_b
()¶ present-day baryon density parameter
-
Omega0_cdm
()¶ present-day cold dark matter density fraction
-
Omega0_ur
()¶ present-day ultra-relativistic neutrino density fraction
-
Omega0_m
()¶ present-day non-relativistic density fraction
-
Omega0_r
()¶ present-day relativistic density fraction
-
Omega0_g
()¶ present-day photon density fraction
-
Omega0_lambda
()¶ present-day cosmological constant density fraction
-
Omega0_fld
()¶ present-day dark energy fluid density fraction (valid if Omega0_lambda is unspecified)
-
Omega0_k
()¶ present-day curvature density fraction
-
w0_fld
()¶ present-day fluid equation of state parameter
-
wa_fld
()¶ present-day equation of state derivative
-
n_s
()¶ the spectral index of the primordial power spectrum
-
k_pivot
()¶ the pivot scale in 1/Mpc
-
A_s
()¶ scalar amplitude = curvature power spectrum at pivot scale
-
ln_1e10_A_s
()¶ convenience function returns log (1e10*A_s)
-
sigma8
()¶ convenience function to return sigma8 at z = 0
-
k_max
()¶ maximum k value computed in h/Mpc
-
k_min
()¶ minimum k value computed in h/Mpc
-
z_drag
()¶ the baryon drag redshift
-
rs_drag
()¶ the comoving sound horizon at the baryon drag redshifts
-
tau_reio
()¶ the reionization optical depth
-
z_reio
()¶ the redshift of reionization
-
rho_crit
(cgs=False)¶ the critical density at z = 0 in units of h^2 M_sun / Mpc^3 if cgs = False, or in units of h^2 g / cm^3
-
EvaluateTransfer
(Cosmology self, double k) → double¶
-
Methods that return background quantities as a function of redshift:
pyRSD.pygcl.
f_z
(z)¶the logarithmic growth rate, dlnD/dlna, at z
pyRSD.pygcl.
H_z
(z)¶the Hubble parameter at z in km/s/Mpc
pyRSD.pygcl.
Da_z
(z)¶the angular diameter distance to z in Mpc – this is Dm/(1+z)
pyRSD.pygcl.
Dc_z
(z)¶the conformal distance to z in the flat case in Mpc
pyRSD.pygcl.
Dm_z
(z)¶the comoving radius coordinate in Mpc, which is equal to the conformal distance in the flat case
pyRSD.pygcl.
D_z
(z)¶the growth function D(z) / D(0) (normalized to unity at z = 0)
pyRSD.pygcl.
Sigma8_z
(z)¶the scalar amplitude at z, equal to sigma8 * D(z)
pyRSD.pygcl.
Omega_m_z
(z)¶Omega0_m as a function of z
pyRSD.pygcl.
rho_bar_z
(z, cgs=False)¶the mean matter density in units of h^2 M_sun / Mpc^3 if cgs = False, or in units of g / cm^3
pyRSD.pygcl.
rho_crit_z
(z, cgs=False)¶the critical matter density in units of h^2 M_sun / Mpc^3 if cgs = False, or in units of g / cm^3
pyRSD.pygcl.
dV
(z)¶the comoving volume element per unit solid angle per unit redshift in Gpc^3
pyRSD.pygcl.
V
(zmin, zmax, Nz=1024)¶the comoving volume between two redshifts (full sky)
Power spectrum objects¶
-
class
pyRSD.pygcl.
LinearPS
(*args)¶ Proxy of C++ LinearPS class.
Compute the linear power spectrum, using CLASS
-
__init__
(pygcl.Cosmology cosmo, float z=0)¶ initialize the linear power spectrum for a given cosmology and redshift
-
__call__
(k)¶ evaluate the linear power spectrum at the wavenumber
k
, wherek
is in units of \(h/\mathrm{Mpc}\)
-
SetSigma8AtZ
(sigma8_z)¶ set the normalization of the power spectrum via setting \(\sigma_8(z)\)
-
-
class
pyRSD.pygcl.
ZeldovichP00
(*args)¶ Proxy of C++ ZeldovichP00 class.
Compute the density auto power spectrum in the Zel’dovich approximation
-
__init__
(pygcl.Cosmology cosmo, float z, bool approx_lowk=False)¶ initialize the class for a given cosmology and redshift; if
approx_lowk
is True, use a lowk
approximation of the Zel’dovich approximation
-
__call__
(k)¶ evaluate the Zel’dovich power spectrum at the wavenumber
k
, wherek
is in units of \(h/\mathrm{Mpc}\)
-
SetSigma8AtZ
(sigma8_z)¶ set the normalization of the power spectrum via setting \(\sigma_8(z)\)
-
-
class
pyRSD.pygcl.
ZeldovichP01
(*args)¶ Proxy of C++ ZeldovichP01 class.
Compute the density - radial momentum cross power spectrum in the Zel’dovich approximation
-
__init__
(pygcl.Cosmology cosmo, float z, bool approx_lowk=False)¶ initialize the class for a given cosmology and redshift; if
approx_lowk
is True, use a lowk
approximation of the Zel’dovich approximation
-
__call__
(k)¶ evaluate the Zel’dovich power spectrum at the wavenumber
k
, wherek
is in units of \(h/\mathrm{Mpc}\)
-
SetSigma8AtZ
(sigma8_z)¶ set the normalization of the power spectrum via setting \(\sigma_8(z)\)
-
-
class
pyRSD.pygcl.
ZeldovichP11
(*args)¶ Proxy of C++ ZeldovichP11 class.
Compute the radial momentum auto power spectrum in the Zel’dovich approximation
-
__init__
(pygcl.Cosmology cosmo, float z, bool approx_lowk=False)¶ initialize the class for a given cosmology and redshift; if
approx_lowk
is True, use a lowk
approximation of the Zel’dovich approximation
-
__call__
(k)¶ evaluate the Zel’dovich power spectrum at the wavenumber
k
, wherek
is in units of \(h/\mathrm{Mpc}\)
-
SetSigma8AtZ
(sigma8_z)¶ set the normalization of the power spectrum via setting \(\sigma_8(z)\)
-
Correlation function objects¶
-
class
pyRSD.pygcl.
CorrelationFunction
(*args)¶ Proxy of C++ CorrelationFunction class.
Compute the linear correlation function by Fourier transforming the linear power spectrum
-
__init__
(pygcl.LinearPS plin, kmin=1e-4, kmax=10)¶ initialize the class from a linear power spectrum object;
kmin
andkmax
correspond to the limits of the numerical integration when doing the Fourier transform.
-
__call__
(r)¶ evaluate the correlation function at the separation
r
, wherer
is in units of \(\mathrm{Mpc}/h\)
-
-
class
pyRSD.pygcl.
ZeldovichCF
(*args)¶ Proxy of C++ ZeldovichCF class.
Compute the density auto correlation function in the Zel’dovich approximation
-
__init__
(pygcl.Cosmology cosmo, float z, kmin=1e-4, kmax=10)¶ initialize the class for a given cosmology and redshift;
kmin
andkmax
correspond to the limits of the numerical integration when doing the Fourier transform.
-
__call__
(r)¶ evaluate the Zel’dovich correlation function at the separation
r
, wherer
is in units of \(\mathrm{Mpc}/h\)
-
SetSigma8AtZ
(sigma8_z)¶ set the normalization of the correlation function via setting \(\sigma_8(z)\)
-