diff options
author | embray <embray@stsci.edu> | 2012-02-22 13:17:23 -0500 |
---|---|---|
committer | embray <embray@stsci.edu> | 2012-02-22 13:17:23 -0500 |
commit | 8cbc50fe21cfb148e9ef48b4d1700bbdd2af1d63 (patch) | |
tree | cb4939bc290bb413bed4132a2a188a33fc18dd5e /lib/stwcs/wcsutil/convertwcs.py | |
parent | 3c9cc9b532095b83b3e66333ca74cd29e3ee56c6 (diff) | |
download | stwcs_hcf-8cbc50fe21cfb148e9ef48b4d1700bbdd2af1d63.tar.gz |
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
Diffstat (limited to 'lib/stwcs/wcsutil/convertwcs.py')
-rw-r--r-- | lib/stwcs/wcsutil/convertwcs.py | 6 |
1 files changed, 3 insertions, 3 deletions
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: |