diff options
author | Nadia Dencheva <nadia.dencheva@gmail.com> | 2016-08-10 11:53:10 -0400 |
---|---|---|
committer | Nadia Dencheva <nadia.dencheva@gmail.com> | 2016-08-10 11:53:10 -0400 |
commit | af56b9ad582ac0fe25ef7e941fbec4309906f7f5 (patch) | |
tree | 972d9d8748653e0efe32afedf0b97b638e3874a8 /stwcs/wcsutil/getinput.py | |
parent | 0268dd1037bfacf06af22ff614c5d8479bd83e99 (diff) | |
download | stwcs_hcf-af56b9ad582ac0fe25ef7e941fbec4309906f7f5.tar.gz |
the rest of pep8 changes
Diffstat (limited to 'stwcs/wcsutil/getinput.py')
-rw-r--r-- | stwcs/wcsutil/getinput.py | 17 |
1 files changed, 10 insertions, 7 deletions
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: |