SSN/20.3

Starlink Project
Starlink System Note 20.3

R.F.Warren-Smith & D.S.Berry

17th July 2000


Adding Format Conversion Facilities to the NDF Data Access Library

Version 1.6

Developer’s Guide



Abstract

The NDF (Extensible N-Dimensional Data Format) data access library (SUN/33) provides a programming interface and a data model for astronomical applications software. It is based on a flexible underlying data format HDS (SUN/92) and a set of conventions for structuring data within HDS.

This document describes facilities for extending the range of data formats accessible via the NDF library, to include any arbitrary “foreign” format for which a conversion utility can be defined. This gives NDF-based applications access to a potentially wide range of data formatting possibilities, including data compression. The intended readership of this document includes a) Developers working with data formats and associated conversion utilities; b) programmers who anticipate using the NDF library to access foreign data; and c) knowledgeable users who need to access data stored in new (e.g. personal) formats.

Contents

1 INTRODUCTION
 1.1 Philosophy
 1.2 The Format Conversion Approach
 1.3 How Format Conversion Operates
2 SETTING UP FOR FORMAT CONVERSION
 2.1 Name Your Formats
 2.2 Rules and Regulations
 2.3 Defining Conversion Commands
 2.4 Accessing Sub-structures Within Foreign Data Files
 2.5 Writing Format Conversion Utilities
 2.6 Defining Output Formats
 2.7 Specifying an Output Format
 2.8 Propagating Data Formats
 2.9 Resolving Naming Ambiguities
 2.10 Example: Setting Up a New Format
3 ADDITIONAL FACILITIES
 3.1 Explicit Deletion Commands
 3.2 Retaining Converted Data
 3.3 Specifying Where the Native NDF is Stored
 3.4 Efficiency Considerations
 3.5 Example: Data Compression
 3.6 Handling Errors in Conversion Commands
 3.7 Avoiding Unwanted Recursion
 3.8 Debugging Conversion Commands
4 DATA EXTENSIBILITY
 4.1 General Principles
 4.2 The FITS Extension
 4.3 Extension Import and Export Operations
 4.4 Defining the Extension List
 4.5 Extension Import and Export Commands
 4.6 Writing Import and Export Utilities
 4.7 Example: Setting Up an Extension
A ENVIRONMENT VARIABLES AND TOKENS
 A.1 Summary of Environment Variables Used
 A.2 Summary of Message Tokens Used