aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2017-08-13 21:02:54 +0800
committerAaron LI <aly@aaronly.me>2017-08-13 21:02:54 +0800
commit1cab1c180cfc5465f1faf81d9fccb08a8684d4a7 (patch)
tree7f5c49f084fbb1ec3c5ad2c3742b62e726398458
parent54c0b17f3484cfbe3402d8916c841f0994d62ca7 (diff)
downloadfg21sim-1cab1c180cfc5465f1faf81d9fccb08a8684d4a7.tar.bz2
clusters: Halo templates are normalized to have mean of 1
Also update the documents of "draw_halo()" function Signed-off-by: Aaron LI <aly@aaronly.me>
-rw-r--r--fg21sim/extragalactic/clusters/helper.py14
-rw-r--r--fg21sim/extragalactic/clusters/main.py2
2 files changed, 12 insertions, 4 deletions
diff --git a/fg21sim/extragalactic/clusters/helper.py b/fg21sim/extragalactic/clusters/helper.py
index becb608..26146cc 100644
--- a/fg21sim/extragalactic/clusters/helper.py
+++ b/fg21sim/extragalactic/clusters/helper.py
@@ -449,15 +449,23 @@ def draw_halo(rprofile, felong, rotation=0.0):
Parameters
----------
- rprofile
+ rprofile : 1D `~numpy.ndarray`
+ The values along the radial pixels (0, 1, 2, ...),
+ e.g., calculated by the above ``halo_rprofile()``.
+ felong : float
+ The elongated fraction of the elliptical halo, which is
+ defined as the ratio of semi-minor axis to the semi-major axis.
+ rotation : float
+ The rotation angle of the elliptical halo.
+ Unit: [deg]
Returns
-------
image : 2D `~numpy.ndarray`
2D array of the drawn halo template image.
- The image is normalized to have sum of 1.
+ The image is normalized to have *mean* value of 1.
"""
image = circle(rprofile=rprofile)
image = circle2ellipse(image, bfraction=felong, rotation=rotation)
- image /= image.sum()
+ image /= image.mean()
return image
diff --git a/fg21sim/extragalactic/clusters/main.py b/fg21sim/extragalactic/clusters/main.py
index 15a9dcd..94a3288 100644
--- a/fg21sim/extragalactic/clusters/main.py
+++ b/fg21sim/extragalactic/clusters/main.py
@@ -304,7 +304,7 @@ class GalaxyClusters:
----
The drawn template images are append to the dictionaries of
the corresponding halo within the ``self.halos``.
- The templates are normalized to have sum of 1.
+ The templates are normalized to have *mean* value of 1.
"""
num = len(self.halos)
logger.info("Draw template images for %d halos ..." % num)