From 8b5274f3ade9b67178e8e834a778936f21038713 Mon Sep 17 00:00:00 2001 From: Mihai Cara Date: Tue, 9 Aug 2016 16:20:48 -0400 Subject: Fixes a bug (ValueError crash in applying headerlets using ``apply_as_primary``) revealed in Footprints ticket no. 9151 --- stwcs/wcsutil/headerlet.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'stwcs/wcsutil/headerlet.py') 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'], "") -- cgit