summaryrefslogtreecommitdiff
path: root/lib/stwcs/updatewcs
diff options
context:
space:
mode:
authordencheva <dencheva@stsci.edu>2015-05-26 10:20:54 -0400
committerdencheva <dencheva@stsci.edu>2015-05-26 10:20:54 -0400
commit71f456c7257e07ad51d530f8c177792c64454781 (patch)
tree21667f22301e06cf4887848e53bc7d983c3a3692 /lib/stwcs/updatewcs
parente61b0356aae80773baa27d8fd5bfbd5d5393fa85 (diff)
downloadstwcs_hcf-71f456c7257e07ad51d530f8c177792c64454781.tar.gz
Raise an IOError if NPOLFILE or D2IMFILE keywords have values but the files are not found on disk. Part of #1074
git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stwcs/trunk@40433 fe389314-cf27-0410-b35b-8c050e845b92
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