From 8cbc50fe21cfb148e9ef48b4d1700bbdd2af1d63 Mon Sep 17 00:00:00 2001 From: embray Date: Wed, 22 Feb 2012 18:17:23 +0000 Subject: Should fix most problems in stwcs due to pyfits Header updates. The main issue that caused incompatibility is that slices of headers (including by wildcard patterns) now returns a new Header rather than a list of cards. git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@15198 fe389314-cf27-0410-b35b-8c050e845b92 --- lib/stwcs/wcsutil/convertwcs.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/stwcs/wcsutil/convertwcs.py') diff --git a/lib/stwcs/wcsutil/convertwcs.py b/lib/stwcs/wcsutil/convertwcs.py index 80276c3..0fa61af 100644 --- a/lib/stwcs/wcsutil/convertwcs.py +++ b/lib/stwcs/wcsutil/convertwcs.py @@ -65,7 +65,7 @@ def archive_prefix_OPUS_WCS(fobj,extname='SCI'): for key in wcskeys: okey = 'O'+key[:7] hdr = fobj[(extname,e)].header - if hdr.has_key(okey): + if okey in hdr: # Update alternate WCS keyword with prefix-O OPUS keyword value hdr[key] = hdr[okey] @@ -102,7 +102,7 @@ def create_prefix_OPUS_WCS(fobj,extname='SCI'): raise IOError # check for existance of O-prefix WCS - if not fobj['sci',1].header.has_key(owcskeys[0]): + if owcskeys[0] not in fobj['sci',1].header: # find out how many SCI extensions are in the image numextn = fileutil.countExtn(fobj,extname=extname) @@ -111,7 +111,7 @@ def create_prefix_OPUS_WCS(fobj,extname='SCI'): for extn in xrange(1,numextn+1): hdr = fobj[(extname,extn)].header for okey in owcskeys: - hdr.update(okey,hdr[okey[1:]+'O']) + hdr[okey] = hdr[okey[1:]+'O'] # Close FITS image if we had to open it... if closefits: -- cgit