From 5ded5c345829f3372ad196648eecd7e0b60bd427 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Sat, 2 Sep 2017 13:57:01 +0800 Subject: rescale_image.py: Fix variable type and name --- astro/fits/rescale_image.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/astro/fits/rescale_image.py b/astro/fits/rescale_image.py index 9008b33..1e857f6 100755 --- a/astro/fits/rescale_image.py +++ b/astro/fits/rescale_image.py @@ -54,8 +54,8 @@ class FITSImage: xsize, ysize = size # [deg] except TypeError: xsize = ysize = size - Nx2 = xsize * 3600 / self.pixelsize - Ny2 = ysize * 3600 / self.pixelsize + Nx2 = round(xsize * 3600 / self.pixelsize) + Ny2 = round(ysize * 3600 / self.pixelsize) if Nx2 > self.Nx or Ny2 > self.Ny: raise ValueError("Crop region too large!") @@ -71,7 +71,7 @@ class FITSImage: header["DATE"] = (datetime.now(timezone.utc).astimezone().isoformat(), "File creation date") header.add_history(" ".join(sys.argv)) - hdu = fits.PrimaryHDU(data=self.data, header=header) + hdu = fits.PrimaryHDU(data=self.image, header=header) try: hdu.writeto(outfile, overwrite=clobber) except TypeError: -- cgit v1.2.2