summaryrefslogtreecommitdiff
path: root/lib/stwcs/gui/write_headerlet.py
diff options
context:
space:
mode:
authorhack <hack@stsci.edu>2011-11-07 10:36:24 -0500
committerhack <hack@stsci.edu>2011-11-07 10:36:24 -0500
commitd372728784f465dcd451fe9b690f8574f7ec77c2 (patch)
treef107bb7b4e8bf0fca52f690c7e7509a994db5f25 /lib/stwcs/gui/write_headerlet.py
parente847331eced5109044af072a36921a9f776f5ded (diff)
downloadstwcs_hcf-d372728784f465dcd451fe9b690f8574f7ec77c2.tar.gz
This revision fixes a number of bugs; including:
- added a check to 'output' par value in TEAL interface to 'write_headerlet' - implemented use of 'parseinput' in TEAL interface for 'write_headerlet' - moved 'output' and 'clobber' parameters closer to top of par list in TEAL interface for 'write_headerlet' - implemented use of 'parseinput' to interpret input filename(s) for 'write_headerlet' and 'extract_headerlet' providing support for additional input modes - fixed logic problems with defining output filename in 'write_headerlet' and 'extract_headerlet' git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@13964 fe389314-cf27-0410-b35b-8c050e845b92
Diffstat (limited to 'lib/stwcs/gui/write_headerlet.py')
-rw-r--r--lib/stwcs/gui/write_headerlet.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/stwcs/gui/write_headerlet.py b/lib/stwcs/gui/write_headerlet.py
index 2072d2e..1debcf6 100644
--- a/lib/stwcs/gui/write_headerlet.py
+++ b/lib/stwcs/gui/write_headerlet.py
@@ -2,6 +2,7 @@ import os
import pyfits
from stsci.tools import teal
+from stsci.tools import parseinput
import stwcs
from stwcs.wcsutil import headerlet
@@ -32,7 +33,8 @@ def getHelpAsString(docstring=False):
return helpString
def run(configObj=None):
- if not os.path.exists(configObj['filename']):
+ flist,oname = parseinput.parseinput(configObj['filename'])
+ if len(flist) == 0:
print '='*60
print 'ERROR:'
print ' No valid "filename" parameter value provided!'
@@ -47,7 +49,16 @@ def run(configObj=None):
print ' Please restart this task and provide a value for this parameter.'
print '='*60
return
-
+
+ if configObj['output'] in ['',' ','INDEF']:
+ print '='*60
+ print 'ERROR:'
+ print ' No valid "output" parameter value provided!'
+ print ' Please restart this task and provide a value for this parameter.'
+ print '='*60
+ return
+
+
str_kw = ['wcsname','destim','sipname','npolfile','d2imfile',
'descrip','history','author','output']
@@ -71,5 +82,5 @@ def run(configObj=None):
# sipname=None, npolfile=None, d2imfile=None,
# author=None, descrip=None, history=None,
# attach=True, clobber=False)
- headerlet.write_headerlet(configObj['filename'], configObj['hdrname'],
+ headerlet.write_headerlet(flist, configObj['hdrname'],
**cdict) \ No newline at end of file