rabacus.cosmology package

Submodules

rabacus.cosmology.general module

A general FLRW cosmology module. Assumes a spatially flat universe.

class rabacus.cosmology.general.Cosmology(cpdict, verbose=False, zlo=0.0, zhi=200.0, Nz=500)[source]

Bases: object

General Cosmology Class. Assumes a spatialy flat universe.

Args:

cpdict (dict) A dictionary of cosmological parameters. For example, see PlanckParameters.
The dictionray cpdict must include the following keys,
  • omegam -> current matter density in units of critical today
  • omegal -> current lambda density in units of critical today
  • omegab -> current baryon density in units of critical today
  • h -> Hubble parameter H0 = 100 h km/s/Mpc
  • sigma8 -> amplitude of fluctuations in spheres w/ R = 8 Mpc/h
  • ns -> slope of primordial power spectrum
  • Yp -> primordial mass fraction of helium

Attributes:

H0 (real): hubble parameter now, H_0.

OmegaB (real): baryon density / critical density now, \Omega_b

OmegaC (real): cold dark matter density / critical density now, \Omega_c

OmegaL (real): dark energy density / critical density now, \Omega_{\Lambda}

OmegaM (real): matter density / critical density now, \Omega_m

Yp (real): primoridial helium mass fraction, Y_p

cu (CosmoUnits): cosmological units which are aware of the hubble parameter.

dH0 (real): hubble distance now, d_{\rm H_0} = c / H_0

tH0 (real): hubble time now, t_{\rm H_0} = 1 / H_0

rho_crit0 (real): critical density now, \rho_{c,0} = (3 H_0^2) / (8 \pi G)

eps_crit0 (real): critical energy density now, \epsilon_{c,0} = \rho_{c,0} \, c^2

nH_crit0 (real): critical hydrogen number density now, n_{\rm H,c,0} = \rho_{c,0} \, \Omega_b \, (1-Y_p) \, /  \, 
m_{\rm H}

D1a(a)[source]

Linear growth function D1(a).

D_1(a) \propto H(a) \int_0^a \frac{da'}{a'^3 H(a')^3}

The normalization is such that D1a(1) = 1

D1z(z)[source]

Linear growth function D1(z)

D_1(z) \propto H(z) \int_z^\infty \frac{1+z'}{H(z')^3} dz'

The normalization is such that D1z(0) = 1

Dc_at_tL(tL)[source]

Comoving distance at a given lookback time, Dc(tL). First finds a redshift z by inverting the function tLz() using tabulated values. Second, calls Dcz() to get a comoving distance from z.

z = {\rm Inverse}[ t_L(z) ] \\
D_C(z) = d_{\rm H_0} \int_{0}^{z} \frac{dz'}{E(z')}

Dca(a)[source]

Comoving distance between a=1 and a, Dc(a). The scale factor a is converted to redshift z and then Dcz() is called.

