Adding New File Formats to SAOtng

SAOtng supports FITS files internally, so that a standard FITS image file can be sent directly to SAOtng for display using XPA:

  xpaset SAOtng < foo.fits
Also, when a new file name is sent to SAOtng, the program checks the first 2880 bytes of the file to see if it is a FITS file and if so, processes it accordingly. Support for other image file formats (or any other image format) is added to SAOtng by writing two external file access programs:

These program pairs are made known to SAOtng at start-up time in a user-configurable ASCII file. When loading an image, the program command lines first are macro-expanded to fill in user-defined arguments and then is executed externally using the system() function (see Macro expansion in SAOtng.

The ASCII file that defines the known image files consists of one or more file descriptors, each of which has the following format: Note that blank lines separate the file descriptions and should not be used as part of a description. Also, the '#' character is a comment character.

For example, the default image access file currently contains the following:

#
# File access descriptions:
#	help explanation
#	file template
#	file type
#	header access command
#	data access command

IRAF image files (qpoe, imh, etc.)
*.qp *.imh *.stf
QPOE IMH STF
uiraf x_fmgr.e -b blkfits image=$filename xcen=$xcen ycen=$ycen xdim=$xdim ydim=$ydim block=$block
uiraf x_fmgr.e -b hdrfits image=$filename

SAO cd-ROM FITS binary table X-ray event files
*.xi*
FITS
cat $filename
cat $filename

FITS image files
*.fit *.fits
FITS
fitsextract fits=$filename xcen=$xcen ycen=$ycen xdim=$xdim ydim=$ydim block=$block
fitsheader fits=$filename
New files are added to SAOtng using the -files [file access list] option on the command line. The files in the file access list are then added to the system-support file types.
Return to Advanced Topics Page

Return to Main SAOtng Help Page

Last Updated May 1, 1995