diff options
author | dencheva <dencheva@stsci.edu> | 2012-04-18 08:12:58 -0400 |
---|---|---|
committer | dencheva <dencheva@stsci.edu> | 2012-04-18 08:12:58 -0400 |
commit | caf7fd497f71f87ec7be83757c515ed113eb25f8 (patch) | |
tree | 865cd897b9ce227effe8c1e3806ddf328d83ac54 /lib/stwcs/wcsutil/altwcs.py | |
parent | d5d14f116c0a60d14a0c7e1bf2d459e22ba600f2 (diff) | |
download | stwcs_hcf-caf7fd497f71f87ec7be83757c515ed113eb25f8.tar.gz |
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
Diffstat (limited to 'lib/stwcs/wcsutil/altwcs.py')
-rw-r--r-- | lib/stwcs/wcsutil/altwcs.py | 5 |
1 files changed, 4 insertions, 1 deletions
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) |