From 52e0e5b36d9eded6189e278a8f2d614404b4e37e Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Sun, 27 Jan 2019 15:24:22 +0800 Subject: clusters/halo: Delete the RadioHalo wrapper class --- fg21sim/extragalactic/clusters/halo.py | 92 ---------------------------------- 1 file changed, 92 deletions(-) (limited to 'fg21sim/extragalactic') diff --git a/fg21sim/extragalactic/clusters/halo.py b/fg21sim/extragalactic/clusters/halo.py index c498bb6..d0bce9e 100644 --- a/fg21sim/extragalactic/clusters/halo.py +++ b/fg21sim/extragalactic/clusters/halo.py @@ -1008,95 +1008,3 @@ class RadioHaloAM(RadioHalo1M): n1_e = n2_e return n2_e - - -class RadioHalo: - """ - Simulate the radio halo properties for a galaxy cluster. - - This class is built upon the `~RadioHalo1M` and `~RadioHaloAM` and - is intended for use in the outside. - - Parameters - ---------- - M_obs : float - Cluster virial mass at the observation (simulation end) time. - Unit: [Msun] - z_obs : float - Redshift of the observation (simulation end) time. - M_main, M_sub : list[float] - List of main and sub cluster masses at each merger event, - from current to earlier time. - Unit: [Msun] - z_merger : list[float] - The redshifts at each merger event, from small to large. - merger_num : int - Number of merger events traced for the cluster. - """ - # Effective radius of the turbulence region [kpc] - radius_turb_eff = None - - def __init__(self, M_obs, z_obs, M_main, M_sub, z_merger, - merger_num, configs=CONFIGS): - self.M_obs, self.z_obs = M_obs, z_obs - self.M_main = np.asarray(M_main[:merger_num]) - self.M_sub = np.asarray(M_sub[:merger_num]) - self.z_merger = np.asarray(z_merger[:merger_num]) - self.merger_num = merger_num - self.configs = configs - - def calc_radius_turb(self): - """ - Determine the effective radius of the turbulence region along the - whole merging process. The effective size is determined by the - largest turbulence radius of a merger that is generating a genuine - radio halo. - - Returns - ------- - radius_turb_eff : float - Effective radius of the turbulence region - Unit: [kpc] - - Attributes - ---------- - radius_turb_eff : float - _halos : list[dict] - List of dictionary with each one saving the properties of the - halo generated by the corresponding merger. - """ - logger.info("Determining the effective turbulence radius ...") - halos = [{ - "M_main": self.M_main[i], - "M_sub": self.M_sub[i], - "z_merger": self.z_merger[i], - "i": i, - } for i in range(self.merger_num)] - for hdict in halos: - halo = RadioHalo1M(M_obs=self.M_obs, z_obs=self.z_obs, - M_main=hdict["M_main"], - M_sub=hdict["M_sub"], - z_merger=hdict["z_merger"], - configs=self.configs) - hdict["halo"] = halo - hdict["radius_turb"] = halo.radius_turb(halo.t_merger) - hdict["genuine"] = False - - halos.sort(key=lambda h: h["radius_turb"], reverse=True) - for hdict in halos: - halo = hdict["halo"] - logger.info("Checking merger: %.2e & %.2e @ %.3f -> %.3f ..." % - (halo.M_main, halo.M_sub, halo.z_merger, halo.z_obs)) - n_e = halo.calc_electron_spectrum() - genuine, em_factor = halo.is_genuine(n_e) - hdict["n_e"] = n_e - hdict["genuine"] = genuine - hdict["em_factor"] = em_factor - - if genuine: - self.radius_turb_eff = hdict["radius_turb"] - logger.info("Identified effective merger.") - break - - self._halos = halos - return self.radius_turb_eff -- cgit v1.2.2