From c1c5b3d5e899f8e385c90aae4ff881ecad3c7422 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Mon, 10 Oct 2016 00:29:31 +0800 Subject: utils: Preseve the dtype when read/write FITS files * utils/fits.py: hack the dtype to ignore the byteorder (FITS data use big endianness, e.g., dtype(">f4")) * utils/healpix.py: explicit convert the dtype and log the dtype * bin/healpix2hpx, bin/hpx2healpix: remove the --float argument * other minor fixes/updates --- bin/healpix2hpx | 5 ----- 1 file changed, 5 deletions(-) (limited to 'bin/healpix2hpx') diff --git a/bin/healpix2hpx b/bin/healpix2hpx index c684e09..670e27a 100755 --- a/bin/healpix2hpx +++ b/bin/healpix2hpx @@ -28,8 +28,6 @@ def main(): parser.add_argument("outfile", help="output FITS image in HPX projection") parser.add_argument("-C", "--clobber", action="store_true", help="overwrite the existing output file") - parser.add_argument("-F", "--float", action="store_true", - help="use float (single precision) instead of double") parser.add_argument("-l", "--log", dest="loglevel", default=None, choices=["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"], @@ -68,9 +66,6 @@ def main(): hpx_data, hpx_header = healpix2hpx(args.infile, append_history=history, append_comment=comments) - if args.float: - logger.info("HPX FITS images: use single-precision float numbers") - hpx_data = hpx_data.astype(np.float32) hdu = fits.PrimaryHDU(data=hpx_data, header=hpx_header) hdu.writeto(args.outfile, clobber=args.clobber, checksum=True) logger.info("HPX FITS images write to: %s" % args.outfile) -- cgit v1.2.2