From a4fb14dbc20cd258920a8dc438d21baef2ef1bc1 Mon Sep 17 00:00:00 2001 From: Joe Zuntz Date: Fri, 12 Jul 2024 10:43:39 +0200 Subject: [PATCH] add CMB shift parameter calculation to camb --- boltzmann/camb/camb_interface.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/boltzmann/camb/camb_interface.py b/boltzmann/camb/camb_interface.py index 14e39c78..305982fc 100644 --- a/boltzmann/camb/camb_interface.py +++ b/boltzmann/camb/camb_interface.py @@ -20,6 +20,7 @@ DEFAULT_A_S = 2.1e-9 +C_KMS = 299792.458 # See this table for description: #https://camb.readthedocs.io/en/latest/transfer_variables.html#transfer-variables @@ -430,6 +431,9 @@ def save_derived_parameters(r, block): for k, v in derived.items(): block[names.distances, k] = v block[names.distances, 'rs_zdrag'] = block[names.distances, 'rdrag'] + zstar = derived['zstar'] + shift = r.angular_diameter_distance(zstar) * (1 + zstar) * (p.omegam * p.H0**2)**0.5 / C_KMS + block[names.distances, "cmbshift"] = shift p.omegal = 1 - p.omegam - p.omk p.ommh2 = p.omegam * p.h**2