IRAF scripts and tasks
: most of the
scripts listed here have been packaged into external package rjtools for IRAF v2.12. The versions
in that package have many additional features and supersede the versions
linked on this page.
Over the past years I wrote a number of IRAF tasks
(CL scripts) that may have more general use. Many of these tasks return
the result of their action as task parameters (as well as to the screen
and/or to a log file). This effectively allows nesting of tasks and
passing of variables from task to task.
For example, task cparse parses a
user-supplied text string into fields and task getsky computes the
background in an image in a user-specified number of rejecting iterations.
A task calling cparse and getsky can use or modify their
cparse ("a0061.fits NGC4594 B 300s -01:32:15 1.324", delim=" ")
getsky (cparse.field1, niter=5)
newimage = cparse.field2//".fits"
imarith (cparse.field1, "-", getsky.smode, newimage)
Below is a list of the available tasks, grouped
according to the subdirectory of my "home$/tasks/" directory that I
organize them in. They were tested under IRAF v2.11.3 and most of them
also under IRAF v2.12. If you find any bugs or if you improved any of
these tasks I would like to hear from you:
- chkimg.cl --- task to test the existence or
non-existence of an IRAF image or regular file. If the file name has an
extension that matches either the current or the specified 'imtype', the
image root name and the length thereof, as well as any subsection or
imageplane specifier is returned as well.
- cparse.cl --- task to parse strings into fields
using an arbitrary user-specified field separation character (e.g. ' ',
'.', ':', '=', etc.). A maximum of 15 fields is returned and, optionally,
a specified field.
- gdate.cl --- task to return a time stamp or part
of it (e.g. day, time, date, month, etc.) in various formats as task
- iwc.cl --- Equivalent of unix 'wc'. Uses standard
IRAF task 'count' but returns the detected number of lines, words and
characters as task parameters.
- rdfits.cl --- task to read FITS files on disk
into IRAF images, deleting each FITS image as soon as it has been read
into IRAF. Handy for people with limited amounts of diskspace.
- rdlist.cl --- task to read a line from a text
file and return it as a task parameter.
- rpbuild.cl --- task to construct an image
region/plane specifier string of generic format [pln][xlo:xhi,ylo:yhi],
given pln, xlo, xhi, ylo and yhi.
- rpparse.cl --- task to test and parse an image
region/plane specfier string. pln, xlo, xhi, ylo and yhi, as well as xcen
and ycen are returned as task parameters.
- tcolarit.cl --- task to perform simple
arithmetic on columns in a text (ASCII) table. Several arithmetic functions
are supported and column entries can either be overwritten by results or a
new column can be created. The number of input columns is limited to 15; if
'outcol="new"', the number of columns in output can be 16.
This task supplements task 'ctio.filecalc', which may be more convenient
for complicated arithmetic expressions and long tables.
- tcolstat.cl --- task to calculate the
statistics for a user-specified column in a text (ASCII) table.
- vstor.cl --- (dummy) task for temporary storage of
up to four integers, reals and string variables for later re-use.
- wstat.cl --- task to compute weighted statistics
for a set of measurements and errors thereon. Data and errors should be
supplied as a 2-column ASCII test file. Additional columns are allowed to
be present, but are ignored.
- borderstat.cl --- task to return image
statistics of an arbitrary image border as task parameters.
- getsky.cl --- task to compute approximate sky
background level in an image and error thereon, in a user-specified number
of rejection iterations. The background is assumed to be fairly flat.
- imgstat.cl --- task to return image statistics
as task parameters. This task is based on a script of the same name written
by M. Franx.
- mkmosaic.cl --- task to create a mosaic of two
images of arbitrary dimension. Positioning of the second image may be to
the left, right, top or bottom of the first image, and the image level of
the second image may be scaled to match that of the first.
- ctrcoo.cl --- task to fit center positions to
objects in an image, given initial estimates.
- getregion.cl --- task to interactively mark
rectangular image regions, either by marking the lower left and upper right
corners or by expansion to a fixed-size region centered on the current
cursor position. Output is a textfile with pixel coordinates; four formats
are supported. Optionally, the image name is prepended.
- getseeing.cl --- task to measure the effective
seeing FWHM (and error thereon) in an image by interactively marking a few
stars. The result is returned as task parameter, and optionally, to a text
file and/or to the image header.
- imregister.cl --- task to register (shift,
scale, and rotate) an image using a list of matched input coordinates. If
the coordinate file is not given, the reference image is displayed and
reference objects can be marked interactively.
- markall.cl --- task to interactively mark all
galaxies, all stars, all cosmic ray events, and all CCD defects in an image.
- markstds.cl --- task to interactively mark all
standard stars in a field and log their positions to a text file. After
marking the stars, the aperture and sky annulus are overlayed on the image
- tvellips.cl --- task to compute and overlay
ellipses on an image. The shape of the ellipses is determined by the
user-specified values of the ellipticity and position angle and their sizes
by a comma-separated list of semi-major axis radii. Adapted from a task by
- tvmarkall.cl --- task to mark positions/regions
on an image. The positions are read from files image//".pos.gal",
image//".pos.star", image//".pos.cosmic", image//".pos.del", and/or from an
arbitrarilly named regions file. Each is plotted in a different color.
- tvpolygon.cl --- task to compute and overlay
polygons on an image. The shape of the polygons is determined by the number
of vertices, and by the width and height. The position and orientiation are
determined by xcen, ycen, and the position angle. Optionally, for n=4, a
mask image may be produced.
- xdisplay.cl --- task to display an image with
somewhat less annoying default 'scale' and 'range' than display
when viewing extended sources (result may be inferior, however, for stars).
Also the zmode="log" switch does not reduce the dynamic range
to 255 distinct values as display does.
- sysinfo.cl --- task to return the host name,
user name, current working directory and current IRAF version as task
Of a different type is task: