1 Introduction

If life were simple there would only be one data format, but in reality there are numerous formats for storing n-dimensional astronomical data associated with various software packages. In Starlink we have not been immune to this, having the original INTERIM BDF, HDS IMAGE format, and FIGARO DSTs to name but three. However, Starlink is now taking the novel approach of supporting different packages sharing a common data format—the NDF1 (Extensible n-Dimensional-data format)—which most Starlink packages are already using.

The purpose of CONVERT is the interchange of data files to and from the NDF. Thus it enables astronomers to select the best applications from a variety of packages, including those originating abroad like IRAF. In addition it assists packages that wish to move to using the NDF.

CONVERT is available from all three UNIX platforms supported by Starlink. The supported conversions are currently as follows:

ASCII2NDF

Converts a text file to an NDF.

  
AST2NDF

Converts an Asterix data cube into a standard NDF.

  
DA2NDF

Converts a direct-access unformatted file to an NDF.

  
DST2NDF

Converts a Figaro (Version 2) DST file to an NDF.

  
FITS2NDF

Converts FITS files into NDFs.

  
GASP2NDF

Converts an image in GASP format to an NDF.

  
GIF2NDF

Converts an image in GIF format to an NDF.

  
IRAF2NDF

Converts an IRAF image to an NDF.

  
IRCAM2NDF

Converts an IRCAM data file to a series of NDFs.

  
MTFITS2NDF

Converts a FITS tape to one or more NDFs.

  
NDF2ASCII

Converts an NDF to a text file.

  
NDF2DA

Converts an NDF to a direct-access unformatted file.

  
NDF2DST

Converts an NDF to a Figaro (Version 2) DST file.

  
NDF2FITS

Converts an NDF to a FITS file.

  
NDF2GASP

Converts a two-dimensional NDF into a GASP image.

  
NDF2GIF

Converts an NDF to a GIF file.

  
NDF2IRAF

Converts an NDF to an IRAF image.

  
NDF2PGM

Converts an NDF to a PGM format.

  
NDF2TIFF

Converts an NDF to a TIFF file.

  
NDF2UNF

Converts an NDF to a sequential unformatted file.

  
SPECX2NDF

Converts a SPECX map into a simple data cube, or SPECX data files to individual spectra.

  
TIFF2NDF

Converts an image in TIFF format to an NDF.

  
UNF2NDF

Converts a sequential unformatted file to an NDF.

  

In addition there are FITS readers within (SUN/95) (see SUN/95) which will convert FITS files and tapes to NDFs. These are more tolerant of ‘almost FITS’ files, but lack support for IMAGE and BINTABLE extensions.

IDL procedures for handling NDFs and other methods of converting NDFs to IDL format are described in Appendix B of this document.

Starting up the CONVERT package will also set up defaults for the automatic NDF conversion facilities (described in Section 3) to enable applications which use the NDF library to read and write most of the file formats handled by the CONVERT package, and some others.

The various formats supported by CONVERT do not have one-to-one correspondence and therefore in general it is not possible to apply a forward and reverse conversion and finish with a duplicate of the initial data file. This hysteresis is particularly likely when starting with an NDF, since many simpler formats have no way of storing certain NDF data items, like variance and axis widths. However, if you are dealing with a simple file containing just a data array and linear axis centres, then it should be possible to avoid loss of information except with GIF and TIFF formats which will reduce the absolute data values to 256 greyscale levels.

Note – the input data file is not deleted or altered in any way.

1See SUN/33 for an introduction to the NDF.