diff options
Diffstat (limited to 'lib/stwcs/gui')
-rw-r--r-- | lib/stwcs/gui/apply_headerlet.help | 12 | ||||
-rw-r--r-- | lib/stwcs/gui/apply_headerlet.py | 19 | ||||
-rw-r--r-- | lib/stwcs/gui/delete_headerlet.py | 11 | ||||
-rw-r--r-- | lib/stwcs/gui/pars/delete_headerlet.cfgspc | 2 |
4 files changed, 24 insertions, 20 deletions
diff --git a/lib/stwcs/gui/apply_headerlet.help b/lib/stwcs/gui/apply_headerlet.help index 15c81a0..f701b52 100644 --- a/lib/stwcs/gui/apply_headerlet.help +++ b/lib/stwcs/gui/apply_headerlet.help @@ -1,5 +1,5 @@ This task applies a headerlet to a science observation to update either the -PRIMARY WCS or to add it as an alternate WCS. +PRIMARY WCS or to add it as an alternate WCS. filename = "" hdrlet = "" @@ -13,10 +13,10 @@ verbose = False Parameters ---------- -filename: string - File name of science observation whose WCS solution will be updated -hdrlet: string - Headerlet file +filename: string, @-file or wild-card name + File name(s) of science observation whose WCS solution will be updated +hdrlet: string, @-file or wild-card name + Headerlet file(s), must match input filenames 1-to-1 attach: boolean True (default): append headerlet to FITS file as a new extension. primary: boolean @@ -29,7 +29,7 @@ force: boolean WCS even if it has a different distortion model. [Default: False] wcskey: string Key value (A-Z, except O) for this alternate WCS - If None, the next available key will be used + If None, the next available key will be used wcsname: string Name to be assigned to this alternate WCS WCSNAME is a required keyword in a Headerlet but this allows the diff --git a/lib/stwcs/gui/apply_headerlet.py b/lib/stwcs/gui/apply_headerlet.py index 1b97e38..d87f586 100644 --- a/lib/stwcs/gui/apply_headerlet.py +++ b/lib/stwcs/gui/apply_headerlet.py @@ -1,8 +1,8 @@ import os -import string +import string import pyfits -from stsci.tools import teal +from stsci.tools import teal, parseinput import stwcs from stwcs.wcsutil import headerlet @@ -31,12 +31,16 @@ def getHelpAsString(docstring=False): def run(configObj=None): + # start by interpreting filename and hdrlet inputs + filename = parseinput.parseinput(configObj['filename'])[0] + hdrlet = parseinput.parseinput(configObj['hdrlet'])[0] + if configObj['primary']: # Call function with properly interpreted input parameters # Syntax: apply_headerlet_as_primary(filename, hdrlet, attach=True, # archive=True, force=False, verbose=False) - headerlet.apply_headerlet_as_primary(configObj['filename'], - configObj['hdrlet'],attach=configObj['attach'], + headerlet.apply_headerlet_as_primary(filename, + hdrlet,attach=configObj['attach'], archive=configObj['archive'],force=configObj['force'], logging=configObj['logging']) else: @@ -45,10 +49,9 @@ def run(configObj=None): wcskey = configObj['wcskey'] if wcskey == '': wcskey = None # Call function with properly interpreted input parameters - # apply_headerlet_as_alternate(filename, hdrlet, attach=True, + # apply_headerlet_as_alternate(filename, hdrlet, attach=True, # wcskey=None, wcsname=None, verbose=False) - headerlet.apply_headerlet_as_alternate(configObj['filename'], - configObj['hdrlet'], attach=configObj['attach'], + headerlet.apply_headerlet_as_alternate(filename, + hdrlet, attach=configObj['attach'], wcsname=wcsname, wcskey=wcskey, logging=configObj['logging']) - diff --git a/lib/stwcs/gui/delete_headerlet.py b/lib/stwcs/gui/delete_headerlet.py index 24a2ba2..9eed22b 100644 --- a/lib/stwcs/gui/delete_headerlet.py +++ b/lib/stwcs/gui/delete_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 @@ -31,7 +32,7 @@ def getHelpAsString(docstring=False): return helpString def run(configObj=None): - + if configObj['hdrname'] == '' and configObj['hdrext'] is None and \ configObj['distname'] == '': print '='*60 @@ -40,12 +41,12 @@ def run(configObj=None): print ' Please restart this task and provide a value for one of these parameters.' print '='*60 return - + filename = parseinput.parseinput(configObj['filename'])[0] # Call function with properly interpreted input parameters # Syntax: delete_headerlet(filename, hdrname=None, hdrext=None, distname=None) - headerlet.delete_headerlet(configObj['filename'], - hdrname = configObj['hdrname'], - hdrext = configObj['hdrext'], + headerlet.delete_headerlet(filename, + hdrname = configObj['hdrname'], + hdrext = configObj['hdrext'], distname = configObj['distname'], logging = configObj['logging']) diff --git a/lib/stwcs/gui/pars/delete_headerlet.cfgspc b/lib/stwcs/gui/pars/delete_headerlet.cfgspc index 7b7cc0b..43790b1 100644 --- a/lib/stwcs/gui/pars/delete_headerlet.cfgspc +++ b/lib/stwcs/gui/pars/delete_headerlet.cfgspc @@ -1,5 +1,5 @@ _task_name_ = string_kw(default="delete_headerlet") -filename = string_kw(default="", comment="FITS image file name") +filename = string_kw(default="", comment="FITS image file name(s), list or wild-card") hdrname = string_kw(default="", comment="Delete headerlet with this HDRNAME") hdrext = integer_or_none_kw(default=None, comment="Delete headerlet from this extension") distname = string_kw(default="", comment="Delete *ALL* with this DISTNAME") |