From 1cab1c180cfc5465f1faf81d9fccb08a8684d4a7 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Sun, 13 Aug 2017 21:02:54 +0800 Subject: clusters: Halo templates are normalized to have mean of 1 Also update the documents of "draw_halo()" function Signed-off-by: Aaron LI --- fg21sim/extragalactic/clusters/helper.py | 14 +++++++++++--- fg21sim/extragalactic/clusters/main.py | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'fg21sim/extragalactic/clusters') 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) -- cgit v1.2.2