diff options
author | Aaron LI <aly@aaronly.me> | 2017-07-21 10:40:37 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2017-07-21 14:52:21 +0800 |
commit | 7b8215c64581af20249f092287e2152315e3b566 (patch) | |
tree | 824e7a9b3cca218ae44f0ac3d1b6b026c568132f /fg21sim/extragalactic/clusters/main.py | |
parent | d31eec7033f8a511a450f966b35866ed7570f8fb (diff) | |
download | fg21sim-7b8215c64581af20249f092287e2152315e3b566.tar.bz2 |
Use the global "cosmo" instance for simplification
Signed-off-by: Aaron LI <aly@aaronly.me>
Diffstat (limited to 'fg21sim/extragalactic/clusters/main.py')
-rw-r--r-- | fg21sim/extragalactic/clusters/main.py | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/fg21sim/extragalactic/clusters/main.py b/fg21sim/extragalactic/clusters/main.py index 438b860..b7c2d03 100644 --- a/fg21sim/extragalactic/clusters/main.py +++ b/fg21sim/extragalactic/clusters/main.py @@ -19,7 +19,7 @@ import pandas as pd from .formation import ClusterFormation from .halo import RadioHalo from ...sky import get_sky -from ...utils.cosmology import Cosmology +from ...utils import cosmo from ...utils.io import dataframe_to_csv @@ -63,14 +63,6 @@ class GalaxyClusters: self.checksum = self.configs.getn("output/checksum") self.clobber = self.configs.getn("output/clobber") - # Cosmology model - self.H0 = self.configs.getn("cosmology/H0") - self.OmegaM0 = self.configs.getn("cosmology/OmegaM0") - self.Omegab0 = self.configs.getn("cosmology/Omegab0") - self.sigma8 = self.configs.getn("cosmology/sigma8") - self.cosmo = Cosmology(H0=self.H0, Om0=self.OmegaM0, - Ob0=self.Omegab0, sigma8=self.sigma8) - # Sky and resolution if self.sky.type_ == "patch": self.resolution = self.sky.pixelsize # [arcsec] @@ -184,11 +176,10 @@ class GalaxyClusters: if ii % 50 == 0: logger.info("[%d/%d] %.1f%% ..." % (ii, num, 100*ii/num)) z0, M0 = row.z, row.mass - age0 = self.cosmo.age(z0) - zmax = self.cosmo.redshift(age0 - self.tau_merger) + age0 = cosmo.age(z0) + zmax = cosmo.redshift(age0 - self.tau_merger) clform = ClusterFormation(M0=M0, z0=z0, zmax=zmax, ratio_major=self.ratio_major, - cosmo=self.cosmo, merger_mass_min=self.merger_mass_min) clform.simulate_mergertree(main_only=True) mmev = clform.last_major_merger |