aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2018-10-31 21:34:48 +0800
committerAaron LI <aly@aaronly.me>2018-10-31 21:34:48 +0800
commit89165bbd9afa22dbabc6abb856ec16869eac8b19 (patch)
tree745671f5f36635fd436f6c053428a9399c9d0085
parent23e033542455ae6105edf7f28c945d9cb7e6223b (diff)
downloadfg21sim-89165bbd9afa22dbabc6abb856ec16869eac8b19.tar.bz2
bin/get-healpix-patch: Get HEALPix ordering for reprojection
-rwxr-xr-xbin/get-healpix-patch11
1 files changed, 9 insertions, 2 deletions
diff --git a/bin/get-healpix-patch b/bin/get-healpix-patch
index f985d44..e228962 100755
--- a/bin/get-healpix-patch
+++ b/bin/get-healpix-patch
@@ -87,16 +87,23 @@ def main():
logger.info("Read HEALPix map from file: %s" % args.infile)
hpdata, hpheader = read_fits_healpix(args.infile)
nside = hpheader["NSIDE"]
- logger.info("Reprojecting HEALPix map to sky patch ...")
+ try:
+ ordering = hpheader["ORDERING"]
+ except KeyError:
+ logger.warning("No 'ORDERING' keyword for file: %s" % args.infile)
+ logger.warning("Assume the 'NESTED' ordering")
+ ordering = "NESTED"
+ nested = ordering.upper() == "NESTED"
try:
coordsys = hpheader["COORDSYS"]
except KeyError:
logger.warning("No 'COORDSYS' keyword for file: %s" % args.infile)
logger.warning("Assume to use the 'Galactic' coordinate")
coordsys = "Galactic"
+ logger.info("Reprojecting HEALPix map to sky patch ...")
image, __ = reproject_from_healpix(input_data=(hpdata, coordsys),
output_projection=sky.wcs,
- shape_out=size)
+ shape_out=size, nested=nested)
if args.smooth:
logger.info("Smoothing the sky patch with a Gaussian filter ...")