summaryrefslogtreecommitdiff
path: root/lib/stwcs/distortion
diff options
context:
space:
mode:
Diffstat (limited to 'lib/stwcs/distortion')
-rw-r--r--lib/stwcs/distortion/coeff_converter.py6
-rw-r--r--lib/stwcs/distortion/models.py4
-rw-r--r--lib/stwcs/distortion/mutil.py10
3 files changed, 10 insertions, 10 deletions
diff --git a/lib/stwcs/distortion/coeff_converter.py b/lib/stwcs/distortion/coeff_converter.py
index bbad867..a0ff1a4 100644
--- a/lib/stwcs/distortion/coeff_converter.py
+++ b/lib/stwcs/distortion/coeff_converter.py
@@ -76,8 +76,8 @@ def _read_sip_kw(header):
If no SIP header keywords are found, None is returned.
"""
- if header.has_key("A_ORDER"):
- if not header.has_key("B_ORDER"):
+ if "A_ORDER" in header:
+ if "B_ORDER" not in header:
raise ValueError(
"A_ORDER provided without corresponding B_ORDER "
"keyword for SIP distortion")
@@ -93,7 +93,7 @@ def _read_sip_kw(header):
for i in range(m+1):
for j in range(m-i+1):
b[i, j] = header.get("B_%d_%d" % (i, j), 0.0)
- elif header.has_key("B_ORDER"):
+ elif "B_ORDER" in header:
raise ValueError(
"B_ORDER provided without corresponding A_ORDER "
"keyword for SIP distortion")
diff --git a/lib/stwcs/distortion/models.py b/lib/stwcs/distortion/models.py
index db48a9f..3e7d2b4 100644
--- a/lib/stwcs/distortion/models.py
+++ b/lib/stwcs/distortion/models.py
@@ -273,7 +273,7 @@ class IDCModel(GeometryModel):
chip=chip,direction=direction,filter1=filter1,filter2=filter2,
date=date, offtab=offtab)
- if self.refpix.has_key('empty_model') and self.refpix['empty_model']:
+ if 'empty_model' in self.refpix and self.refpix['empty_model']:
pass
else:
self.refpix['PSCALE'] = self.refpix['PSCALE'] * binned
@@ -296,7 +296,7 @@ class WCSModel(GeometryModel):
GeometryModel.__init__(self)
- if header.has_key('rootname'):
+ if 'rootname' in header:
self.name = header['rootname']
else:
self.name = rootname
diff --git a/lib/stwcs/distortion/mutil.py b/lib/stwcs/distortion/mutil.py
index fc97606..02fc4c2 100644
--- a/lib/stwcs/distortion/mutil.py
+++ b/lib/stwcs/distortion/mutil.py
@@ -67,10 +67,10 @@ def readIDCtab (tabname, chip=1, date=None, direction='forward',
#First thing we need, is to read in the coefficients from the IDC
# table and populate the Fx and Fy matrices.
- if ftab['PRIMARY'].header.has_key('DETECTOR'):
+ if 'DETECTOR' in ftab['PRIMARY'].header:
detector = ftab['PRIMARY'].header['DETECTOR']
else:
- if ftab['PRIMARY'].header.has_key('CAMERA'):
+ if 'CAMERA' in ftab['PRIMARY'].header:
detector = str(ftab['PRIMARY'].header['CAMERA'])
else:
detector = 1
@@ -263,7 +263,7 @@ def read_tdd_coeffs(phdr):
skew_coeffs['TDD_A'] = None
skew_coeffs['TDD_B'] = None
- if phdr.has_key("TDDORDER"):
+ if "TDDORDER" in phdr:
n = int(phdr["TDDORDER"])
else:
print 'TDDORDER kw not present, using default TDD correction'
@@ -438,7 +438,7 @@ def readWCSCoeffs(header):
for i in xrange(_xorder+1):
for j in xrange(i+1):
xcname = cxstr+str(j)+'_'+str(i-j)
- if header.has_key(xcname):
+ if xcname in header:
fx[i,j] = header[xcname]
# Extract Y coeffs separately as a different order may
@@ -446,7 +446,7 @@ def readWCSCoeffs(header):
for i in xrange(_yorder+1):
for j in xrange(i+1):
ycname = cystr+str(j)+'_'+str(i-j)
- if header.has_key(ycname):
+ if ycname in header:
fy[i,j] = header[ycname]
# Now set the linear terms