From 3b4252e315477574f665e3fedbeac0037273c1ec Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Mon, 10 Oct 2016 18:31:13 +0800 Subject: utils: zea2healpix(): Average the duplicate pixels Also fix typos --- fg21sim/utils/reproject.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'fg21sim/utils') diff --git a/fg21sim/utils/reproject.py b/fg21sim/utils/reproject.py index f44c265..cbadc53 100644 --- a/fg21sim/utils/reproject.py +++ b/fg21sim/utils/reproject.py @@ -244,11 +244,13 @@ def zea2healpix(img1, img2, nside, order=1, inpaint=False, hp_data2[np.isnan(hp_data2)] = 0.0 hp_data = hp_data1 + hp_data2 logger.info("Done reprojection and merge two hemispheres") - # Duplicated pixels and missing pixels + # Duplicate pixels and missing pixels pix_dup = (hp_mask == 2) if pix_dup.sum() > 0: - logger.warning("Reprojected HEALPix data has %d duplicated pixel(s)" % + logger.warning("Reprojected HEALPix data has %d duplicate pixel(s)" % pix_dup.sum()) + hp_data[pix_dup] /= 2.0 + logger.warning("Averaged the duplicate pixel(s)") pix_missing = (hp_mask == 0) if pix_missing.sum() > 0: logger.warning("Reprojected HEALPix data has %d missing pixel(s)" % -- cgit v1.2.2