extensions -- file name extensions under IRAF/PROS
This document describes the file name conventions used by the PROS system under IRAF.
Many IRAF tasks and packages assume that a file of a given type will have a particular extension. For example, IRAF IMIO (image I/O) routines look at the file extension to determine what sort of file (e.g., NOAO image, ST image or QPOE image) is being dealt with. Other tasks assume a default extension, but allow other extensions. For example, the TABLE I/O library will append a ".tab" extension to a file name having no extension, before trying to open it. One can use other extensions in this case, but then the extension must always be used when the file is input to a task. It makes more sense to use the default.
The standard IRAF (system) file types and extensions currently recognized are:
extension: file: .imh NOAO image header .stf STScI image header .hhh STScI multi-group image header .qp QPOE image .pl PLIO file .tab STScI table
Unfortunately, this reliance on extensions as a means of identifying file type means that two files of similar system type must differentiate themselves in some way other than a simple extension. For example, the source-info file (created by eos2tab), the counts-in-regions file (created by imcnts), and the photon-event-list file (created by qpdisp) are all STScI table files, and should therefore have a ".tab" extension. The region mask, the exposure file, and the vignetting file are all PLIO files and must must a ".pl" extension. There must be a way of identifying the PROS file type (e.g. source-info or counts-in-region file) as well as the IRAF system file type (e.g. table or plio file).
To solve this problem, the PROS makes use of default compound extension , consisting of two parts. The first part of the extension describes the PROS file type (e.g., exposure file or source detect file), while the second part describes the IRAF system file type (e.g., PLIO file or table file). The PROS part of the extension consists of an underscore, followed by the extension name (e.g., "_cnt") while the system part consists of the standard extension, i.e., a period followed by the extension (e.g., ".pl"). Thus a full PROS extension would look like this:
_<pros>.<sys> The recognized PROS default compound extensions are (as of Jan 1, 1989): extension: file: created by: "_bti.qp" # timing background timimg file timsort "_chi.tab" # spectral chi square file fit, singlefit "_cnt.tab" # imcnts output in table format imcnts "_err.imh" # error array imsmooth "_fft.tab" # fft table output file fft "_fld.tab" # fold table output file fold "_ftp.tab" # fft power histogram output file fft "_grd.tab" # spectral grid search table file grid_search "_obs.tab" # spectral observed data table file mpcspec,sdfspec, qpspec "_prd.tab" # spectral predicted data table file fit, singlefit "_smo.imh" # smoothed image imsmooth "_exp.pl" # exposure plio file expmask, qpsort "_imd.tab" # imdisp output in table format imdisp "_int.tab" # spectral intermediate table file fit, singlefit "_ltc.tab" # light curve in table format ltcurve "_prj.tab" # projection file in table format improj "_pwr.tab" # fft significant power table fft "_qls.tab" # qpdisp output in table format qpdisp "_sti.qp" # timing source timimg file timsort "_vig.pl" # vignetting plio file makevig
These default compound extensions are used by the tasks listed above when no extension is given for the output file name. Of course, the user can explicitly specify an extension to any of the output files and override these defaults. It is recommended, however, that the system extensions be maintained for all files.
When a PROS task help file specifies a default extension, it is not necessary to specify this extension. Actually, most PROS output files and many PROS secondary input files (as noted in the help files) allow the entire file name to be defaulted. In general, if one specifies . as the output file name, the output filename defaults to the root of the input file + the default extension. In this case the input PmeATHNAME will be ignored. To PRESERVE the PATHNAME the null string should be used for the output file specifier (by(by typing ""). For example, if "foo.qp" is the input image file to imcnts, the default output file will be "foo_cnt.tab".
Note, however, that this defaulting of the root name does NOT preserves the directory pathname of the input file. Thus, for example, if "/pros/qpoe/i296.qp" is the input image to imcnts, the default output will be "i296_cnt.qp". To preserve the directory pathname the output file should be specified as "".
Actually, use of "." is a special case of the following general rule: if a directory is input as an output file, then the output file name is actually taken to be that directory combined with the file name part of the input root along with the default extension. Directories in iraf are delimited by "/" or "$", i.e., "/pros/qpoe/" or "xdata$" or "xdata$test/". For example, if the input file to imcnts is "/pros/qpoe/i296.qp", and the output is specified as "/u7/eric/", then the output table file will "/u7/eric/i296_cnt.tab". For convenience "." acts as "./" (the current directory, and ".." acts as "../" (the parent directory).
The defaulting of output file names is not allowed in cases where an image is output, since this would overwrite the input image. Tasks that do not allow such defaulting are imreplicate, imcompress, and imsmooth. See the individual task help file to determine if the output file can be defaulted.
Finally, note that it is generally not necessary to supply the system part of the compound extension when inputting a PROS file into an IRAF task. This is because many tasks, as already mentioned, assume a default extension. To print the contents of the "foo_cnt.tab" table file, it is sufficient to use "foo_cnt" as the input file name to the tprint task, for example. The notable exception is where a PLIO file is being used as an image. In this case, the ".pl" extension is required so that the image open call knows that it is dealing with a pixel list file.