From 745cc1b0001236242eb4790e71a3b60c0388eb4f Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Fri, 23 Jun 2017 20:38:39 +0800 Subject: cosmology: Use default parameters from configurations Also add configuration option "cosmology/Omegab0". --- fg21sim/utils/cosmology.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'fg21sim/utils') diff --git a/fg21sim/utils/cosmology.py b/fg21sim/utils/cosmology.py index 906f7d8..c5a5119 100644 --- a/fg21sim/utils/cosmology.py +++ b/fg21sim/utils/cosmology.py @@ -9,6 +9,7 @@ import numpy as np from scipy import integrate from astropy.cosmology import FlatLambdaCDM +from ..configs import configs from .units import (UnitConversions as AUC, Constants as AC) @@ -37,7 +38,10 @@ class Cosmology: http://adsabs.harvard.edu/abs/2002ApJ...577..579R Sec.(2) """ - def __init__(self, H0=71.0, Om0=0.27, Ob0=0.046, sigma8=0.834): + def __init__(self, H0=configs.getn("cosmology/H0"), + Om0=configs.getn("cosmology/OmegaM0"), + Ob0=configs.getn("cosmology/Omegab0"), + sigma8=configs.getn("cosmology/sigma8")): self.H0 = H0 # [km/s/Mpc] self.Om0 = Om0 self.Ob0 = Ob0 -- cgit v1.2.2