summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authordencheva <dencheva@stsci.edu>2012-03-16 12:11:00 -0400
committerdencheva <dencheva@stsci.edu>2012-03-16 12:11:00 -0400
commit40f51d6c4d33b516015f3b0b94b51bbe0d1f2b7e (patch)
tree362b98951788690e455bc6522fd3af65565fead8 /lib
parent85ce6bf7f21de4fef10634cd63a5b047027f3753 (diff)
downloadstwcs_hcf-40f51d6c4d33b516015f3b0b94b51bbe0d1f2b7e.tar.gz
fix to archiveWCS
git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@15729 fe389314-cf27-0410-b35b-8c050e845b92
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: