diff options
Diffstat (limited to 'lib/stwcs/wcsutil')
-rw-r--r-- | lib/stwcs/wcsutil/altwcs.py | 4 | ||||
-rw-r--r-- | lib/stwcs/wcsutil/hstwcs.py | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/stwcs/wcsutil/altwcs.py b/lib/stwcs/wcsutil/altwcs.py index e4ca488..ad17a11 100644 --- a/lib/stwcs/wcsutil/altwcs.py +++ b/lib/stwcs/wcsutil/altwcs.py @@ -424,10 +424,10 @@ def _restore(fobj, ukey, fromextnum, fobj[toextension].header.update(key=key, value = hwcs[k]) else: continue - if key == 'O' and fobj[toextension].header.has_key('TDDALPHA'): + if key == 'O' and 'TDDALPHA' in fobj[toextension].header: fobj[toextension].header['TDDALPHA'] = 0.0 fobj[toeztension].header['TDDBETA'] = 0.0 - if fobj[toextension].header.has_key('ORIENTAT'): + if 'ORIENTAT' in fobj[toextension].header: norient = np.rad2deg(np.arctan2(hwcs['CD1_2'+'%s' %ukey], hwcs['CD2_2'+'%s' %ukey])) fobj[toextension].header.update(key='ORIENTAT', value=norient) diff --git a/lib/stwcs/wcsutil/hstwcs.py b/lib/stwcs/wcsutil/hstwcs.py index c5bdd71..f52c27a 100644 --- a/lib/stwcs/wcsutil/hstwcs.py +++ b/lib/stwcs/wcsutil/hstwcs.py @@ -218,13 +218,13 @@ class HSTWCS(WCS): """ if self.idctab in [None, '', ' ','N/A']: #Keyword idctab is not present in header - check for sip coefficients - if header is not None and header.has_key('IDCSCALE'): + if header is not None and 'IDCSCALE' in header: self._readModelFromHeader(header) else: print "Distortion model is not available: IDCTAB=None\n" self.idcmodel = None elif not os.path.exists(fileutil.osfn(self.idctab)): - if header is not None and header.has_key('IDCSCALE'): + if header is not None and 'IDCSCALE' in header: self._readModelFromHeader(header) else: print 'Distortion model is not available: IDCTAB file %s not found\n' % self.idctab |