From f1560262d88a255fe4c63b8b4e7f171c4af12111 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Tue, 12 Sep 2017 19:47:52 +0800 Subject: taper_sky.py: Convert input image to be float32 --- astro/oskar/taper_sky.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/astro/oskar/taper_sky.py b/astro/oskar/taper_sky.py index 282fe66..f70b47c 100755 --- a/astro/oskar/taper_sky.py +++ b/astro/oskar/taper_sky.py @@ -147,8 +147,8 @@ def main(): args.outfile_taper) with fits.open(args.infile) as f: - image = f[0].data - header = f[0].header + image = f[0].data.astype(np.float32) + header = f[0].header.copy(strip=True) logger.info("Read sky image from file: %s" % args.infile) L = args.Router @@ -189,7 +189,7 @@ def main(): header["OBJECT"] = ("Tukey Window", "Taper window") header["Rinner"] = (args.Rinner, "[pixel] inner radius") header["Router"] = (args.Router, "[pixel] outer radius") - hdu = fits.PrimaryHDU(data=taper, header=header) + hdu = fits.PrimaryHDU(data=taper.astype(np.float32), header=header) hdu.writeto(args.outfile_taper) logger.info("Wrote tapered to file: %s" % args.outfile_taper) -- cgit v1.2.2