From 4f31ff421a937b1ad5a188b39ceb8fb82c938ad0 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Sat, 22 Jul 2017 10:14:07 +0800 Subject: clusters/main.py: Add property "halo_configs" And update the config specification accordingly with some cleanups. Signed-off-by: Aaron LI --- fg21sim/extragalactic/clusters/main.py | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'fg21sim/extragalactic/clusters/main.py') diff --git a/fg21sim/extragalactic/clusters/main.py b/fg21sim/extragalactic/clusters/main.py index b6c1022..8e37db1 100644 --- a/fg21sim/extragalactic/clusters/main.py +++ b/fg21sim/extragalactic/clusters/main.py @@ -41,9 +41,21 @@ class GalaxyClusters: Currently, only the *giant radio halos* are considered, while other types of extended emissions are missing, e.g., mini-halos, elongated relics, roundish relics. + + Attributes + ---------- + configs : `~ConfigManager` + A `ConfigManager` instance containing default and user configurations. + For more details, see the example configuration specifications. + halo_configs : dict + A dictionary containing the configurations for halo simulation. + sky : `~SkyPatch` or `SkyHealpix` + The sky instance to deal with the simulation sky as well as the + output map. + XXX: current full-sky HEALPix map is NOT supported! """ # Component name - name = "galaxy clusters" + name = "galaxy clusters (halos)" def __init__(self, configs): self.configs = configs @@ -79,6 +91,24 @@ class GalaxyClusters: logger.info("Loaded and set up configurations") + @property + def halo_configs(self): + """ + Configurations for radio halo simulation as a dictionary. + """ + comp = "extragalactic/halos" + haloconf = { + "eta_turb": self.configs.getn(comp+"/eta_turb"), + "eta_e": self.configs.getn(comp+"/eta_e"), + "gamma_min": self.configs.getn(comp+"/gamma_min"), + "gamma_max": self.configs.getn(comp+"/gamma_max"), + "gamma_np": self.configs.getn(comp+"/gamma_num"), + "buffer_np": self.configs.getn(comp+"/buffer_np"), + "time_step": self.configs.getn(comp+"/time_step"), + "injection_index": self.configs.getn(comp+"/injection_index"), + } + return haloconf + def _load_catalog(self): """ Load the sampled (z, mass) catalogs from the Press-Schechter -- cgit v1.2.2