From 2ef0aacf55807bf346014b224f2139d9c67a4522 Mon Sep 17 00:00:00 2001 From: dencheva Date: Fri, 18 Dec 2009 17:01:35 +0000 Subject: Minor refactoring and cleaning; fixed a problem when ORIENTAT is not present in the header. Tests against makewcs pass for all instruments. git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@8507 fe389314-cf27-0410-b35b-8c050e845b92 --- lib/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/utils.py') diff --git a/lib/utils.py b/lib/utils.py index 2731f87..504d609 100644 --- a/lib/utils.py +++ b/lib/utils.py @@ -68,7 +68,10 @@ def write_archive(header): cmt = 'archived value' for kw in basic_wcs: nkw = 'O'+kw - header.update(nkw[:8], header[kw], comment=cmt) + try: + header.update(nkw[:8], header[kw], comment=cmt) + except KeyError: #ORIENTAT is not always present in headers + pass header.update('WCSCDATE', fileutil.getLTime(), comment='Local time the WCS kw were archived') -- cgit