From c58ec1de1bef56876e7dc976f667d2c13246d21d Mon Sep 17 00:00:00 2001 From: Mayeul Aubin Date: Wed, 4 Jun 2025 13:44:21 +0200 Subject: [PATCH] monofonic support for A_s or sigma8 --- sbmy_control/parameters_monofonic.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sbmy_control/parameters_monofonic.py b/sbmy_control/parameters_monofonic.py index e4a2169..d9cf896 100644 --- a/sbmy_control/parameters_monofonic.py +++ b/sbmy_control/parameters_monofonic.py @@ -95,8 +95,6 @@ def get_config_from_dict(monofonic_dict): "Omega_L": monofonic_dict["Omega_q"], "H0": monofonic_dict["h"]*100., "n_s": monofonic_dict["n_s"], - "sigma_8": monofonic_dict["sigma8"], - "A_s": monofonic_dict["A_s"], "Tcmb": monofonic_dict["Tcmb"], "k_p": monofonic_dict["k_p"], "N_ur": monofonic_dict["N_ur"], @@ -110,7 +108,14 @@ def get_config_from_dict(monofonic_dict): "transfer": "CLASS", "ztarget": 2.5, "ZeroRadiation": False - } + } + + if "A_s" in monofonic_dict.keys() and monofonic_dict["A_s"] is not None: + config["cosmology"]["A_s"] = monofonic_dict["A_s"] + elif "sigma8" in monofonic_dict.keys() and monofonic_dict["sigma8"] is not None: + config["cosmology"]["sigma8"] = monofonic_dict["sigma8"] + else: + raise KeyError("Either A_s or sigma8 must be provided in the cosmology parameters.") config["random"] = { "generator": "NGENIC",