NXDICT: a dictionary based aproach for writing NeXus data
M. Koennecke
Paul Scherrer Institut, Labor fuer Neutronenstreuung
There exists a new proposed data exchange format for neutron and X-ray scattering
data. This format is called NeXus. Data files can be written in this format
using the NeXus Application Programmers Interface (API). When writing code
for this new data format it was found that it involved a lot of repetetive
code. Moreover this code would need to be changed when some aspects
of the data file structure change during the ongoing discussion of
the NeXus data format. Now, computers are very good at repetetive tasks. Therefore
a scheme was developed which lets the computer generate the structure
of the NeXus file and place the data properly.
This scheme involves a data description string which describes the location, name
and attributes of a data item in the file. A code module parses such a
data description string and creates the NeXus file structure automatically.
Data description strings are kept together with a short memonic in
a dictionary. This dictionary is initialised from a special dictionary
description file.
Using NXDICT, client code can read data from or write data to a
NeXus file with a single function call each. Changes to the structure of
the file requires changes to the dictionary definition file only.
Moreover, NXDICT provides a general tool for describing the data content
of a file and thus may foster discussion about data structures in
NeXus files.
(posted 19-Nov-97 jw)