This is not usually used directly -- the relevant public classes and
functions get included in iraf.py. The implementations are kept here to
avoid possible problems with name conflicts in iraf.py (which is the home
for all the IRAF task and package names.) Private routines have names
beginning with '_' and do not get imported by the iraf module.
The exception is that iraffunctions can be used directly for modules
that must be compiled and executed early, before the pyraf module
initialization is complete.
R. White, 2000 January 20
|
|
|
|
|
|
|
|
Init(doprint=1,
hush=0,
savefile=None)
Basic initialization of IRAF environment |
source code
|
|
|
|
_getIrafEnv(file='/usr/local/bin/cl',
vars=('IRAFARCH', 'iraf'))
Returns dictionary of environment vars defined in cl startup file |
source code
|
|
|
|
|
|
|
restoreFromFile(savefile,
doprint=1,
**kw)
Initialize IRAF environment from pickled save file (or file handle) |
source code
|
|
|
|
_addPkg(pkg)
Add an IRAF package to the packages list |
source code
|
|
|
|
_addTask(task,
pkgname=None)
Add an IRAF task to the tasks list |
source code
|
|
|
|
|
|
|
|
|
|
addLoaded(pkg)
Add an IRAF package to the loaded pkgs list |
source code
|
|
|
|
load(pkgname,
args=(),
kw=None,
doprint=1,
hush=0,
save=1)
Load an IRAF package by name |
source code
|
|
|
|
run(taskname,
args=(),
kw=None,
save=1)
Run an IRAF task by name |
source code
|
|
|
|
getAllTasks(taskname)
Returns list of names of all IRAF tasks that may match taskname |
source code
|
|
|
|
getAllPkgs(pkgname)
Returns list of names of all IRAF pkgs that may match pkgname |
source code
|
|
|
|
|
|
|
getPkg(pkgname,
found=0)
Find an IRAF package by name using minimum match |
source code
|
|
|
|
getTaskList()
Returns list of names of all defined IRAF tasks |
source code
|
|
|
|
getTaskObjects()
Returns list of all defined IrafTask objects |
source code
|
|
|
|
getPkgList()
Returns list of names of all defined IRAF packages |
source code
|
|
|
|
getLoadedList()
Returns list of names of all loaded IRAF packages |
source code
|
|
|
|
getVarDict()
Returns dictionary all IRAF variables |
source code
|
|
|
|
getVarList()
Returns list of names of all IRAF variables |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
listTasks(*args,
**kw)
List IRAF tasks, optionally specifying a list of packages to include |
source code
|
|
|
|
listCurrent(*args,
**kw)
List IRAF tasks in current package (equivalent to '?' in the cl) If
parameter n is specified, lists n most recent packages. |
source code
|
|
|
|
|
|
|
|
|
|
gripe(*args,
**kw)
Hide the system call - direct the user to support |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
clParGet(paramname,
pkg=None,
native=1,
mode=None,
prompt=1)
Return value of IRAF parameter |
source code
|
|
|
|
envget(var,
default=None)
Get value of IRAF or OS environment variable |
source code
|
|
|
|
mktemp(root)
Make a temporary filename starting with root |
source code
|
|
|
|
isNullFile(s)
Returns true if this is the CL null file |
source code
|
|
|
|
substr(s,
first,
last)
Return sub-string using IRAF 1-based indexing |
source code
|
|
|
|
|
|
|
isindef(s)
Returns true if argument is INDEF |
source code
|
|
|
|
stridx(test,
s)
Return index of first occurrence of any of the characters in 'test'
that are in 's' using IRAF 1-based indexing |
source code
|
|
|
|
strldx(test,
s)
Return index of last occurrence of any of the characters in 'test'
that are in 's' using IRAF 1-based indexing |
source code
|
|
|
|
strlwr(s)
Return string converted to lower case |
source code
|
|
|
|
strupr(s)
Return string converted to upper case |
source code
|
|
|
|
strstr(str1,
str2)
Search for first occurrence of 'str1' in 'str2', returns index of the
start of 'str1' or zero if not found. |
source code
|
|
|
|
strlstr(str1,
str2)
Search for last occurrence of 'str1' in 'str2', returns index of the
start of 'str1' or zero if not found. |
source code
|
|
|
|
trim(str,
trimchars=None)
Trim any of the chars in 'trimchars' (default = whitesspace) from
both ends of 'str'. |
source code
|
|
|
|
triml(str,
trimchars=None)
Trim any of the chars in 'trimchars' (default = whitesspace) from the
left side of 'str'. |
source code
|
|
|
|
trimr(str,
trimchars=None)
Trim any of the chars in 'trimchars' (default = whitesspace) from the
right side of 'str'. |
source code
|
|
|
|
|
|
|
real(x)
Return real/float representation of x |
source code
|
|
|
|
integer(x)
Return integer representation of x |
source code
|
|
|
|
|
|
|
|
|
|
radix(value,
base=10,
length=0)
Convert integer value to string expressed using given base |
source code
|
|
|
|
rad(value)
Convert arg in degrees to radians |
source code
|
|
|
|
deg(value)
Convert arg in radians to degrees |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
minimum(*args)
Minimum of list of arguments |
source code
|
|
|
|
maximum(*args)
Maximum of list of arguments |
source code
|
|
|
|
hypot(x,
y)
Return the Euclidean distance, sqrt(x*x + y*y). |
source code
|
|
|
|
|
|
|
clNot(value)
Bitwise boolean NOT of an integer |
source code
|
|
|
|
clAnd(x,
y)
Bitwise boolean AND of two integers |
source code
|
|
|
|
clOr(x,
y)
Bitwise boolean OR of two integers |
source code
|
|
|
|
clXor(x,
y)
Bitwise eXclusive OR of two integers |
source code
|
|
|
|
osfn(filename)
Convert IRAF virtual path name to OS pathname |
source code
|
|
|
|
clSexagesimal(d,
m,
s=0)
Convert d:m:s value to float |
source code
|
|
|
|
|
|
|
defpar(paramname)
Returns true if parameter is defined |
source code
|
|
|
|
access(filename)
Returns true if file exists |
source code
|
|
|
|
|
|
|
_fp_norm(x)
Normalize a floating point number x to the value normx, in the range
[1-10). |
source code
|
|
|
|
_denode(filename)
Remove IRAF "node!" specification from filename |
source code
|
|
|
|
|
|
|
|
|
|
_searchext(root,
extlist)
Returns image type if file root.ext is found (ext from extlist) |
source code
|
|
|
|
imaccess(filename)
Returns true if image matching name exists and is readable |
source code
|
|
|
|
defvar(varname)
Returns true if CL variable is defined |
source code
|
|
|
|
deftask(taskname)
Returns true if CL task is defined |
source code
|
|
|
|
defpac(pkgname)
Returns true if CL package is defined and loaded |
source code
|
|
|
|
curpack()
Returns name of current CL package |
source code
|
|
|
|
curPkgbinary()
Returns name pkgbinary directory for current CL package |
source code
|
|
|
|
bool2str(value)
Convert IRAF boolean value to a string |
source code
|
|
|
|
boolean(value)
Convert Python native types (string, int, float) to IRAF boolean |
source code
|
|
|
|
fscan(locals,
line,
*namelist,
**kw)
fscan function sets parameters from a string or list parameter |
source code
|
|
|
|
fscanf(locals,
line,
format,
*namelist,
**kw)
fscanf function sets parameters from a string/list parameter with
format |
source code
|
|
|
|
|
|
|
_isStruct(locals,
name,
checklegal=0)
Returns true if the variable `name' is of type struct |
source code
|
|
|
|
scan(locals,
*namelist,
**kw)
Scan function sets parameters from line read from stdin |
source code
|
|
|
|
scanf(locals,
format,
*namelist,
**kw)
Formatted scan function sets parameters from line read from stdin |
source code
|
|
|
|
nscan()
Return number of items read in last scan function |
source code
|
|
|
|
|
|
|
|
|
|
show(*args,
**kw)
Print value of IRAF or OS environment variables |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
beep(**kw)
Beep to terminal (even if output is redirected) |
source code
|
|
|
|
clOscmd(s,
**kw)
Execute a system-dependent command in the shell, returning status |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
clDummy(*args,
**kw)
Dummy do-nothing function |
source code
|
|
|
|
language(*args,
**kw)
Dummy do-nothing function |
source code
|
|
|
|
cache(*args,
**kw)
Dummy do-nothing function |
source code
|
|
|
|
clbye(*args,
**kw)
Dummy do-nothing function |
source code
|
|
|
|
logout(*args,
**kw)
Dummy do-nothing function |
source code
|
|
|
|
keep(*args,
**kw)
Dummy do-nothing function |
source code
|
|
|
|
|
|
|
_notImplemented(cmd)
Dummy unimplemented function |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fprint(*args,
**kw)
Error unimplemented function |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
clProcedure(input=None,
mode='',
DOLLARnargs=0,
**kw)
Run CL commands from a file (cl < input) -- OBSOLETE |
source code
|
|
|
|
|
|
|
|
|
|
redefine(*args,
**kw)
Redefine an existing task |
source code
|
|
|
|
package(pkgname=None,
bin=None,
PkgName='',
PkgBinary='',
**kw)
Define IRAF package, returning tuple with new package name and binary |
source code
|
|
|
|
clPrint(*args,
**kw)
CL print command -- emulates CL spacing and uses redirection keywords |
source code
|
|
|
|
_quietConv(w,
d,
c,
args,
i)
Format codes that are quietly converted to %s |
source code
|
|
|
|
_boolConv(w,
d,
c,
args,
i)
Boolean gets converted to upper case before printing |
source code
|
|
|
|
_badConv(w,
d,
c,
args,
i)
Format codes that are converted to %s with warning |
source code
|
|
|
|
_hConv(w,
d,
c,
args,
i)
Handle %h %m %H %M dd:mm:ss.s formats |
source code
|
|
|
|
_rConv(w,
d,
c,
args,
i)
Handle W.DrN general radix format |
source code
|
|
|
|
_wConv(w,
d,
c,
args,
i)
Handle %w format, which is supposed to generate spaces |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
error(errno=0,
errmsg='',
task='error',
_save=False,
suppress=True)
Print error message |
source code
|
|
|
|
errno(_save=None)
Returns status from last call to error() |
source code
|
|
|
|
errcode(_save=None)
Returns status from last call to error() |
source code
|
|
|
|
errmsg(_save=None)
Returns message from last call to error() |
source code
|
|
|
|
errtask(_save=None)
Returns task from last call to error() |
source code
|
|
|
|
clCompatibilityMode(verbose=0,
_save=0)
Start up full CL-compatibility mode |
source code
|
|
|
|
clArray(array_size,
datatype,
name='<anonymous>',
mode='h',
min=None,
max=None,
enum=None,
prompt=None,
init_value=None,
strict=0)
Create an IrafPar object that can be used as a CL array |
source code
|
|
|
|
clExecute(s,
locals=None,
mode='proc',
local_vars_dict={},
local_vars_list=[],
verbose=0,
**kw)
Execute a single cl statement |
source code
|
|
|
|
clLineToPython(line)
Returns the Python code corresponding to a single cl statement. |
source code
|
|
|
|
Expand(instring,
noerror=0)
Expand a string with embedded IRAF variables (IRAF virtual filename) |
source code
|
|
|
|
_expand1(instring,
noerror)
Expand a string with embedded IRAF variables (IRAF virtual filename) |
source code
|
|
|
|
IrafTaskFactory(prefix='',
taskname=None,
suffix='',
value=None,
pkgname=None,
pkgbinary=None,
redefine=0,
function=None)
Returns a new or existing IrafTask, IrafPset, or IrafPkg object |
source code
|
|
|
|
IrafPsetFactory(prefix,
taskname,
suffix,
value,
pkgname,
pkgbinary,
redefine=0)
Returns a new or existing IrafPset object |
source code
|
|
|
|
IrafPkgFactory(prefix,
taskname,
suffix,
value,
pkgname,
pkgbinary,
redefine=0)
Returns a new or existing IrafPkg object |
source code
|
|
|
|
|
|
|
|
|
|
redirReset(resetList,
closeFHList)
Restore _sys.stdin, stdout, stderr to their original values |
source code
|
|