From caf7fd497f71f87ec7be83757c515ed113eb25f8 Mon Sep 17 00:00:00 2001 From: dencheva Date: Wed, 18 Apr 2012 12:12:58 +0000 Subject: fixed a problem with archiving a WCS in simple fits when wcsname is missing git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@16261 fe389314-cf27-0410-b35b-8c050e845b92 --- lib/stwcs/wcsutil/altwcs.py | 5 ++++- 1 file changed, 4 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 7099898..e4ca488 100644 --- a/lib/stwcs/wcsutil/altwcs.py +++ b/lib/stwcs/wcsutil/altwcs.py @@ -68,7 +68,10 @@ def archiveWCS(fname, ext, wcskey=" ", wcsname=" ", reusekey=False): raise KeyError("Either wcskey or wcsname should be specified") if wcsname.strip() == "": - wcsname = readAltWCS(f, ext[0], wcskey=" ")['WCSNAME'] + try: + wcsname = readAltWCS(f, ext[0], wcskey=" ")['WCSNAME'] + except KeyError: + pass wcsext = ext[0] if wcskey != " " and wcskey in wcskeys(f[wcsext].header) and not reusekey: closefobj(fname, f) -- cgit