diff options
-rw-r--r-- | updatewcs/__init__.py | 6 | ||||
-rw-r--r-- | wcsutil/hstwcs.py | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/updatewcs/__init__.py b/updatewcs/__init__.py index e07e115..9c899db 100644 --- a/updatewcs/__init__.py +++ b/updatewcs/__init__.py @@ -5,6 +5,7 @@ import pyfits import numpy as np from stwcs import wcsutil from stwcs.wcsutil import HSTWCS +from stwcs import __version__ as stwcsversion import pywcs import utils, corrections, makewcs @@ -160,8 +161,9 @@ def makecorr(fname, allowed_corr, wkey=" ", wname=" ", clobber=False): if 'DGEOCorr' in allowed_corr: kw2update = dgeo.DGEOCorr.updateWCS(f) for kw in kw2update: - f[1].header.update(kw, kw2update[kw]) - + f[1].header.update(kw, kw2update[kw]) + # Finally record the version of the software which updated the WCS + f[0].header.update(key='UPWCSVER', value=stwcsversion, comment="Version of STWCS used to updated the WCS", before='HISTORY') f.close() def getKeyName(hdr, wkey, wname, idcname): diff --git a/wcsutil/hstwcs.py b/wcsutil/hstwcs.py index 122a0ba..9bf944f 100644 --- a/wcsutil/hstwcs.py +++ b/wcsutil/hstwcs.py @@ -17,8 +17,6 @@ from mappings import basic_wcs __docformat__ = 'restructuredtext' -__version__ = '0.7.1' - class HSTWCS(WCS): @@ -260,7 +258,7 @@ class HSTWCS(WCS): if self.wcs.has_cd(): h = altwcs.pc2cd(h, key=self.wcskey) - if sip2hdr: + if sip2hdr and self.sip: hwcs = h.ascardlist() cards = self._sip2hdr('a') hwcs.extend(cards) |