tofits (1) Transform a set of documented files into FITS. (Mar-1997)
The result may consist of either plain FITS files (bulk files including data description and the corresponding values), or of only the headers, i.e. the description of the data as plain ascii files; the latter files are normally named *.fih files.
The creation of the plain FITS files follows the following algorithm:
Note that some files (e.g. tex files, HTML, postscript files) are not converted to FITS.
–d data_directory indicates the directory containing the relevant files (data files, *.fih files, the ReadMe if not specified by the –i option). The default data_directory is the current directory.
–fih tells that no ReadMe file is required, all descriptions do exist as *.fih files; the top header is named SIMPLE.fih, unless another name is specified via the –h option.
–h SIMPLEheader_file provides an alternative name to SIMPLE.fih (see option –fih)
–help displays a detailed help.
–i description_file provides the non-standard (Intro or ReadMe) name of the Description file;
–m max_records asks to limit the generated FITS file to the specified number of records. By default, all records are converted to FITS.
–nodata asks to generate only FITS headers (similar to *.fih files); the data files are ignored.
–noh asks not to generate the top (SIMPLE) header; this option is especially useful to append a new FITS table to an existing FITS data set.
–o output_file designates the file replacing the default stdout (terminal). The usage of a disk file allows to rewrite the actual number of records (the NAXIS2 parameter), when the number of records stored in the ReadMe is not correct (e.g. with the –t option). Note that this option is not compatible with the compression.
indicates that the next file argument designates a
data file which contains data structured like
table_structure (for instance an excerpt of a table).
table_structure is therefore a name which must exist
in one of the Byte-by-byte Description ... section in the
A value of - for table_structure asks to stop this behaviour.
–u allows to select how to write the comments related to the units: the –u1 option comments each unit with its SI (Système International) value, while –u2 option comments each unit with both litteral and SI counterpart.
–v is a verbose option.
–w.fit asks to write a new file for each FITS table; with this option, there are as many FITS files generated as data files, each being a complete FITS file including the top header, a table header and the corresponding data. The names of the files generated this way have a .fit extension.
–w.fih asks to write a new file for each table header (generation of *.fih files). The names of the files generated this way have a .fih extension.
–Z compresses the resulting files with the standard Unix compress(1) routine. The output cannot be put in a file (incompatible with –o option)
–z compresses the resulting files with the gzip(1) utility. The output cannot be put in a file (incompatible with –o option)
The default is to convert all described files, i.e. all files included in the File Summary section of the ReadMe file, with the exception of the non-convertable files.
A dash – or a dollar sign $ as a file name asks to stop the conversion; this is useful if one wants to generate only the top header, as in
tofits -nodata -i DescriptionFile - > SIMPLE.fih
Note that if the file argument is a directory, it has the same effect as it were preceded by the–d flag.
This script may use (and change) the following numeric environment variables which are set by tofits before calling .MakeFITS:
The .MakeFITS script may (recursively) call tofits .