aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim/configs
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2017-07-21 10:04:40 +0800
committerAaron LI <aly@aaronly.me>2017-07-21 10:04:40 +0800
commitcbbc26191f4454c71b0abe2458d721e2aaa1ab14 (patch)
tree71de9fdd0193dd852b8d06f96e6a7cdb0f32e1d1 /fg21sim/configs
parentbbea345360b0d0bdcbab7354965d48037e027c01 (diff)
downloadfg21sim-cbbc26191f4454c71b0abe2458d721e2aaa1ab14.tar.bz2
configs/manager.py: Add property "cosmology"
Signed-off-by: Aaron LI <aly@aaronly.me>
Diffstat (limited to 'fg21sim/configs')
-rw-r--r--fg21sim/configs/manager.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/fg21sim/configs/manager.py b/fg21sim/configs/manager.py
index 44df01c..ce376aa 100644
--- a/fg21sim/configs/manager.py
+++ b/fg21sim/configs/manager.py
@@ -544,6 +544,21 @@ class ConfigManager:
}
return logconf
+ @property
+ def cosmology(self):
+ """
+ Get the cosmological parameters and organize them as an dictionary
+ for ``Cosmology`` initialization.
+ """
+ conf = self.get("cosmology")
+ cosmoconf = {
+ "H0": conf["H0"],
+ "OmegaM0": conf["OmegaM0"],
+ "Omegab0": conf["Omegab0"],
+ "sigma8": conf["sigma8"],
+ }
+ return cosmoconf
+
def dump(self, from_default=False, flatten=False):
"""
Dump the configurations as plain Python dictionary.