diff options
author | Aaron LI <aly@aaronly.me> | 2018-10-31 21:34:48 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2018-10-31 21:34:48 +0800 |
commit | 89165bbd9afa22dbabc6abb856ec16869eac8b19 (patch) | |
tree | 745671f5f36635fd436f6c053428a9399c9d0085 | |
parent | 23e033542455ae6105edf7f28c945d9cb7e6223b (diff) | |
download | fg21sim-89165bbd9afa22dbabc6abb856ec16869eac8b19.tar.bz2 |
bin/get-healpix-patch: Get HEALPix ordering for reprojection
-rwxr-xr-x | bin/get-healpix-patch | 11 |
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 ...") |