Overlooked System Features
[Tips Main Page] |
[Submit a Tip]
Parsing String Variables
(Submitted by Greg Wirth, wirth@keck.hawaii.edu)
You can use the translit task as a stream editor to help in parsing
comma-delimited strings. For example, to parse this header card:
cc> imhead lris0106 l+ | match WINDOW
WINDOW = '1,0,0,2048,2048' /
You can use this set of commands in your script:
hselect (image, "window", "yes") | \
translit ("STDIN", ",", " ") | \
scan (winchip, winxstart, winystart, winxlen, winylen)
FITS Images
Starting with V2.11 FITS images are supported directly as an alternative
to other IRAF image formats (e.g., .imh, .hhh). This means that you do
not have to convert disk files using RFITS, as in the past.
Postscript or EPS Hardcopy Files
You can generate Postscript or EPS hardcopy files of plots using the
psdump or eps device names respectively. Using psdump
will create a file in the /tmp directory named irafdmpXXX.ps (where
the XXX is a process id) containing the plot Postscript, using
eps will create a file sgiXXX.eps in the current directory.
For example,
cl> contour dev$pix dev=psdump
cl> implot dev$pix
.... in cursor mode use ":.snap eps"
Web-Based IRAF Help Pages
Help pages for the development IRAF system and all external packages
installed at NOAO are available from our web page:
http://iraf.noao.edu .
Help Searching
Listing Frame Buffers
The gdevices command will list all configured image display frame
buffers.
Moving OIF Pixel Files
After resetting the imdir variable you can move all existing
.pix files for an image to this new location using IMCOPY or
IMRENAME. For example,
cl> reset imdir = HDR$pix/
cl> imcopy *.imh *.imh
A General Image header Editor
The hfix task can be used to edit image headers with any user
specified commands. By default the user is put into the editor to modify
the editor, but the command can also make use of host programs such as
sed or awk to perform more complex and automated editing.
An Astronomical Calculator
The astutil.astcalc task can be used as a general expression
evaluator that understands astronomical concepts such as precession,
julian date, airmass, etc.
An Astronomical Header Editor
The astutil.asthedit task can evaluate expressions and edit image
headers using image header keywords, tables, CL parameters, internal
variables or constants. It differs from hedit in that it includes
astronomical functions which can be used in the expressions. For example,
to add the HA to an image create a command file that computes the sidereal
time and subtracts the RA, e.g.
ha = real(mst(date,ut,obsdb("cfht", "Longitude"))) - (ra)
IRAF
NOAO