The most-common structure for data that are not instrument specific is what has become known as the bulk-data frame. To avoid confusion with the Interim Environment’s BDF, the new Starlink standard for storing bulk-data frames is called the Extensible -Dimensional-Data Format (NDF for short). It has no specific HDS NAME because a container file may have several NDF structures at a given level. It has an optional TYPE of NDF that will not be tested by general-purpose applications but is recommended to assist recognition by human readers of structure listings. NDFs may be structured recursively—see the polarimetry example below, for example.
It was not, in fact, possible to keep strictly to the rules in Section 13 when designing the NDF structure; compromises were necessary in order to allow old Asterix and Wright-Giddings-formatted data, of which there is a great deal, to be processed by the new general-purpose applications. The NDF structure comprises a title, a data array and its associated objects (a [DATA_ARRAY] structure in the Wright-Giddings terminology), axis information, history and one or more registered named objects containing application-specific components. Note that everything at the top level is intended to be under Starlink control, and although general-purpose applications will (for an initial period) tolerate non-standard components at this level, such rogue objects will not be processed beyond being copied to the same place within an output structure. This Starlink-components-only restriction, which does not preclude extensibility (done through the MORE objects), simplifies the job of applications, relieving them of the responsibility of keeping track of arbitrary numbers of extra objects. It is recommended that if an application detects the presence of a rogue object it should display a warning message, to alert the user to take some action (for example to run the appropriate format conversion utility).
Component Name | TYPE | Brief Description |
[VARIANT] | _CHAR | variant of the NDF type |
[TITLE] | _CHAR | title of NDF |
[DATA_ARRAY] | various | NAXIS-dimensional data array |
[LABEL] | _CHAR | label describing the data array |
[UNITS] | _CHAR | units of the data array |
[VARIANCE] | s_array | variance of the data array |
[BAD_PIXEL] | _LOGICAL | bad pixel flag |
[QUALITY] | various | quality of the data array |
[AXIS(NAXIS)] | AXIS | axis values, labels, units and errors |
[HISTORY] | HISTORY | history structure |
[MORE] | EXT | extension structure |
‘SIMPLE’
is
currently available.
Notes:
General-purpose applications expecting an NDF structure should be prepared to process the data array of Wright-Giddings formats as well. Also, it should not matter in either case whether the name of the structure containing the data array or the name of the data array itself is supplied by the user. However, only when the name of the NDF structure is given can other data objects in the NDF be processed, because of the no-tree-walking rule. An outline algorithm to achieve the required functionality is:
Giv | en | nam | e o | f o | bje | ct |
Find its type |
if (type not primitive) then |
if (type not c_array) then |
if (type not NDF)then |
issue warning but proceed |
endif |
look for [DATA_ARRAY] |
if ([DATA_ARRAY] not found) then |
No data processed |
Exit |
else |
Search for other required items |
endif |
endif |
endif |
Process [DATA_ARRAY]. |
Some general-purpose applications will need to be able to access subsets of a data array. The problem is twofold: first, the method of implementation needs to be specified, and second, the representation of each axis must be identified. An example is a general image-display routine which expects to be supplied a two-dimensional image but which is instead given a three-dimensional data cube. Such an application must have a means to select the whole or part of a slice from the cube. One method is simply to use two applications one after the other: first run MANIC (a KAPPA application) on the input data array to create a new dataset containing the required data; and second, run the required processing application on those extracted data. However, this means extra work for the user, and extra scratch space requirements, and in the case of frequently-used applications it will be more natural to provide the necessary ‘slicing’ capability directly. In these cases, applications will be able to exploit MANIC’s component subroutines, which will first obtain the parameter values to specify the data subset required, and then extract the subset efficiently and store it in internal workspace ready for processing. Through the applications interface file, it will be possible to set up default parameter values tailored to the application concerned. When the selection of axes is being made (specifying in what direction the 2-D cut through the 3-D data cube is to be made, for example), the application should display to the user the axis labels (if present) to assist identification.
Various specialised data objects and structures may be packaged around the NDF structure, using the NDF as a building block. One common requirement is for a series of related spectra or pictures; this could be implemented simply as a sequence of NDFs as follows:
na | me | sp | eci | al_ty | pe |
[name1] | NDF |
[name2] | NDF |
[name3] | NDF |
Another approach would be to use an HDS array, each element of which is an NDF.
The merging of history records has been discussed in Section 10.6, and the same approach is followed for other data objects within an NDF. Thus, cases are divided into (i) those with a principal data array, where only the components of its NDF structure are processed/copied to an output array, and (ii) those where the data arrays have equal importance, and the application, by convention, assumes the first NDF supplied contains the principal data array. There will be an HDS editor and NDF “dressing/undressing” utilities when this is not satisfactory. It is suggested that a common ADAM parameter name be assigned to this ‘principal’ NDF, e.g. MAIN_ARRAY.
Stokes parameters are the most common method for storing and analysis of polarimetric data. Here is an illustrative example of how they might be stored using the NDF structure, taking the approach that the data is the principal data array, and is therefore stored at the top-level of the structure. The , and -parameter data are NDF structures called, respectively, [STOKES_Q], [STOKES_U] and [STOKES_V], and located within a polarimetry extension.
The obvious alternative approach would be simply to add to the [DATA_ARRAY] an extra dimension so that the different Stokes parameters could all be stored in a single data array. Thus, for example, the four Stokes pictures from a 512512 imaging polarimeter would be stored as different planes of a 4512512 data cube. Though superficially more elegant than using separate arrays for each Stokes parameter, such an approach would introduce the danger of invalid processing, because the Stokes parameters are intrinsically different from each other; they cannot be combined (for example adding a pixel value to its value would be meaningless) whereas analogous arithmetic between values in the spatial time and wavelength/energy dimensions (for example rebinning) would, of course, be valid.
Component Name | TYPE | Brief Description |
[STOKES_Q] | NDF | Stokes data objects |
[STOKES_U] | NDF | Stokes data objects |
[STOKES_V] | NDF | Stokes data objects |
Component Name | TYPE | Brief Description |
[TITLE] | _CHAR | title of NDF |
[DATA_ARRAY] | various | Stokes data array |
[LABEL] | _CHAR | label describing the data array |
[UNITS] | _CHAR | units of the data array |
[VARIANCE] | s_array | variance of the data array |
[QUALITY] | various | quality of the data array |
[AXIS(NAXIS)] | AXIS | axis values, labels, units and errors |
applicable to all Stokes parameters | ||
[HISTORY] | HISTORY | history structure |
[MORE] | EXT | extension structure |
[.POLARIMETRY] | EXT | polarimetry extension |
Usually, the different Stokes parameters will have the same axis information and, using the structure above, specialist polarimetry applications will be able to exploit this fact. However, general-purpose applications will not be able to do so, because of the rule on “tree-walking”. To obtain other than default axis data using a general-purpose application, say displaying [STOKES_Q.DATA_ARRAY], the axis information must be duplicated in the [STOKES_Q] structure; alternatively, application should have a parameter which specifies where the axis information is to be found. If the default is taken, the application should look for the AXIS structure in the normal place, i.e. within [STOKES_Q.]
The support software associated with the standard data structures described above will take a long time to develop. In the meantime, some astronomers and programmers will want to convert their applications to ADAM and to start using HDS data structures. Therefore, a simple and limited form of the NDF structure is available for their use. It will be comprehensible to the standard interfaces once they are ready, so that existing applications would then require minor modification, but the data files would not.
Component Name | TYPE | Brief Description |
[TITLE] | _CHAR | title of [DATA_ARRAY] |
[DATA_ARRAY] | narray | NAXIS-dimensional data array |
[AXIS(NAXIS)] | AXIS | axis values, labels, units and errors |
Component Name | TYPE | Brief Description |
[DATA_ARRAY] | narray | axis value at each pixel |
[LABEL] | _CHAR | axis label |
[UNITS] | _CHAR | axis units |
Applications must test pixels for magic values—there is no [BAD_PIXEL] flag in the simplified NDF.