next up previous
Next: Defining the Extension List
Up: DATA EXTENSIBILITY
Previous: The FITS Extension

Extension Import and Export Operations  

To illustrate the function that the FITS extension performs, consider the following sequence of events in which an IRAF format file is read by an application that expects to find a CCDPACK extension present:

1.
Having detected that it needs to convert the data format, the NDF library first invokes a general purpose conversion command, as defined in the NDF_FROM_IRAF environment variable (see §[*]). This, in turn, invokes a conversion utility which creates the NDF data structure and fills in all the relevant standard components using information obtained from the IRAF dataset.
2.
The same utility then assembles all ancillary information that it doesn't recognise (essentially the contents of the IRAF header file) and writes it to a FITS extension, which it creates in the new NDF. It then terminates.

3.
The NDF library then invokes a specialist utility, written by the designer of the CCDPACK extension. This inspects the FITS header (and other standard components of the NDF if necessary) and transfers the information it recognises into the CCDPACK extension, which it creates. It too, then terminates.

4.
Other specialist utilities may then be invoked, if required, to create further extensions using information in the FITS header.

5.
Finally, the original application regains control and accesses the NDF dataset that has been built.

When writing to a foreign dataset, the sequence of events is broadly similar, except that the specialist utilities are invoked first (before the general purpose one) and transfer information from their relevant extensions into the FITS extension. The general purpose conversion utility then transfers the contents of the FITS extension to the foreign dataset as part of its conversion task.

The processes of (a) creating a specialist extension from information stored in the FITS extension and (b) writing specialist extension information back into the FITS extension are referred to as importing and exporting the extension information.

Using this scheme, utilities that import and export extension information will, in many circumstances, be able to rely entirely on the contents of the FITS extension and need not access the foreign data file at all. This relieves their authors of the need to understand the foreign format, beyond knowing what FITS keywords will be used to store the information of interest. Import and export utilities are therefore easily re-used when new formats are encountered. Indeed, since FITS keywords are so widely used, there will often be conventions in place that make even a change of keywords unnecessary when adding a new format.

The following sections now describe the stages involved in setting up import and export utilities to make use of this scheme.



next up previous
Next: Defining the Extension List
Up: DATA EXTENSIBILITY
Previous: The FITS Extension


Starlink System Note 20
R.F.Warren-Smith & D.S.Berry
17th July 2000
E-mail:ussc@star.rl.ac.uk

Copyright © 2000 Council for the Central Laboratory of the Research Councils