summaryrefslogtreecommitdiff
path: root/lib/stwcs/gui
diff options
context:
space:
mode:
Diffstat (limited to 'lib/stwcs/gui')
-rw-r--r--lib/stwcs/gui/pars/write_headerlet.cfg4
-rw-r--r--lib/stwcs/gui/pars/write_headerlet.cfgspc4
-rw-r--r--lib/stwcs/gui/write_headerlet.py17
3 files changed, 18 insertions, 7 deletions
diff --git a/lib/stwcs/gui/pars/write_headerlet.cfg b/lib/stwcs/gui/pars/write_headerlet.cfg
index 7dfa3aa..dccff0e 100644
--- a/lib/stwcs/gui/pars/write_headerlet.cfg
+++ b/lib/stwcs/gui/pars/write_headerlet.cfg
@@ -1,13 +1,13 @@
_task_name_ = write_headerlet
filename = ""
+output = ""
+clobber = True
hdrname = ""
wcskey = "PRIMARY"
wcsname = ""
author = ""
descrip = ""
history = ""
-output = ""
-clobber = True
sciext = "SCI"
destim = ""
sipname = ""
diff --git a/lib/stwcs/gui/pars/write_headerlet.cfgspc b/lib/stwcs/gui/pars/write_headerlet.cfgspc
index 5aaffe1..323ab4c 100644
--- a/lib/stwcs/gui/pars/write_headerlet.cfgspc
+++ b/lib/stwcs/gui/pars/write_headerlet.cfgspc
@@ -1,13 +1,13 @@
_task_name_ = string_kw(default="write_headerlet")
filename = string_kw(default="", comment="Input file name")
+output = string_kw(default="", comment="Filename for headerlet FITS file")
+clobber = boolean_kw(default=True, comment= "Overwrite existing headerlet FITS file?")
hdrname = string_kw(default="", comment="Unique name(HDRNAME) for headerlet[REQUIRED]")
wcskey = option_kw("A","B","C","D","E","F","G","H","I","J","K","L","M","N","P","Q","R","S","T","U","V","W","X","Y","Z","PRIMARY", default="PRIMARY", comment="Create headerlet from WCS with this letter")
wcsname = string_kw(default="", comment="Create headerlet from WCS with this name")
author = string_kw(default="", comment="Author name for creator of headerlet")
descrip = string_kw(default="", comment="Short description of headerlet solution")
history = string_kw(default="", comment="Name of ASCII file containing history for headerlet")
-output = string_kw(default="", comment="Filename for headerlet FITS file")
-clobber = boolean_kw(default=True, comment= "Overwrite existing headerlet FITS file?")
sciext = string_kw(default="SCI", comment="EXTNAME of extension with WCS")
destim = string_kw(default="", comment="Rootname of image to which this headerlet applies ")
sipname = string_kw(default="", comment="Name for source of polynomial distortion keywords")
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