def test_cosmology_sane(): c = Cosmology(gauge='synchronous', verbose=True) assert_allclose(c.Omega_cdm(0), c.Omega0_cdm) assert_allclose(c.Omega_g(0), c.Omega0_g) assert_allclose(c.Omega_b(0), c.Omega0_b) assert_allclose(c.Omega_ncdm(0), c.Omega0_ncdm) assert_allclose(c.Omega_ur(0), c.Omega0_ur) assert_allclose(c.Omega_ncdm(0), c.Omega0_ncdm_tot) assert_allclose(c.Omega_pncdm(0), c.Omega0_pncdm) assert_allclose(c.Omega_m(0), c.Omega0_m) assert_allclose(c.Omega_r(0), c.Omega0_r) # total density in 10e10 Msun/h unit assert_allclose(c.rho_tot(0), 27.754999) # comoving distance to z=1.0 in Mpc/h unit. assert_allclose(c.comoving_distance(1.0), 3396.157391 * c.h) # conformal time in Mpc unit. assert_allclose(c.tau(1.0), 3396.157391) assert_allclose(c.efunc(0), 1.) # hubble in Mpc/h km/s unit assert_allclose(c.efunc(0) - c.efunc(1 / 0.9999 - 1), 0.0001 * c.efunc_prime(0), rtol=1e-3)
def test_cosmology_sane(): c = Cosmology(gauge='synchronous', verbose=True) assert_allclose(c.Omega_cdm(0), c.Omega0_cdm) assert_allclose(c.Omega_g(0), c.Omega0_g) assert_allclose(c.Omega_b(0), c.Omega0_b) assert_allclose(c.Omega_ncdm(0), c.Omega0_ncdm) assert_allclose(c.Omega_ur(0), c.Omega0_ur) assert_allclose(c.Omega_ncdm(0), c.Omega0_ncdm_tot) assert_allclose(c.Omega_pncdm(0), c.Omega0_pncdm) assert_allclose(c.Omega_m(0), c.Omega0_m) assert_allclose(c.Omega_r(0), c.Omega0_r) # total density in 10e10 Msun/h unit assert_allclose(c.rho_tot(0), 27.754999) # comoving distance to z=1.0 in Mpc/h unit. assert_allclose(c.comoving_distance(1.0), 3396.157391 * c.h) # conformal time in Mpc unit. assert_allclose(c.tau(1.0), 3396.157391) assert_allclose(c.efunc(0), 1.) # hubble in Mpc/h km/s unit assert_allclose(c.efunc(0) - c.efunc(1 / 0.9999 - 1), 0.0001 * c.efunc_prime(0), rtol=1e-3)
def test_cosmology_a_max(): c = Cosmology(gauge='synchronous', a_max=2.0) print(c.parameter_file) assert c.a_max == 2.0 t = c.Omega_m(-0.1) t = c.efunc(-0.1) t = c.scale_independent_growth_factor(-0.1)
def test_cosmology_a_max(): c = Cosmology(gauge='synchronous', a_max=2.0) print(c.parameter_file) assert c.a_max == 2.0 t = c.Omega_m(-0.1) t = c.efunc(-0.1) t = c.scale_independent_growth_factor(-0.1)