From 1da3c640c4b539507361300814b257a4a7467627 Mon Sep 17 00:00:00 2001 From: dencheva Date: Thu, 15 Mar 2012 15:41:28 +0000 Subject: 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 --- 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 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) -- cgit