From b6a5e6d320368c835d56e888147d5fed6ecd5b29 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Wed, 3 Jan 2018 22:18:45 +0800 Subject: clusters: update to to use the new HaloEmission in _calc_halos_emission() --- fg21sim/extragalactic/clusters/main.py | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'fg21sim') diff --git a/fg21sim/extragalactic/clusters/main.py b/fg21sim/extragalactic/clusters/main.py index 000f1e2..a29c474 100644 --- a/fg21sim/extragalactic/clusters/main.py +++ b/fg21sim/extragalactic/clusters/main.py @@ -21,6 +21,7 @@ import numpy as np from .psformalism import PSFormalism from .formation import ClusterFormation from .halo import RadioHalo +from .emission import HaloEmission from ...share import CONFIGS, COSMO from ...utils.io import dataframe_to_csv, pickle_dump, pickle_load from ...utils.ds import dictlist_to_dataframe @@ -303,19 +304,14 @@ class GalaxyClusters: i += 1 if i % 100 == 0: logger.info("[%d/%d] %.1f%% ..." % (i, num, 100*i/num)) - - halo = RadioHalo(M_obs=hdict["M0"], z_obs=hdict["z0"], - M_main=hdict["M_main"], M_sub=hdict["M_sub"], - z_merger=hdict["z_merger"], - configs=self.configs) - halo.set_electron_spectrum(hdict["n_e"]) - - emissivity = halo.calc_emissivity(frequencies=self.frequencies) - power = halo.calc_power(self.frequencies, emissivity=emissivity) - # k-correction considered - flux = halo.calc_flux(self.frequencies) - Tb_mean = halo.calc_brightness_mean(self.frequencies, flux=flux, - pixelsize=self.sky.pixelsize) + haloem = HaloEmission(gamma=hdict["gamma"], n_e=hdict["n_e"], + B=hdict["B0"], radius=hdict["Rhalo"], + redshift=hdict["z0"]) + emissivity = haloem.calc_emissivity(frequencies=self.frequencies) + power = haloem.calc_power(self.frequencies, emissivity=emissivity) + flux = haloem.calc_flux(self.frequencies) + Tb_mean = haloem.calc_brightness_mean(self.frequencies, flux=flux, + pixelsize=self.sky.pixelsize) # Update or add new items hdict.update([ ("frequency", self.frequencies), # [MHz] -- cgit v1.2.2