diff options
author | Aaron LI <aly@aaronly.me> | 2017-09-02 13:57:01 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2017-09-02 13:58:23 +0800 |
commit | 5ded5c345829f3372ad196648eecd7e0b60bd427 (patch) | |
tree | ad614d4ef56d5fe81edd1c83c1a76c06c4261c8a /astro/fits/rescale_image.py | |
parent | 5cd9e9133748793f74eccf15906ea8e0a91e950b (diff) | |
download | atoolbox-5ded5c345829f3372ad196648eecd7e0b60bd427.tar.bz2 |
rescale_image.py: Fix variable type and name
Diffstat (limited to 'astro/fits/rescale_image.py')
-rwxr-xr-x | astro/fits/rescale_image.py | 6 |
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: |