summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/stwcs/wcsutil/altwcs.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/stwcs/wcsutil/altwcs.py b/lib/stwcs/wcsutil/altwcs.py
index cedb6b4..f528f38 100644
--- a/lib/stwcs/wcsutil/altwcs.py
+++ b/lib/stwcs/wcsutil/altwcs.py
@@ -82,7 +82,9 @@ def archiveWCS(fname, ext, wcskey=" ", wcsname=" ", reusekey=False):
# try getting the key from an existing WCS with WCSNAME
wkey = getKeyFromName(f[wcsext].header, wcsname)
wname = wcsname
- if not wkey:
+ if wkey == ' ':
+ wkey = next_wcskey(f[wcsext].header)
+ elif wkey is None:
closefobj(fname, f)
raise KeyError("Could not get a valid wcskey from wcsname %s" %wcsname)
else: