From 40f51d6c4d33b516015f3b0b94b51bbe0d1f2b7e Mon Sep 17 00:00:00 2001 From: dencheva Date: Fri, 16 Mar 2012 16:11:00 +0000 Subject: fix to archiveWCS git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@15729 fe389314-cf27-0410-b35b-8c050e845b92 --- lib/stwcs/wcsutil/altwcs.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/stwcs/wcsutil/altwcs.py') 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: -- cgit