From 505bfbc59aee337a94768e6871b415a6f10ea66f Mon Sep 17 00:00:00 2001 From: hack Date: Mon, 15 Aug 2011 14:32:28 +0000 Subject: 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 --- lib/stwcs/updatewcs/npol.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/stwcs/updatewcs/npol.py') 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) -- cgit