CosmoFit.cosmology.SoundHorizon

class CosmoFit.cosmology.SoundHorizon(cosmology)[source]

Bases: object

The sound horizon at the drag epoch for a given cosmology.

Parameters:

cosmology (Cosmology) – Reads Omega_m, Omega_b, H0, N_eff and m_nu. Nothing else – r_d is blind to the dark-energy model and to curvature (see the module docstring).

Notes

rd returns the free parameter unless the cosmology has compute_rd set, in which case it returns rd_computed(). rd_computed() is always available regardless, so the computed value can be compared against a fitted one without changing how a fit behaves.

Results are cached on the physical densities they depend on, so the BAO likelihoods – which ask for rd once per data point – pay for the integral once per MCMC step rather than thirteen times.

__init__(cosmology)[source]

Methods

__init__(cosmology)

hubble_over_h100(a)

H(a) / (100 km/s/Mpc) in the pre-recombination universe: photons, neutrinos and cold matter.

omega_nu_of_a(a)

Total neutrino density (massless plus massive) at scale factor a, as it enters H(a)^2 / H_100^2.

rd_computed()

The sound horizon at the drag epoch [Mpc], computed from the physical densities.

sound_horizon([z, n_grid, decades])

Comoving sound horizon [Mpc] at redshift z,

sound_speed(a)

Baryon-photon sound speed [km/s],

summary()

z_drag, r_d, and the densities they came from, in one dict -- for checking a fit's early-universe sector without reconstructing the calculation by hand.

z_drag()

Redshift of the baryon drag epoch, from a fit calibrated against CAMB (see _ZDRAG_COEF).

z_drag_eh98()

Drag-epoch redshift from the Eisenstein & Hu (1998) Eq.

Attributes

h

Reduced Hubble constant, H0 / 100.

n_massive

one carrying the whole of Sum m_nu (CAMB's degenerate default), or zero when m_nu = 0.

omega_b

Physical baryon density, Omega_b h^2.

omega_cb

Physical cold-matter density, (Omega_c + Omega_b) h^2.

omega_gamma

Physical photon density, from T_CMB.

omega_nu

Present-day massive-neutrino density, Omega_nu h^2.

rd

the free rd parameter by default, or rd_computed() when the cosmology has compute_rd set.