aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim/extragalactic/clusters
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2019-01-10 21:08:41 +0800
committerAaron LI <aly@aaronly.me>2019-01-10 21:08:41 +0800
commit3cc9dcb0a8d9b71e2404b2692a5041881373e1c0 (patch)
tree6cf6df322ae4818cd919ed63d4d7273e9d66e44d /fg21sim/extragalactic/clusters
parent94f24f81acd9b2c3308a8f3d2d80b2661f610f64 (diff)
downloadfg21sim-3cc9dcb0a8d9b71e2404b2692a5041881373e1c0.tar.bz2
clusters/halo: Rewrite is_geniune() method
Diffstat (limited to 'fg21sim/extragalactic/clusters')
-rw-r--r--fg21sim/extragalactic/clusters/halo.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/fg21sim/extragalactic/clusters/halo.py b/fg21sim/extragalactic/clusters/halo.py
index da3079b..9c25a3a 100644
--- a/fg21sim/extragalactic/clusters/halo.py
+++ b/fg21sim/extragalactic/clusters/halo.py
@@ -454,6 +454,36 @@ class RadioHalo:
return n_e
+ def is_genuine(self, n_e):
+ """
+ Check whether the radio halo is genuine/observable by comparing the
+ emissivity to the corresponding fiducial value, which is calculated
+ from the fiducial electron spectrum derived with turbulent
+ acceleration turned off.
+
+ Parameters
+ ----------
+ n_e : float 1D `~numpy.ndarray`
+ The finally derived electron spectrum.
+ Unit: [cm^-3]
+
+ Returns
+ -------
+ genuine : bool
+ Whether the radio halo is genuine?
+ factor : float
+ Acceleration factor of the flux.
+ """
+ haloem = HaloEmission(gamma=self.gamma, n_e=n_e, B=1)
+ em = haloem.calc_emissivity(self.fiducial_freq)
+
+ ne_fiducial = self.calc_electron_spectrum(fiducial=True)
+ haloem.n_e = ne_fiducial
+ em_fiducial = haloem.calc_emissivity(self.fiducial_freq)
+
+ factor = em / em_fiducial
+ return (factor >= self.fiducial_factor, factor)
+
def fp_injection(self, gamma, t=None):
"""
Electron injection (rate) term for the Fokker-Planck equation.