summaryrefslogtreecommitdiff
path: root/lib/stwcs/updatewcs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/stwcs/updatewcs')
-rw-r--r--lib/stwcs/updatewcs/apply_corrections.py6
-rw-r--r--lib/stwcs/updatewcs/npol.py2
2 files changed, 3 insertions, 5 deletions
diff --git a/lib/stwcs/updatewcs/apply_corrections.py b/lib/stwcs/updatewcs/apply_corrections.py
index 7019863..b189b43 100644
--- a/lib/stwcs/updatewcs/apply_corrections.py
+++ b/lib/stwcs/updatewcs/apply_corrections.py
@@ -153,8 +153,7 @@ def applyNpolCorr(fname, unpolcorr):
Non-polynomial distortion correction will not be applied\n
""" % fnpol0
logger.critical(msg)
- applyNPOLCorr = False
- return applyNPOLCorr
+ raise IOError("NPOLFILE {0} not found".format(fnpol0))
try:
# get NPOLEXT kw from first extension header
fnpol1 = fits.getval(fname, 'NPOLEXT', ext=1)
@@ -216,8 +215,7 @@ def applyD2ImCorr(fname, d2imcorr):
Detector to image correction will not be applied\n""" % fd2im0
logger.critical(msg)
print(msg)
- applyD2IMCorr = False
- return applyD2IMCorr
+ raise IOError("D2IMFILE {0} not found".format(fd2im0))
try:
# get D2IMEXT kw from first extension header
fd2imext = fits.getval(fname, 'D2IMEXT', ext=1)
diff --git a/lib/stwcs/updatewcs/npol.py b/lib/stwcs/updatewcs/npol.py
index 2f8d836..33579f0 100644
--- a/lib/stwcs/updatewcs/npol.py
+++ b/lib/stwcs/updatewcs/npol.py
@@ -82,7 +82,7 @@ class NPOLCorr(object):
dx,dy = cls.getData(nplfile, ccdchip)
idccoeffs = cls.getIDCCoeffs(header)
- if idccoeffs != None:
+ if idccoeffs is not None:
dx, dy = cls.transformData(dx,dy, idccoeffs)
# Determine EXTVER for the WCSDVARR extension from the