diff options
| author | Aaron LI <aaronly.me@outlook.com> | 2016-10-10 18:31:13 +0800 | 
|---|---|---|
| committer | Aaron LI <aaronly.me@outlook.com> | 2016-10-10 18:31:13 +0800 | 
| commit | 3b4252e315477574f665e3fedbeac0037273c1ec (patch) | |
| tree | 47d6015090afa0adaa323233f58682fdddae2256 | |
| parent | 1e6b0669374276a58cf1b081fa6efbdffd8266c2 (diff) | |
| download | fg21sim-3b4252e315477574f665e3fedbeac0037273c1ec.tar.bz2 | |
utils: zea2healpix(): Average the duplicate pixels
Also fix typos
| -rw-r--r-- | fg21sim/utils/reproject.py | 6 | 
1 files changed, 4 insertions, 2 deletions
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)" %  | 
