From c75dfd265e82b62af330f29be492a35c831238cc Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Mon, 31 Jul 2017 23:47:52 +0800 Subject: clusters: Fix several small issues on wrong variable names Also update logging message for RadioHalo a bit. Signed-off-by: Aaron LI --- fg21sim/extragalactic/clusters/formation.py | 7 ++++--- fg21sim/extragalactic/clusters/halo.py | 4 ++-- fg21sim/extragalactic/clusters/main.py | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) (limited to 'fg21sim/extragalactic/clusters') diff --git a/fg21sim/extragalactic/clusters/formation.py b/fg21sim/extragalactic/clusters/formation.py index dc41e00..f92c868 100644 --- a/fg21sim/extragalactic/clusters/formation.py +++ b/fg21sim/extragalactic/clusters/formation.py @@ -186,8 +186,9 @@ class ClusterFormation: References: Ref.[randall2002],Sec.(3.1) """ logger.debug("Simulating cluster formation: " + - "M0={:.3g}[Msun] from z={:.3f} to z={zmax} ...".format( - self.M0, self.z0, zmax=self.zmax)) + "M0=%.3e[Msun] " % self.M0 + + "from z={:.3f} back to z={zmax} ...".format( + self.z0, zmax=self.zmax)) self.main_only = main_only if main_only: logger.debug("Only trace the formation of the *main* cluster ...") @@ -195,7 +196,7 @@ class ClusterFormation: else: logger.debug("Trace formations of both main and sub cluster ...") self.mtree = self._trace_formation(self.M0, _z=self.z0) - logger.debug("Simulated cluster formation with merger tree") + logger.debug("Simulated cluster formation with merger tree.") return self.mtree @property diff --git a/fg21sim/extragalactic/clusters/halo.py b/fg21sim/extragalactic/clusters/halo.py index 333da4e..50c1242 100644 --- a/fg21sim/extragalactic/clusters/halo.py +++ b/fg21sim/extragalactic/clusters/halo.py @@ -170,7 +170,7 @@ class RadioHalo: The angular radius of the radio halo. Unit: [arcsec] """ - DA = COSMO.DA(self.z) * 1e3 # [Mpc] -> [kpc] + DA = COSMO.DA(self.z_obs) * 1e3 # [Mpc] -> [kpc] theta = self.radius / DA # [rad] return theta * AUC.rad2arcsec @@ -316,7 +316,7 @@ class RadioHalo: Unit: [Jy] = 1e-23 [erg/s/cm^2/Hz] = 1e-26 [W/m^2/Hz] """ power = self.calc_power(emissivity) # [W/Hz] - DL = COSMO.DL(self.z) * AUC.Mpc2m # [m] + DL = COSMO.DL(self.z_obs) * AUC.Mpc2m # [m] flux = 1e26 * power / (4*np.pi * DL*DL) # [Jy] return flux diff --git a/fg21sim/extragalactic/clusters/main.py b/fg21sim/extragalactic/clusters/main.py index 4e3d906..10f169c 100644 --- a/fg21sim/extragalactic/clusters/main.py +++ b/fg21sim/extragalactic/clusters/main.py @@ -247,8 +247,8 @@ class GalaxyClusters: emissivity = halo.calc_emissivity(frequencies=self.frequencies) flux = halo.calc_flux(emissivity) data = { - "z0": halo.z, - "M0": halo.mass, # [Msun] + "z0": halo.z_obs, + "M0": halo.M_obs, # [Msun] "z_merger": halo.z_merger, "M_main": halo.M_main, # [Msun] "M_sub": halo.M_sub, # [Msun] -- cgit v1.2.2