Package pyraf :: Module iraftask :: Class IrafTask
[hide private]
[frames] | no frames]

Class IrafTask

source code


IRAF task class

Instance Methods [hide private]
 
__init__(self, prefix, name, suffix, filename, pkgname, pkgbinary) source code
 
initTask(self, force=0)
Fill in full pathnames of files and read parameter file(s)
source code
 
_initNoIrafTask(self)
Special-case handle the initialization that is going awry due to a missing IRAF installation.
source code
 
getName(self)
Returns the string name of the task.
source code
 
getPkgname(self)
Returns the string name of the package, if applicable.
source code
 
getPkgbinary(self) source code
 
isHidden(self) source code
 
hasParfile(self) source code
 
getTbflag(self) source code
 
getForeign(self) source code
 
getFilename(self)
Returns the string name of any associated config/parameter file.
source code
 
getFullpath(self)
Return full path name of executable
source code
 
getParpath(self)
Return full path name of parameter file
source code
 
getParList(self, docopy=0)
Return list of all parameter objects
source code
 
getDefaultParList(self)
Return default list of all parameter objects
source code
 
getParDict(self)
Return (min-match) dictionary of all parameter objects
source code
 
getParObject(self, paramname, exact=0, alldict=0)
Get the IrafPar object for a parameter
source code
 
getAllMatches(self, param)
Return list of names of all parameters that may match param
source code
 
addPkgbinary(self, pkgbinary)
Add another entry in list of possible package binary locations
source code
 
setHidden(self, value=1)
set hidden attribute, which can be specified in a separate 'hide' statement
source code
 
isConsistent(self, other)
Returns true if this task is consistent with another task object
source code
 
run(self, *args, **kw)
Execute this task with the specified arguments
source code
 
getMode(self, parList=None)
Returns mode string for this task
source code
 
setParList(self, *args, **kw)
Set arguments to task in _runningParList copy of par list
source code
 
setParam(self, qualifiedName, newvalue, check=1, exact=0, scope='', idxHint=None)
Set parameter specified by qualifiedName to newvalue.
source code
 
getParam(self, qualifiedName, native=1, mode=None, exact=0, prompt=1)
Return parameter specified by qualifiedName.
source code
 
_getParValue(self, paramname, pindex, field, native, mode, exact=0, prompt=1) source code
 
lParam(self, verbose=0)
List the task parameters
source code
 
eParam(self)
Edit the task parameters, PyRAF Tk style
source code
 
tParam(self)
Edit the task parameters, IRAF curses style
source code
 
dParam(self, cl=1)
Dump the task parameters
source code
 
saveParList(self, filename=None, comment=None)
Write task parameters in .par format to filename (name or handle)
source code
 
unlearn(self)
Reset task parameters to their default values
source code
 
scrunchName(self)
Return scrunched version of filename (used for uparm files)
source code
 
__getattr__(self, name) source code
 
__setattr__(self, name, value) source code
 
is_pseudo(self, paramname)
Hook enabling ECL pseudos...
source code
 
__call__(self, *args, **kw) source code
 
__repr__(self) source code
 
__str__(self) source code
 
_specialKW(self, kw)
Return dictionary of any special keywords (subclass hook)
source code
 
_applyRedir(self, redirKW)
Apply I/O redirection (irafexecute does this for executables)
source code
 
_resetRedir(self, resetList, closeFHList)
Restore redirected I/O and close files
source code
 
_run(self, redirKW, specialKW)
Execute task after parameters, I/O redirection are prepared.
source code
 
_updateParList(self, save=0)
Update parameter list after successful task completion
source code
 
_deleteRunningParList(self)
Delete the _runningParList parameter list for this and psets
source code
 
_setParDictList(self)
Set the list of (up to 3) parameter dictionaries for task execution.
source code
 
_getParFromDict(self, paramdict, paramname, pindex, field, native, mode, prompt) source code
 
_initFullpath(self)
Fill in full pathname of executable
source code
 
_initParpath(self)
Initialize parameter file paths
source code
 
_noParFile(self)
Decide what to do if .par file is not found
source code
 
_initParList(self)
Initialize parameter list by reading parameter file
source code
 
_isConsistentPar(self)
Check current par list and default par list for consistency
source code

Inherited from stsci.tools.taskpars.TaskPars: canPerformValidation, getHelpAsString, knowAsNative

Method Details [hide private]

initTask(self, force=0)

source code 

