Macro Expansion in SAOtng
When adding new file access programs, analysis routines, and scale programs,
SAOtng will macro-expand your command line before executing it. This is
one way in which SAOtng's internal information can be supplied to external
programs.
Macros are of the form $macro or ${macro}: the same
format used for Unix shell variables. SAOtng knows about several classes
of macros:
- Reserved macros
- The following words are reserved as macros:
- filename, imgpath -- pathname of the original image file
- imgname -- file name of the image file (w/o path)
- imgroot -- root name of the image file (w/o path or extension)
- xdim, ydim -- dimensions of the current image section
- xcen ycen -- center of image at which section was extracted
- block -- block factor at which section was extracted
- min, max -- min and max data value of image section
- Data keywords
- The macro expands in such a way as to make the raw (unscaled)
FITS data representation of the image section available in way
suitable for use in a Unix pipe or to be redirected into a file. For
example, a command line such as:
$data | smooth fits="stdin" ...
will send the raw data into the standard input of a smooth program, while:
$data > foo.fit; smooth fits=foo.fit ...
redirects the raw data into a file and then passes the file to a smooth
program. The $data macro will expand to an xpaget of the unscaled
FITS image from memory, if such data is available. If not, it will expand
to a command to retrieve the appropriate FITS image section from the original
image file.
- FITS keywords
- All keywords contained in the primary FITS header can be expanded as
macros on a command line.
- Region keywords
- The following region keywords are defined when launching analysis
routines:
- region, regions -- all regions
- exclude_region, exclude_regions -- exclude regions
- eregion, eregions -- exclude regions
- include_region, include_regions -- include regions
- iregion, iregions -- include regions
Return to Advanced Topics Page
Return to Main SAOtng Help Page
Last Updated May 1, 1995