The list of format names and associated filename extensions defined by CONVERT is set out in the table below--the filename extensions tell the system which format the file is in. This list will nullify any existing list so private conversions must be added after CONVERT startup.
For the unformatted and ASCII conversions the format names and extensions are somewhat arbitrary. The FITS and STREAM formats have synonym file extensions for the conversion to NDF. The standard file extension is required for the conversion to the foreign format.
The table below lists the utilities used to perform the conversions.
In general the default parameter values are used--non-default parameters
(other than the input and output filenames) are listed in the table.
The table also contains a column headed `Variable'. Most of the command lines issued to do the automatic conversion will include the translation of an environment variable named NDF_FROM_fmt_PARS or NDF_TO_fmt_PARS as appropriate (where fmt is the format name). This may be used to give additional parameters to the command if you do not want to define a completely new command for yourself. Where the `Variable' column contains a tick, the variable must be used to supply the SHAPE parameter; where it contains a cross, additional parameters cannot be specified.
For example, suppose application rdndf uses the NDF library to read one NDF (named by the first parameter) and write another (named by the second parameter). This application could be made to read a TEXT file (data.txt) containing the required values for a 50 10 data array, and write its results as a FITS file (output.fit) as follows:
% convert CONVERT commands are now available -- (Version 1.4, 2001 November) Defaults for automatic NDF conversion are set. Type conhelp for help on CONVERT commands. Type "showme sun55" to browse the hypertext documentation. % setenv NDF_FROM_TEXT_PARS 'SHAPE=[50,10]' % rdndf data.txt output.fit
The order of the formats in the tables also defines a search path. If you omit the file extension, the system will search for an NDF of that name. If that is absent, it will try a .fit FITS file. If neither are present it tries an IRAF file, and so on. The recognised formats and their order is defined through the environment variable NDF_FORMATS_IN. The shell convert startup defines NDF_FORMATS_IN as given below.
'FITS(.fit),FIGARO(.dst),IRAF(.imh),STREAM(.das),UNFORMATTED(.unf), UNF0(.dat),ASCII(.asc),TEXT(.txt),GIF(.gif),TIFF(.tif),GASP(.hdr), COMPRESSED(.sdf.Z),GZIP(.sdf.gz),FITS(.fits),FITS(.fts),FITS(.FTS), FITS(.FITS),FITS(.FIT),FITS(.lilo),FITS(.lihi), FITS(.silo),FITS(.sihi),FITS(.mxlo),FITS(.mxhi), FITS(.rilo),FITS(.rihi),FITS(.vdlo),FITS(.vdhi),STREAM(.str)'
but from ICL the CONVERT command does not define the synonyms due to a limitation of ICL. Thus NDF_FORMATS_IN is defined to be the following.
'FITS(.fit),FIGARO(.dst),IRAF(.imh),STREAM(.das),UNFORMATTED(.unf), UNF0(.dat),ASCII(.asc),TEXT(.txt),GIF(.gif),TIFF(.tif),GASP(.hdr), COMPRESSED(.sdf.Z),GZIP(.sdf.gz)'
When creating an output file, there is a similar list of recognised formats. The CONVERT startup procedures define NDF_FORMATS_OUT as follows.
'.,FITS(.fit),FIGARO(.dst),IRAF(.imh),STREAM(.das),UNFORMATTED(.unf), UNF0(.dat),ASCII(.asc),TEXT(.txt),GIF(.gif),TIFF(.tif),GASP(.hdr), COMPRESSED(.sdf.Z),GZIP(.sdf.gz)'
The leading dot indicates that if you omit the file extension, the output file will be an NDF.
There are some examples of the automatic system in action and use of NDF_FORMATS_IN and NDF_FORMATS_OUT in Automatic Conversion.
CONVERT A Format-conversion Package