D_C(a) = d_{\rm H_0} \int_{a}^{1} \frac{da'}{a'^2 E(a')}

Dcz(z)[source]

Comoving distance between z=0 and z, Dc(z)

D_C(z) = d_{\rm H_0} \int_{0}^{z} \frac{dz'}{E(z')}

Ea(a)[source]

Helper function H(a) = H0 * E(a)

E(a) = ( \Omega_R a^{-4} + \Omega_M a^{-3} + \Omega_{\Lambda} )^{1/2}

Ez(z)[source]

Helper function H(z) = H0 * E(z)

E(z) = [ \Omega_R (1+z)^{4} + \Omega_M (1+z)^{3} + 
\Omega_{\Lambda} ]^{1/2}

Ha(a)[source]

Hubble parameter at scale factor a, H(a) = H0 * E(a)

H(a) = H_0 E(a)

Hz(z)[source]

Hubble parameter at redshift z, H(z) = H0 * E(z)

H(z) = H_0 E(z)

X(z1, z2)[source]

Absorption distance between z1 and z2,

X(z1,z2) = \int_{z1}^{z2} dz' (1+z')^2 / E(z')

dHa(a)[source]

Hubble distance at scale factor a, dH(a)

d_{\rm H(a)} = c / H(a)

dHz(z)[source]

Hubble distance at redshift z, dH(z)

d_{\rm H(z)} = c / H(z)

da2dDc(a1, a2)[source]

Comoving distance between a1 and a2. The scale factors a1 and a2 are converted to redshifts z1 and z2 and then dz2dDc() is called. a1 < a2 produces positive comoving distance.

D_C(a1,a2) = d_{\rm H_0} \int_{a1}^{a2} \frac{da'}{a'^2 E(a')}

da2dtL(a1, a2)[source]

Lookback time between a1 and a2. Two calls to tLa() are made and the results subtracted. a1 < a2 produces positive lookback time.

t_{\rm L}(a1,a2) = \int_{a1}^{a2} \frac{da'}{a' H(a')}

dz2dDc(z1, z2)[source]

Comoving distance between z1 and z2. Two calls to Dcz() are made and the results subtracted. z1 < z2 produces positive comoving distance.

D_C(z1,z2) = d_{\rm H_0} \int_{z1}^{z2} \frac{dz'}{E(z')}

dz2dtL(z1, z2)[source]

Lookback time between z1 and z2. The redshifts z1 and z2 are converted to scale factors and then da2dtL() is called. z1 < z2 produces positive lookback time.

t_{\rm L}(z1,z2) = \int_{z1}^{z2} \frac{dz'}{(1+z') H(z')}

eps_crita(a)[source]

Critical energy density at scale factor a, eps_crit(a)

\epsilon_{c,a} = \epsilon_{c,0} \,  E(a)^2

eps_critz(z)[source]

Critical energy density at redshift z, eps_crit(z)

\epsilon_{c,z} = \epsilon_{c,0} \,  E(z)^2

iEa(a)[source]

Reciprocal of Ea().

E(a) = ( \Omega_R a^{-4} + \Omega_M a^{-3} + 
\Omega_{\Lambda} )^{-1/2}

iEz(z)[source]

Reciprocal of Ez().

E(z) = [ \Omega_R (1+z)^{4} + \Omega_M (1+z)^{3} + 
\Omega_{\Lambda} ]^{-1/2}

nH_crita(a)[source]

Critical hydrogen number density at scale factor a, nH_crit(a)

n_{\rm H,c,a} =  n_{\rm H,c,0}  \,  E(a)^2

nH_critz(z)[source]

Critical hydrogen number density at redshift z, nH_crit(z)

n_{\rm H,c,z} =  n_{\rm H,c,0}  \,  E(z)^2

rho_crita(a)[source]

Critical mass density at scale factor a, rho_crit(a)

\rho_{c,a} = \rho_{c,0} \,  E(a)^2

rho_critz(z)[source]

Critical mass density at redshift z, rho_crit(z)

\rho_{c,z} = \rho_{c,0} \,  E(z)^2

tHa(a)[source]

Hubble time at scale factor a, tH(a)

t_{\rm H(a)} = 1 / H(a)

tHz(z)[source]

Hubble time at redshift z, tH(z)

t_{\rm H(z)} = 1 / H(z)

tL_at_Dc(Dc)[source]

Lookback time at a given comoving distance, tL(Dc). First finds a redshift z by inverting the function Dcz() using tabulated values. Second, calls tLz() to get a lookback time from z.

z = {\rm Inverse}[ D_C(z) ] \\
t_L(z) = \int_0^z \frac{dz'}{(1+z') H(z')}

tLa(a)[source]

Lookback from a = 1 to a, tL(a).

t_{\rm L}(a) = \int_a^1 \frac{da'}{a' H(a')}

tLz(z)[source]

Lookback from z = 0 to z, tL(z).

t_{\rm L}(z) = \int_0^z \frac{dz'}{(1+z') H(z')}

ta(a)[source]

Time since a=0 or age of the Universe, t(a).

t(a) = \int_0^a \frac{da'}{a' H(a')}

tz(z)[source]

Time since z=inf or age of the Universe t(z).

t(z) = \int_z^\infty \frac{dz'}{(1+z') H(z')}

z_at_Dc(Dc)[source]

Redshift at a given comoving distance, z(Dc). Inverts the function Dcz() by interpolating between tabulated values.

z(D_C) = {\rm Inverse}[ D_C(z) ]

z_at_tL(tL)[source]

Redshift at a given lookback time, z(tL). Inverts the function tLz() by interpolating between tabulated values.

z(t_L) = {\rm Inverse}[ t_L(z) ]

rabacus.cosmology.jeans module

A general Jeans scale module.

class rabacus.cosmology.jeans.Jeans(Yp=0.248, fg=0.154, gamma=1.6666666666666667)[source]

A Jeans scale class.

Provides access to Jeans scales functions. Default values for Yp and fg are taken from Planck Cosmological Parameters

Yp = 0.248 fg = Omega_b / Omega_m = 0.154

Args:

Kwargs:

Yp (float): helium mass fraction

fg (float): gas fraction

gamma (float): ratio of specific heats

L(nH, T, mu)[source]

Jeans length

Args:

nH (float): hydrogen number density

T (float): temperature

mu (float): mean molecular weight

NH(nH, T, mu)[source]

Jeans column density

Args:

nH (float): hydrogen number density

T (float): temperature

mu (float): mean molecular weight

cs(T, mu)[source]

Sound speed

Args:

T (float): temperature

mu (float): mean molecular weight

mu(xH2, xHe2, xHe3)[source]

Mean molecular weight, i.e. the mean mass of an ion in atomic mass units, as a function of ionization state.

Args:

xH2 (float): nHII / nH

xHe2 (float): nHeII / nHe

xHe3 (float): nHeIII / nHe

t_dyn(nH)[source]

Dynamical time

Args:

nH (float): number density of hydrogen
t_sc(L, T, mu)[source]

Sound crossing time.

Args:

L (float): length scale

T (float): temperature

mu (float): mean molecular weight

Module contents

A package for handling cosmological variables and calculations. The most fundamental being the Cosmology class.