diff options
-rw-r--r-- | lib/stwcs/distortion/utils.py | 6 | ||||
-rw-r--r-- | lib/stwcs/updatewcs/apply_corrections.py | 6 | ||||
-rw-r--r-- | lib/stwcs/updatewcs/npol.py | 2 |
3 files changed, 6 insertions, 8 deletions
diff --git a/lib/stwcs/distortion/utils.py b/lib/stwcs/distortion/utils.py index 449bc18..51df391 100644 --- a/lib/stwcs/distortion/utils.py +++ b/lib/stwcs/distortion/utils.py @@ -33,7 +33,7 @@ def output_wcs(list_of_wcsobj, ref_wcs=None, owcs=None, undistort=True): crval = np.array([crval1,crval2], dtype=np.float64) # this value is now zero-based if owcs is None: - if ref_wcs == None: + if ref_wcs is None: ref_wcs = list_of_wcsobj[0].deepcopy() if undistort: outwcs = undistortWCS(ref_wcs) @@ -98,7 +98,7 @@ def undistortWCS(wcsobj): cx, cy = coeff_converter.sip2idc(wcsobj) # cx, cy can be None because either there is no model available # or updatewcs was not run. - if cx == None or cy == None: + if cx is None or cy is None: if foundIDCTAB(wcsobj.idctab): m = """IDCTAB is present but distortion model is missing. Run updatewcs() to update the headers or @@ -157,7 +157,7 @@ def apply_idc(pixpos, cx, cy, pixref, pscale= None, order=None): pixref: reference opixel position """ - if cx == None: + if cx is None: return pixpos if order is None: 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 |