diff options
author | Aaron LI <aly@aaronly.me> | 2019-01-10 23:57:39 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2019-01-10 23:57:39 +0800 |
commit | 9a4e307afed41d6c721980c0d8fc1bbdccbc79e4 (patch) | |
tree | 5d25ec38b64eed92a7bb697e6182376abecfa93e | |
parent | f5bdb94f65369771b13972b8f22c1a74a258d16c (diff) | |
download | fg21sim-9a4e307afed41d6c721980c0d8fc1bbdccbc79e4.tar.bz2 |
clusters/halo: Add new "RadioHalo" to wrap over RadioHaloAM
-rw-r--r-- | fg21sim/extragalactic/clusters/halo.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/fg21sim/extragalactic/clusters/halo.py b/fg21sim/extragalactic/clusters/halo.py index a6bb365..e0f4b4b 100644 --- a/fg21sim/extragalactic/clusters/halo.py +++ b/fg21sim/extragalactic/clusters/halo.py @@ -920,3 +920,36 @@ class RadioHaloAM(RadioHalo1M): xt = np.arange(self.age_begin, self.age_obs+dt/2, step=dt) active = np.array([self._is_turb_active(t) for t in xt], dtype=int) return active.mean() + + +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. + """ + 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 |