summaryrefslogtreecommitdiff
path: root/lib/stwcs/wcsutil/altwcs.py
diff options
context:
space:
mode:
authordencheva <dencheva@stsci.edu>2012-03-15 11:41:28 -0400
committerdencheva <dencheva@stsci.edu>2012-03-15 11:41:28 -0400
commit1da3c640c4b539507361300814b257a4a7467627 (patch)
tree12343ec912473b69b515b437cf11a556412b48e1 /lib/stwcs/wcsutil/altwcs.py
parent16ab61c69d35b8f9ebf0ebb5b9ee02ed3b160ca8 (diff)
downloadstwcs_hcf-1da3c640c4b539507361300814b257a4a7467627.tar.gz
The primary wcs can have a WCSNAME, so if wcsname=' ' in the call to archiveWCS, set wcsname to the one in the primary WCS
git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@15625 fe389314-cf27-0410-b35b-8c050e845b92
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)