From af56b9ad582ac0fe25ef7e941fbec4309906f7f5 Mon Sep 17 00:00:00 2001 From: Nadia Dencheva Date: Wed, 10 Aug 2016 11:53:10 -0400 Subject: the rest of pep8 changes --- stwcs/wcsutil/getinput.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'stwcs/wcsutil/getinput.py') diff --git a/stwcs/wcsutil/getinput.py b/stwcs/wcsutil/getinput.py index 8ee1123..da52970 100644 --- a/stwcs/wcsutil/getinput.py +++ b/stwcs/wcsutil/getinput.py @@ -1,23 +1,26 @@ +from __future__ import absolute_import, division, print_function from astropy.io import fits from stsci.tools import irafglob, fileutil, parseinput +from .hstwcs import HSTWCS + def parseSingleInput(f=None, ext=None): if isinstance(f, str): # create an HSTWCS object from a filename - if ext != None: + if ext is None: filename = f - if isinstance(ext,tuple): + if isinstance(ext, tuple): if ext[0] == '': - extnum = ext[1] # handle ext=('',1) + extnum = ext[1] # handle ext=('',1) else: extnum = ext else: extnum = int(ext) - elif ext == None: + elif ext is None: filename, ext = fileutil.parseFilename(f) ext = fileutil.parseExtn(ext) if ext[0] == '': - extnum = int(ext[1]) #handle ext=('',extnum) + extnum = int(ext[1]) # handle ext=('',extnum) else: extnum = ext phdu = fits.open(filename) @@ -29,7 +32,7 @@ def parseSingleInput(f=None, ext=None): elif isinstance(f, fits.HDUList): phdu = f - if ext == None: + if ext is None: extnum = 0 else: extnum = ext @@ -54,7 +57,7 @@ def parseMultipleInput(input): filelist, output = parseinput.parseinput(input) except IOError: raise elif isinstance(input, list): - if isinstance(input[0], wcsutil.HSTWCS): + if isinstance(input[0], HSTWCS): # a list of HSTWCS objects return input else: -- cgit