summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhack <hack@stsci.edu>2011-08-15 10:32:28 -0400
committerhack <hack@stsci.edu>2011-08-15 10:32:28 -0400
commit505bfbc59aee337a94768e6871b415a6f10ea66f (patch)
tree5f6e90696a911d7d83022697d2557013ef0df5a7
parentc5a9470d7db659918d4fbd8530b8981eddad04e7 (diff)
downloadstwcs_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.py8
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)