next up previous
Next: Writing Import and Export Utilities
Up: DATA EXTENSIBILITY
Previous: Defining the Extension List

Extension Import and Export Commands  

The commands that perform import and export of extension data are defined in the usual way via environment variables whose names are formed by prefixing `NDF_IMP_' or `NDF_EXP_' to the extension name (in upper case), for example:

setenv NDF_IMP_CCDPACK 'impccd ndf=^ndf'
setenv NDF_EXP_CCDPACK 'expccd ndf=^ndf'

Here, the extension name is CCDPACK (and should appear in the NDF_XTN list) and the ``impccd'' and ``expccd'' utilities are assumed to have been written to import and export information for this extension.

The commands are invoked after message token substitution has taken place, as described in §[*]. In this case, the set of tokens defined for use is as follows:

Token Value
dir Directory in which the foreign file resides
name Foreign file name (without directory or extension)
type Foreign file extension (with leading `.')
vers Foreign file version number (blank if not supported)
fxs Foreign extension specifier (see §[*] )
fxscl Clean version of fxs (all non-alphanumeric characters replaced by underscores)
fmt Foreign format name (upper case)
ndf Full name of the native NDF format copy of the dataset
xtn Name of the NDF extension (upper case)

As explained earlier, the foreign format file should not normally be accessed by import and export utilities unless that is unavoidable, so one set of import and export commands will normally suffice for accessing a whole range of foreign formats.

In special cases, however, where techniques specific to a particular format are needed, an alternative set of commands may be defined to apply to that format alone. This is done via environment variables whose names are constructed by appending an underscore and the foreign format name to the usual names shown above. For instance, when importing and exporting CCDPACK extension information to FIGARO files, one might want to use:

setenv NDF_IMP_CCDPACK_FIGARO 'impccd ndf=^ndf file=^dir^name^type'
setenv NDF_EXP_CCDPACK_FIGARO 'expccd ndf=^ndf file=^dir^name^type'

If these variables were defined, they would over-ride any defined without the `_FIGARO' suffix when accessing that particular format. Any special techniques can therefore be restricted to those formats that require them.



next up previous
Next: Writing Import and Export Utilities
Up: DATA EXTENSIBILITY
Previous: Defining the Extension List


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