Another great advantage of using the NDF library for data access is that data need not be in NDF format. Any foreign data format can be accessed, so long as a conversion to NDF is defined. An easy way to define a large number of format conversions is to start up the CONVERT package in addition to Figaro:
ICL> convert
CONVERT commands are now available -- (Version 0.6-2, 1996 September)
Defaults for automatic NDF conversion are set.
Type conhelp for help on CONVERT commands.
At the time of writing this is the list of file name extensions and formats. The list is in order of preference of the formats.
.sdf NDF format .fit FITS format (disk FITS, IBM byte order) .dst Figaro format .imh IRAF format .hdr GASP format .unf unformatted binary files .dat unf0 binary files .asc ASCII files .txt text files .gif GIF images .tif TIFF images .sdf.Z compressed NDF files
Normally you need not concern yourself with the file name extension. The data access routines will go through the list and give the application the first data set found no matter which original format they are in. But if you want to be specific, you can say
ICL> istat file.fit(3:5,21.3:44.5,17,17.0,3:,,:99)
if you want to use the disk-FITS file when there is also a `file.sdf' lying around on your disk. As you can see, you can even use NDF sections on foreign data formats.
You can use foreign formats whenever data are accessed, be it input or output. You cannot use foreign formats when access is to an HDS file rather than to data. Things like `delobj' can be used only on HDS files, which restricts it to NDF and DST format.
Whether you can actually store your data in a foreign format, is not guaranteed. Figaro occasionally uses a FITS extension, which you would lose if you store data in GIF. More relevant is that NDF and DST formats allow you to have non-linear pixel centre coordinates, and you are likely to lose such coordinates altogether if you store in FITS or IRAF format.
There is a penalty for using foreign formats rather than NDF. Accessing input and releasing output data takes that bit longer to do the format conversion. And it may take a lot longer if the disk is not local to the computer that does the processing. So if you use only Figaro and other Starlink packages, it is best to stick with NDF format. If every third application you use is from IRAF or MIDAS, you might be better off using disk-FITS.
NDF to ASCII and ASCII to NDF conversions can also be performed using the ex-SPECDRE applications ASCIN and ASCOUT. ASCIN will read axis values, pixel widths, data values, and data errors from an ASCII table into an NDF structure, while ASCOUT will create such an ASCII table from an NDF.
For more information on foreign formats see the Developer's Guide on adding format conversion to NDF (SSN/20) and the user documentation on CONVERT (SUN/55).
FIGARO A general data reduction system