diff options
-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) |