Fill in full pathnames of files and read parameter file(s)

Force indicates whether shortcut initialization can be used or not. (No difference for base IrafTask.)

getName(self)

source code 

Returns the string name of the task.

Overrides: stsci.tools.taskpars.TaskPars.getName
(inherited documentation)

getPkgname(self)

source code 

Returns the string name of the package, if applicable.

Overrides: stsci.tools.taskpars.TaskPars.getPkgname
(inherited documentation)

getFilename(self)

source code 

Returns the string name of any associated config/parameter file.

Overrides: stsci.tools.taskpars.TaskPars.getFilename
(inherited documentation)

getParList(self, docopy=0)

source code 

Return list of all parameter objects

Overrides: stsci.tools.taskpars.TaskPars.getParList

getDefaultParList(self)

source code 

Return default list of all parameter objects

Overrides: stsci.tools.taskpars.TaskPars.getDefaultParList

getParObject(self, paramname, exact=0, alldict=0)

source code 

Get the IrafPar object for a parameter

If exact is set, param name must match exactly. If alldict is set, look in all dictionaries (default is just this task's dictionaries.)

addPkgbinary(self, pkgbinary)

source code 

Add another entry in list of possible package binary locations

Parameter can be a string or a list of strings

run(self, *args, **kw)

source code 

Execute this task with the specified arguments

Overrides: stsci.tools.taskpars.TaskPars.run

getMode(self, parList=None)

source code 

Returns mode string for this task

Searches up the task, package, cl hierarchy for automatic modes

setParList(self, *args, **kw)

source code 

Set arguments to task in _runningParList copy of par list

Creates a copy of the task parameter list and sets the parameters. It is up to subsequent code (in the run method) to propagate these changes to the persistent parameter list.

Special arguments: _setMode=1 to set modes of automatic parameters ParList can be used to pass in an entire parameter list object

setParam(self, qualifiedName, newvalue, check=1, exact=0, scope='', idxHint=None)

source code 

Set parameter specified by qualifiedName to newvalue.

qualifiedName can be a simple parameter name or can be [[package.]task.]paramname[.field]. If check is set to zero, does not check value to make sure it satisfies min-max range or choice list. scope, idxHint are ignored.

Overrides: stsci.tools.taskpars.TaskPars.setParam

getParam(self, qualifiedName, native=1, mode=None, exact=0, prompt=1)

source code 

Return parameter specified by qualifiedName.

qualifiedName can be a simple parameter name or can be [[package.]task.]paramname[.field]. Paramname can also have an optional subscript, "param[1]". If native is non-zero (default), returns native format (e.g. float for floating point parameter.), otherwise returns string value. If exact is set, parameter name must match exactly. Default is to do minimum match. If prompt is 0, does not prompt for parameter value (even if parameter is undefined.)

dParam(self, cl=1)

source code 

Dump the task parameters

Default is to write CL version of code; if cl parameter is false, writes Python executable code instead.

saveParList(self, filename=None, comment=None)

source code 

Write task parameters in .par format to filename (name or handle)

If filename is omitted, writes to uparm scrunch file (if possible) Returns a string with the results.

Overrides: stsci.tools.taskpars.TaskPars.saveParList

scrunchName(self)

source code 

Return scrunched version of filename (used for uparm files)

Scrunched version of filename is chars 1,2,last from package name and chars 1-5,last from task name.

is_pseudo(self, paramname)

source code 

Hook enabling ECL pseudos... always returns False

_applyRedir(self, redirKW)

source code 

Apply I/O redirection (irafexecute does this for executables)

Return a list of redirections that need to be restored when done.

_run(self, redirKW, specialKW)

source code 

Execute task after parameters, I/O redirection are prepared.

The implementation of this can differ for each type of task.

_updateParList(self, save=0)

source code 

Update parameter list after successful task completion

Updates parameter save file if any parameters change. If save flag is set, all changes are saved; if save flag is false, only explicit parameter changes requested by the task are saved.

_setParDictList(self)

source code 

Set the list of (up to 3) parameter dictionaries for task execution.

Parameter dictionaries for execution consist of this task's parameters (which includes any psets referenced), all the parameters for the task of the package loaded for the current task, and the cl parameters. Each dictionary has an associated name (because parameters could be asked for as task.parname as well as just parname).

Create this list anew for each execution in case the list of loaded packages has changed. It is stored as an attribute of this object so it can be accessed by the getParam() and setParam() methods.