aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim
diff options
context:
space:
mode:
Diffstat (limited to 'fg21sim')
-rw-r--r--fg21sim/extragalactic/clusters/helper.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/fg21sim/extragalactic/clusters/helper.py b/fg21sim/extragalactic/clusters/helper.py
index c4fdecc..001ced5 100644
--- a/fg21sim/extragalactic/clusters/helper.py
+++ b/fg21sim/extragalactic/clusters/helper.py
@@ -354,6 +354,14 @@ def density_energy_electron(n_e, gamma):
return integrate.simps(e_spec * gamma, np.log(gamma)) # in log grid
+def density_number_electron(n_e, gamma):
+ """
+ Calculate the electron number density of the given spectrum.
+ Unit: [cm^-3]
+ """
+ return integrate.simps(n_e * gamma, np.log(gamma)) # in log grid
+
+
def magnetic_field(
mass,
z=0.0,