diff options
author | mcara <mcara@stsci.edu> | 2014-06-04 00:42:25 -0400 |
---|---|---|
committer | mcara <mcara@stsci.edu> | 2014-06-04 00:42:25 -0400 |
commit | 6637d499e773ada6d0f9707227b5622ff07b2d32 (patch) | |
tree | 8b0806014cf532d6e0c1610baefe1520a415f98b | |
parent | 664676db3ae5fb278b8026e5d90834dd6aced4aa (diff) | |
download | stwcs_hcf-6637d499e773ada6d0f9707227b5622ff07b2d32.tar.gz |
deleteWCS crashes when called on compressed FITS HDU (CompImageHDU) because of a bug in CompImageHDU that does not allow `del` on non-existent header keywords.
For more details see https://github.com/astropy/astropy/issues/2594
git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stwcs/trunk@32334 fe389314-cf27-0410-b35b-8c050e845b92
-rw-r--r-- | lib/stwcs/wcsutil/altwcs.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/stwcs/wcsutil/altwcs.py b/lib/stwcs/wcsutil/altwcs.py index befa2bb..bdb9b3b 100644 --- a/lib/stwcs/wcsutil/altwcs.py +++ b/lib/stwcs/wcsutil/altwcs.py @@ -350,7 +350,8 @@ def deleteWCS(fname, ext, wcskey=" ", wcsname=" "): if hwcs is None: continue for k in hwcs.keys(): - del hdr[k] + if k in hdr: + del hdr[k] #del hdr['ORIENT'+wkey] prexts.append(i) if prexts != []: |