CosmoFit.cosmology.SoundHorizon¶
- class CosmoFit.cosmology.SoundHorizon(cosmology)[source]¶
Bases:
objectThe sound horizon at the drag epoch for a given cosmology.
- Parameters:
cosmology (Cosmology) – Reads
Omega_m,Omega_b,H0,N_effandm_nu. Nothing else –r_dis blind to the dark-energy model and to curvature (see the module docstring).
Notes
rdreturns the free parameter unless the cosmology hascompute_rdset, in which case it returnsrd_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
rdonce per data point – pay for the integral once per MCMC step rather than thirteen times.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 entersH(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
hReduced Hubble constant,
H0 / 100.n_massiveone carrying the whole of
Sum m_nu(CAMB'sdegeneratedefault), or zero whenm_nu = 0.omega_bPhysical baryon density,
Omega_b h^2.omega_cbPhysical cold-matter density,
(Omega_c + Omega_b) h^2.omega_gammaPhysical photon density, from
T_CMB.omega_nuPresent-day massive-neutrino density,
Omega_nu h^2.rdthe free
rdparameter by default, orrd_computed()when the cosmology hascompute_rdset.