A Standard components in an NDF

An NDF comprises a main data array plus a collection of objects drawn from a set of standard items and extensions (see SGP/38). Only the main data array must be present; all the other items are optional.

ADAM_EXAMPLES:EXAMPLE.SDF is an NDF which contains all the standard NDF components and also has a Figaro extension. The structure of the file (as revealed by $ TRACE ADAM_EXAMPLES:EXAMPLE) is shown below.

  EXAMPLE  <NDF>
  
     DATA_ARRAY(856)  <_REAL>       -1.7014117E38,0.2284551,-2.040089,
                                    ... 820.8976,570.0729,-1.7014117E38,449.574
     TITLE          <_CHAR*30>      ’HR6259 - AAT fibre data’
     LABEL          <_CHAR*20>      ’Flux’
     UNITS          <_CHAR*20>      ’Counts/s’
     QUALITY        <QUALITY>       {structure}
        BADBITS        <_UBYTE>        1
        QUALITY(856)   <_UBYTE>        1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,
                                       ... 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0
  
     VARIANCE(856)  <_REAL>         2.1,0.1713413,1.5301,34.38378,42.35531,
                                    ... 615.6732,427.5547,353.9127,337.1805
     AXIS(1)        <AXIS>          {structure}
  
     Contents of AXIS(1)
        DATA_ARRAY(856)  <_REAL>       3847.142,3847.672,3848.201,3848.731,
                                       ... 4298.309,4298.838,4299.368,4299.897
        LABEL          <_CHAR*20>      ’Wavelength’
        UNITS          <_CHAR*20>      ’Angstroms’
  
     HISTORY        <HISTORY>       {structure}
        CREATED        <_CHAR*30>      ’1990-DEC-12 08:21:02.324’
        CURRENT_RECORD  <_INTEGER>     3
        RECORDS(10)    <HIST_REC>      {array of structures}
  
        Contents of RECORDS(1)
           TEXT           <_CHAR*40>      ’Extracted spectrum from fibre data.’
           DATE           <_CHAR*25>      ’1990-DEC-19 08:43:03.08’
           COMMAND        <_CHAR*30>      ’FIGARO V2.4 FINDSP command’
  
  
     MORE           <EXT>           {structure}
        FIGARO         <EXT>           {structure}
           TIME           <_REAL>         1275
           SECZ           <_REAL>         2.13
  
  End of Trace.

Of course, this is only an example format. There are various ways of representing some of the components. These variants are described in SGP/38.

The components are considered in detail below. The names (in bold typeface) are significant as they are used by the NDF access routines to identify the components.

DATA
– the main data array is the only component which must be present in an NDF. In the case of EXAMPLE.SDF, the data component is a 1-d array of real type with 856 elements.
TITLE
– the character string ’HR6259 - AAT fibre data’ describes the contents of the NDF. The NDF’s TITLE might be used as the title of a graph etc.
LABEL
– the character string ’Flux’ describes the quantity represented in the NDF’s main data array. The LABEL is intended for use on the axis of graphs etc.
UNITS
– this character string describes the physical units of the quantity stored in the main data array, in this case, ’Counts/s’.
QUALITY
– this component is used to indicate the quality of each element in the main data array. The quality structure contains a quality array and a BADBITS value, both of which must be of type _UBYTE. The quality array has the same shape and size as the main data array and is used in conjunction with the BADBITS value to decide the quality of a pixel in the main data array. In EXAMPLE.SDF the BADBITS component has value 1. This means that a value of 1 in the quality array indicates a bad pixel in the main data array, whereas any other value indicates that the associated pixel is good.
VARIANCE
– the variance array is the same shape and size as the main data array and contains the errors associated with the individual data values. These are stored as variance estimates for each pixel.
AXIS
– the AXIS structure may contain axis information for any dimension of the NDF’s main array. In this case, the main data array is only 1-d, therefore only the AXIS(1) structure is present. This structure contains the actual axis data array, and also label and units information.
HISTORY
– the history component provides a record of the processing history of the NDF. Only the first of three records is shown for EXAMPLE.SDF. This indicates that the spectrum was extracted from fibre data using the Figaro FINDSP command on 19th December 1990. Support for the history component is not yet provided by the NDF access routines.
EXTENSIONs
– the purpose of extensions is to store non-standard items. EXAMPLE.SDF began life as a Figaro file17 which contained values for the airmass and exposure time associated with the observations. These are stored in the Figaro extension, and the intention is that the Figaro applications which use these values will know where to find them.

17The Figaro file was converted to an NDF using the command DST2NDF, see SUN/55.