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:

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:

Return to Advanced Topics Page

Return to Main SAOtng Help Page

Last Updated May 1, 1995