aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim/extragalactic/clusters/helper.py
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2017-12-31 16:29:51 +0800
committerAaron LI <aly@aaronly.me>2017-12-31 16:29:51 +0800
commitea793b05168a31460a36bb22cab98108e35c05d0 (patch)
tree48df3d094fcef4cc1bca54a6fb24970ae45c26ac /fg21sim/extragalactic/clusters/helper.py
parentca3a67aa2633912be96572b4fe4f2496facd97a1 (diff)
downloadfg21sim-ea793b05168a31460a36bb22cab98108e35c05d0.tar.bz2
clusters/halo/helper: Add fmass_nfw() to calc NFW mass profile
Diffstat (limited to 'fg21sim/extragalactic/clusters/helper.py')
-rw-r--r--fg21sim/extragalactic/clusters/helper.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/fg21sim/extragalactic/clusters/helper.py b/fg21sim/extragalactic/clusters/helper.py
index e751bbe..f5b4f8c 100644
--- a/fg21sim/extragalactic/clusters/helper.py
+++ b/fg21sim/extragalactic/clusters/helper.py
@@ -26,6 +26,10 @@ References
Fujita et al. 2003, ApJ, 584, 190;
http://adsabs.harvard.edu/abs/2003ApJ...584..190F
+.. [lokas2001]
+ Lokas & Mamon 2001, MNRAS, 321, 155
+ http://adsabs.harvard.edu/abs/2001MNRAS.321..155L
+
.. [murgia2009]
Murgia et al. 2009, A&A, 499, 679
http://adsabs.harvard.edu/abs/2009A%26A...499..679M
@@ -446,3 +450,29 @@ def draw_halo(radius, nr=2.0, felong=None, rotation=None):
# Normalized to have *mean* value of 1
image /= image.mean()
return image
+
+
+def fmass_nfw(x, c=5.0):
+ """
+ The normalized total mass profile by integrating from the NFW
+ density profile.
+
+ Parameters
+ ----------
+ x : float
+ x = R/R_vir, fractional virial radius
+ c : float
+ Concentration parameter
+ Default: 5.0 (for clusters)
+
+ Returns
+ -------
+ fmass : float
+ The normalized total mass w.r.t. the virial mass, i.e.,
+ fmass = M(<x*R_vir) / M_vir
+
+ Reference: [lokas2001],Eq.(2,4,5,8)
+ """
+ gc = 1.0 / (np.log(1+c) - c/(1+c))
+ fmass = gc * (np.log(1+c*x) - c*x / (1+c*x))
+ return fmass