summaryrefslogtreecommitdiff
path: root/stwcs
diff options
context:
space:
mode:
Diffstat (limited to 'stwcs')
-rw-r--r--stwcs/wcsutil/headerlet.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/stwcs/wcsutil/headerlet.py b/stwcs/wcsutil/headerlet.py
index 0a2e90b..5a980aa 100644
--- a/stwcs/wcsutil/headerlet.py
+++ b/stwcs/wcsutil/headerlet.py
@@ -1988,10 +1988,8 @@ class Headerlet(fits.HDUList):
# Update WCS with HDRNAME as well
for kw in ['SIMPLE', 'BITPIX', 'NAXIS', 'EXTEND']:
- try:
+ if kw in priwcs[0].header:
priwcs[0].header.remove(kw)
- except ValueError:
- pass
priwcs[0].header.set('WCSNAME', self[0].header['WCSNAME'], "")
priwcs[0].header.set('WCSAXES', self[('SIPWCS', i)].header['WCSAXES'], "")