summaryrefslogtreecommitdiff
path: root/lib/stwcs/wcsutil/altwcs.py
diff options
context:
space:
mode:
authorbsimon <bsimon@stsci.edu>2015-05-21 14:58:13 -0400
committerbsimon <bsimon@stsci.edu>2015-05-21 14:58:13 -0400
commit01b9e5690f2c2d7a3d0c729217c0cf2343227911 (patch)
treebde60685cae7a48b5ce8f05094644d4a8f1681d4 /lib/stwcs/wcsutil/altwcs.py
parenta6164f4bbcdef912eb583bd2e4038a1e8e4951da (diff)
downloadstwcs_hcf-01b9e5690f2c2d7a3d0c729217c0cf2343227911.tar.gz
Fixed problems with python 2 to 3 conversion
git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stwcs/trunk@40220 fe389314-cf27-0410-b35b-8c050e845b92
Diffstat (limited to 'lib/stwcs/wcsutil/altwcs.py')
-rw-r--r--lib/stwcs/wcsutil/altwcs.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/stwcs/wcsutil/altwcs.py b/lib/stwcs/wcsutil/altwcs.py
index 15123b7..293f22d 100644
--- a/lib/stwcs/wcsutil/altwcs.py
+++ b/lib/stwcs/wcsutil/altwcs.py
@@ -80,7 +80,7 @@ def archiveWCS(fname, ext, wcskey=" ", wcsname=" ", reusekey=False):
Alternatively choose another wcskey with altwcs.available_wcskeys()." %wcskey)
elif wcskey == " ":
# wcsname exists, overwrite it if reuse is True or get the next key
- if wcsname.strip() in wcsnames(f[wcsext].header):
+ if wcsname.strip() in wcsnames(f[wcsext].header).values():
if reusekey:
# try getting the key from an existing WCS with WCSNAME
wkey = getKeyFromName(f[wcsext].header, wcsname)
@@ -133,7 +133,7 @@ def archiveWCS(fname, ext, wcskey=" ", wcsname=" ", reusekey=False):
except:
pass
- for k in hwcs:
+ for k in hwcs.keys():
key = k[:7] + wkey
f[e].header[key] = hwcs[k]
closefobj(fname, f)
@@ -419,7 +419,7 @@ def _restore(fobj, ukey, fromextnum,
if hwcs is None:
return
- for k in hwcs:
+ for k in hwcs.keys():
key = k[:-1]
if key in fobj[toextension].header:
#fobj[toextension].header.update(key=key, value = hwcs[k])