From d65f3ba19d0d4af9b47b1fe6b5c3ab3cb25bca5c Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Sat, 26 Aug 2017 21:01:24 +0800 Subject: get-healpix-patch: Add argument "--sigma-npix" (default: 2.0) --- bin/get-healpix-patch | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/bin/get-healpix-patch b/bin/get-healpix-patch index 9d82ffd..551279a 100755 --- a/bin/get-healpix-patch +++ b/bin/get-healpix-patch @@ -35,9 +35,12 @@ def main(): parser.add_argument("--pixelsize", dest="pixelsize", type=float, help="pixel size of the sky patch; unit: [arcsec]") parser.add_argument("-S", "--smooth", dest="smooth", action="store_true", - help="Smooth the output patch using a Gaussian " + - "filter whose sigma is 2x the pixel size " + - "of the input HEALPix map") + help="Smooth the output patch with a Gaussian " + + "filter of sigma 'sigma-npix' (next argument) " + + "pixel size of the input HEALPix map") + parser.add_argument("--sigma-npix", dest="sigma_npix", + type=float, default=2.0, + help="number of pixels for the above Gaussian filter") parser.add_argument("infile", help="input all-sky HEALPix map") parser.add_argument("outfile", help="output extracted sky patch") args = parser.parse_args() @@ -96,7 +99,8 @@ def main(): input_data=(hpdata, coordsys), output_projection=sky.wcs, shape_out=size) if args.smooth: - sigma = (2.0 * hp.nside2resol(nside, arcmin=True) * + logger.info("Smoothing the sky patch with a Gaussian filter ...") + sigma = (args.sigma_npix * hp.nside2resol(nside, arcmin=True) * AUC.arcmin2arcsec / pixelsize) image = scipy.ndimage.gaussian_filter(image, sigma=sigma) logger.info("Smoothed sky patch using Gaussian filter of " + -- cgit v1.2.2