aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2017-09-02 13:57:01 +0800
committerAaron LI <aly@aaronly.me>2017-09-02 13:58:23 +0800
commit5ded5c345829f3372ad196648eecd7e0b60bd427 (patch)
treead614d4ef56d5fe81edd1c83c1a76c06c4261c8a
parent5cd9e9133748793f74eccf15906ea8e0a91e950b (diff)
downloadatoolbox-5ded5c345829f3372ad196648eecd7e0b60bd427.tar.bz2
rescale_image.py: Fix variable type and name
-rwxr-xr-xastro/fits/rescale_image.py6
1 files 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: