From 71f456c7257e07ad51d530f8c177792c64454781 Mon Sep 17 00:00:00 2001 From: dencheva Date: Tue, 26 May 2015 14:20:54 +0000 Subject: 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 --- lib/stwcs/updatewcs/apply_corrections.py | 6 ++---- lib/stwcs/updatewcs/npol.py | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'lib/stwcs/updatewcs') 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 -- cgit