next up previous
Next: ENVIRONMENT VARIABLES AND TOKENS
Up: DATA EXTENSIBILITY
Previous: Writing Import and Export Utilities

Example: Setting Up an Extension  

The following example shows typical C shell commands that might be used to allow NDF applications to handle specialist extension information derived from foreign format datasets. Normally such commands would form part of the startup sequence for the package that utilised the extension.

#  Append the CCDPACK extension to the list of extensions to be
#  handled.
      if ($?NDF_XTN) then
         setenv NDF_XTN $NDF_XTN,CCDPACK
      else
         setenv NDF_XTN CCDPACK
      endif

#  Define commands for importing and exporting CCDPACK extension
#  information.
      setenv NDF_IMP_CCDPACK 'ccdimp ndf=^ndf table=$CCDPACK_DIR/^fmt.imp'
      setenv NDF_EXP_CCDPACK 'ccdexp ndf=^ndf table=$CCDPACK_DIR/^fmt.exp'

Note that we have specified keyword translation tables here (for use in the import and export commands) which depend on the foreign data format being accessed. This would be necessary if, for instance, data in different formats were to follow different conventions about how its header information is stored, so that different FITS keywords were used in the FITS extension as a result. By concentrating this information in a table, it becomes easy to change and users can even have their own versions if necessary.

Applications which process the converted data need only deal with the validated information stored within their own private extension. They are therefore insulated from details of the conversion process and any need to change in order to access new data formats in future. The use of a private extension also protects them from the possibility of other software inadvertently corrupting their private data.



next up previous
Next: ENVIRONMENT VARIABLES AND TOKENS
Up: DATA EXTENSIBILITY
Previous: Writing Import and Export Utilities


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