diff options
author | hack <hack@stsci.edu> | 2011-08-15 10:32:28 -0400 |
---|---|---|
committer | hack <hack@stsci.edu> | 2011-08-15 10:32:28 -0400 |
commit | 505bfbc59aee337a94768e6871b415a6f10ea66f (patch) | |
tree | 5f6e90696a911d7d83022697d2557013ef0df5a7 | |
parent | c5a9470d7db659918d4fbd8530b8981eddad04e7 (diff) | |
download | stwcs_hcf-505bfbc59aee337a94768e6871b415a6f10ea66f.tar.gz |
The code for 'updatewcs' was revised to correctly add the NPOL related keywords to a science header which does not have any HISTORY keywords. This caused problems with data processed using the IMPHTTAB, as that code no longer reports the files used for the photometry keyword computation as HISTORY keywords.
git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@13616 fe389314-cf27-0410-b35b-8c050e845b92
-rw-r--r-- | lib/stwcs/updatewcs/npol.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/stwcs/updatewcs/npol.py b/lib/stwcs/updatewcs/npol.py index db928bf..acef50b 100644 --- a/lib/stwcs/updatewcs/npol.py +++ b/lib/stwcs/updatewcs/npol.py @@ -148,9 +148,13 @@ class NPOLCorr(object): dpaxis1: 'Axis number of the jth independent variable in a distortion function', dpaxis2: 'Axis number of the jth independent variable in a distortion function' } - + # Look for HISTORY keywords. If present, insert new keywords before them + before_key = 'HISTORY' + if before_key not in hdr.ascard: + before_key = None + for key in keys: - hdr.update(key=key, value=values[key], comment=comments[key], before='HISTORY') + hdr.update(key=key, value=values[key], comment=comments[key], before=before_key) addSciExtKw = classmethod(addSciExtKw) |