diff options
author | Aaron LI <aly@aaronly.me> | 2017-06-23 20:38:39 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2017-06-23 20:38:39 +0800 |
commit | 745cc1b0001236242eb4790e71a3b60c0388eb4f (patch) | |
tree | 56f993c55838db94683fa56a18192134bdc154c6 /fg21sim/utils | |
parent | 4de4dac9f909d6cbc7af1021eb403524983a436d (diff) | |
download | fg21sim-745cc1b0001236242eb4790e71a3b60c0388eb4f.tar.bz2 |
cosmology: Use default parameters from configurations
Also add configuration option "cosmology/Omegab0".
Diffstat (limited to 'fg21sim/utils')
-rw-r--r-- | fg21sim/utils/cosmology.py | 6 |
1 files changed, 5 insertions, 1 deletions
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 |