diff options
-rw-r--r-- | updatewcs/__init__.py | 14 | ||||
-rw-r--r-- | updatewcs/makewcs.py | 3 |
2 files changed, 16 insertions, 1 deletions
diff --git a/updatewcs/__init__.py b/updatewcs/__init__.py index 10bba90..c98e67f 100644 --- a/updatewcs/__init__.py +++ b/updatewcs/__init__.py @@ -180,7 +180,19 @@ def makecorr(fname, allowed_corr, wkey=" ", wname=" ", clobber=False): for kw in kw2update: 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') + if f[0].header.has_key('HISTORY'): + f[0].header.update(key='UPWCSVER', value=stwcsversion, + comment="Version of STWCS used to updated the WCS", before='HISTORY') + elif f[0].header.has_key('ASN_MTYP'): + f[0].header.update(key='UPWCSVER', value=stwcsversion, + comment="Version of STWCS used to updated the WCS", after='ASN_MTYP') + else: + # Find index of last non-blank card, and insert this new keyword after that card + for i in range(len(f[0].header.ascard)-1,0,-1): + if f[0].header[i].strip() != '': break + + f[0].header.update(key='UPWCSVER', value=stwcsversion, + comment="Version of STWCS used to updated the WCS",after=i) f.close() def getKeyName(hdr, wkey, wname, idcname): diff --git a/updatewcs/makewcs.py b/updatewcs/makewcs.py index ad7c508..f23da7e 100644 --- a/updatewcs/makewcs.py +++ b/updatewcs/makewcs.py @@ -179,6 +179,9 @@ class MakeWCS(object): except KeyError: alpha = 0.0 beta = 0.0 + v23_corr = np.array([[0.],[0.]]) + logger.debug("\n\tTDD Zero point correction for chip %s defaulted to: %s" % (hwcs.chip, v23_corr)) + return v23_corr tdd = np.array([[beta, alpha], [alpha, -beta]]) mrotp = fileutil.buildRotMatrix(2.234529)/2048. |