summaryrefslogtreecommitdiff
path: root/lib/stwcs/wcsutil/altwcs.py
diff options
context:
space:
mode:
authordencheva <dencheva@stsci.edu>2012-04-18 08:12:58 -0400
committerdencheva <dencheva@stsci.edu>2012-04-18 08:12:58 -0400
commitcaf7fd497f71f87ec7be83757c515ed113eb25f8 (patch)
tree865cd897b9ce227effe8c1e3806ddf328d83ac54 /lib/stwcs/wcsutil/altwcs.py
parentd5d14f116c0a60d14a0c7e1bf2d459e22ba600f2 (diff)
downloadstwcs_hcf-caf7fd497f71f87ec7be83757c515ed113eb25f8.tar.gz
fixed a problem with archiving a WCS in simple fits when wcsname is missing
git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@16261 fe389314-cf27-0410-b35b-8c050e845b92
Diffstat (limited to 'lib/stwcs/wcsutil/altwcs.py')
-rw-r--r--lib/stwcs/wcsutil/altwcs.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/stwcs/wcsutil/altwcs.py b/lib/stwcs/wcsutil/altwcs.py
index 7099898..e4ca488 100644
--- a/lib/stwcs/wcsutil/altwcs.py
+++ b/lib/stwcs/wcsutil/altwcs.py
@@ -68,7 +68,10 @@ def archiveWCS(fname, ext, wcskey=" ", wcsname=" ", reusekey=False):
raise KeyError("Either wcskey or wcsname should be specified")
if wcsname.strip() == "":
- wcsname = readAltWCS(f, ext[0], wcskey=" ")['WCSNAME']
+ try:
+ wcsname = readAltWCS(f, ext[0], wcskey=" ")['WCSNAME']
+ except KeyError:
+ pass
wcsext = ext[0]
if wcskey != " " and wcskey in wcskeys(f[wcsext].header) and not reusekey:
closefobj(fname, f)