next up previous 64
Next: Propagating Data Formats
Up: SETTING UP FOR FORMAT CONVERSION
Previous: Defining Output Formats


Specifying an Output Format

With the output format list above, the following could be given to the NDF library when it is expecting the name of a new dataset:

newfile.fit

and it would recognise this as a request to write the new file in FITS format (performing the appropriate conversion when necessary).

If the name supplied were simply:

newfile

(i.e. if no file extension is specified), then the first format appearing in the output format list would be used. This is where the `.' in the earlier example (§[*]) comes in, as it stands for the native NDF format. Hence, a native format NDF would be written in this case. This is normally the required behaviour, so having `.' at the start of the format list is recommended.

However, if you wanted to work predominantly with a foreign format (say you were using NDF applications with another package which could not access NDF data directly), then you could put that format at the start of the output format list. For example:

setenv NDF_FORMATS_OUT 'IRAF(.imh),FITS(.fit)'

would cause all output files to be written in IRAF format and to have a file extension of `.imh' by default. You could still specify FITS format explicitly by giving a file extension of `.fit'.


next up previous 64
Next: Propagating Data Formats
Up: SETTING UP FOR FORMAT CONVERSION
Previous: Defining Output Formats

Adding Format Conversion Facilities to the NDF Data Access Library
Starlink System Note 20
R.F.Warren-Smith & D.S.Berry
17th July 2000
E-mail:ussc@star.rl.ac.uk

Copyright © 2010 Science and Technology Facilities Council