summaryrefslogtreecommitdiff
path: root/lib/stwcs/wcsutil/altwcs.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/stwcs/wcsutil/altwcs.py')
-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 d666b37..cedb6b4 100644
--- a/lib/stwcs/wcsutil/altwcs.py
+++ b/lib/stwcs/wcsutil/altwcs.py
@@ -66,7 +66,9 @@ def archiveWCS(fname, ext, wcskey=" ", wcsname=" ", reusekey=False):
if not wcskey and not wcsname:
raise KeyError("Either wcskey or wcsname should be specified")
-
+
+ if wcsname.strip() == "":
+ wcsname = readAltWCS(f, ext[0], wcskey=" ")['WCSNAME']
wcsext = ext[0]
if wcskey != " " and wcskey in wcskeys(f[wcsext].header) and not reusekey:
closefobj(fname, f)