aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2017-12-10 23:21:01 +0800
committerAaron LI <aly@aaronly.me>2017-12-10 23:21:01 +0800
commit48923e3afd3b8ee049b199d352e2912dceca5476 (patch)
tree0f4e25080f325cc1e03b2890d51a57ddb6388dc0
parentaf31cc7223f5ac42ef5e71b1ddc93a412e4535dc (diff)
downloadatoolbox-48923e3afd3b8ee049b199d352e2912dceca5476.tar.bz2
astro/fitsimage.py: allow the absence of CDELT{1,2} keywords
-rwxr-xr-xastro/fits/fitsimage.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/astro/fits/fitsimage.py b/astro/fits/fitsimage.py
index c83f02f..6238f60 100755
--- a/astro/fits/fitsimage.py
+++ b/astro/fits/fitsimage.py
@@ -103,8 +103,11 @@ class FITSImage:
self._pixelsize = value
# Update header
self.header["PixSize"] = value # [arcsec]
- self.header["CDELT1"] *= value / oldvalue
- self.header["CDELT2"] *= value / oldvalue
+ try:
+ self.header["CDELT1"] *= value / oldvalue
+ self.header["CDELT2"] *= value / oldvalue
+ except KeyError:
+ pass
@property
def fov(self):