The structure of NeXus files, described in the previous sections, ensures that generic browsers and plotting packages will be able to navigate them in order to locate plottable data and identify instrumental parameters manually. However, in order to develop more specific analysis software, it is necessary to define the actual contents of NeXus files. As discussed in the introduction, it is not necessary for every piece of information defined in the standard to be present in every NeXus file. The user can decide how comprehensive the file contents will be. However, NeXus defines where the information should go if it is included, and what it should be called.
As the NeXus format develops, a glossary of neutron and X-ray data items will be built up. The following naming conventions are proposed for NeXus file, data and attribute names:
It is recommended that NeXus files are given the extension .nxs, rather than the generic HDF extensions of .hdf or .h5. If it is necessary to distinguish between HDF4 and HDF5 files, e.g., containing the same data, use .nx4 and/or .nx5.
The name of any data item within a NeXus group must be unique to that group. This is important in HDF5 versions of NeXus files, since the full path name, e.g., /entry/sample/temperature, is a unique identifier of each data item. However, the same name can be used in different groups.
Lower case letters are used throughout, except for common symbols and abbreviations such as FWHM. Note that HDF names are case-sensitive so this rule is designed to avoid confusion between, e.g. name and Name.
Names are constructed from full words separated by the underscore character e.g. time_of_flight.
For sequentially indexed group names, the sequential number is simply appended to the name, e.g. filter1, filter2. This convention should be used only for data group names, and then sparingly, because of a potential for confusion between indexed and non-indexed names.
The datasets with multiple instances of some primitive data record should be stored in multi-dimensional arrays rather than in differently-named HDF data elements.
Class names are prefixed with the letters NX to avoid clashes with class names internal to HDF. Their names are prescribed by the NeXus standard.
The hierarchical structure of NeXus files should be used to simplify data names. For example, the data set containing the sample temperature will be called "temperature" since its location in the NXsample group makes the longer name "sample_temperature" unnecessary.
It is very important that, whenever possible, data units are specified for all physical data. This is implemented in the NeXus API in the NXputattr command. Our intentions is to give the user flexibility in specifying their preferred units when writing the NeXus data. The NeXus API will then perform automatic conversions to the requested units when reading the data (N.B. not yet implemented in API).
We recommend the use of S.I. units while recognizing that other units are very common in the neutron and X-ray community e.g. meV
and Angstroms
. Whatever units are used, they must be specified as a character string in the format used by the Unidata UDunits utility (in particular, see udunits.dat). This is because we plan to make use of the utility internally for unit conversions in the NeXus API.
NeXus dates and times should be stored using the ISO 8601 format e.g. 1996-07-31T21:15:22+0600. This will avoid confusion, e.g. between U.S. and European conventions, and is appropriate for machine sorting. We intend to provide routines for converting from absolute time in the ISO 8601 format to elapsed time e.g. in seconds.
The glossary defines the names of all the groups, data items, and attributes so far defined in the NeXus format. NeXus files will typically contain only a small fraction of these items. Although users are free to include data items not defined here, they are encouraged to use the defined names where possible.
The NeXus glossary is now defined in XML files for each NeXus group and uses a simplified meta-DTD format. The glossary is not complete; if you wish to suggest additional group classes or data items, please contact me. Comments may also be addressed to the NeXus mailing list. |
Global attributes are attributes of the whole file. The first three (file_name, file_time, and NeXus_version) are defined automatically by the NeXus API when the file is first produced.
Name | Type | Description |
---|---|---|
file_name | NX_CHAR | File name of original NeXus file to assist in identification if the external name has been changed |
file_time | ISO 8601 | Date and time of file creation |
NeXus_version | NX_CHAR | Version of NeXus API used in writing the file |
user | NX_CHAR | Name of user responsible for producing the file |
affiliation | NX_CHAR | User's affiliation |
address | NX_CHAR | User's postal address (complete) |
telephone_number | NX_CHAR | User's telephone number |
fax_number | NX_CHAR | User's fax number |
NX_CHAR | User's e-mail address |
Data attributes provide extra information defining the contents of each data item. The most common is the "units" attribute which is a required part of the NeXus standard whenever the data item has physical units.
Name | Type | Description |
---|---|---|
units | NX_CHAR | Units of data which must conform to the standard defined by the Unidata UDunits utility (in particular, see udunits.dat) |
signal | NX_INT32 | Defines which data set contains the signal to be plotted - set to 1 for main signal |
axes | NX_CHAR |
Defines the names of the dimension scales for this data set as a comma-delimited array, optionally surrounded by brackets (see a longer discussion in the section on NXdata structure) i.e. if the array being stored is data , with elements data[j][i] in C and data(i,j) in Fortran, with dimension scales time_of_flight[i] and polar_angle[j] , data would have an attribute called "axes" with the following value :
|
axis | NX_INT32 |
As an alternative to using the "axes" attribute, this defines the rank of the signal data for which this data set is a dimension scale in order of the fastest varying index (see a longer discussion in the section on NXdata structure) i.e. if the array being stored is data , with elements data[j][i] in C and data(i,j) in Fortran, "axis" would have the following values :
|
primary | NX_INT32 | Defines the order of preference for dimension scales which apply to the same rank of signal data - set to 1 for preferred dimension scale |
long_name | NX_CHAR | Defines title of signal data or axis label of dimension scale |
calibration_status | NX_CHAR | Defines status of data value - set to "Nominal" or "Measured" |
histogram_offset | NX_FLOAT32 |
Defines the offset from the first data point to its bin boundary.
|
checksum | NX_INT32 | Sum of data array acting as a check on data integrity |
version | NX_CHAR | Version number. The main use of this attribute is in the "analysis" data item in an NXentry group, where it defines the DTD file version on which the NeXus file is based. |
URL | NX_CHAR | The URL of the XML DTD file on which the NeXus file is based. Should only be used with the "analysis" data item in an NXentry group. |
It is impossible to define the precise format for every type of neutron and X-ray instrument. New developments ensure that such a project would need constant revision and updating, and it is not clear that there is any point to specifying such a standard when only one or two instances of an instrument design exists. However, it is possible to define some generic forms of instrumentation which would describe an appreciable number of existing instruments around the world. Although not identical in every detail, they share enough common characteristics, and more importantly, they require sufficiently similar modes of data analysis, to make a standard description useful.
The following instruments have been, or are in the process of being, defined for the NeXus standard. This list reflects the interests and expertise of those involved in developing the format. If you are interested in defining a new type of instrument, or wish to suggest modifications to the current definitions, please contact me. Comments may also be addressed to the NeXus mailing list. The NeXus meta-DTD format used in these instrument definitions is described here. |
The following instruments have been, or are in the process of being, defined for the NeXus standard. This list reflects the interests and expertise of those involved in developing the format. If you are interested in defining a new type of instrument, or wish to suggest modifications to the current definitions, please contact me. Comments may also be addressed to the NeXus mailing list.
Comments to: Ray Osborn <ROsborn@anl.gov>
Revised: Saturday, September 14, 2002
Copyright © 1996-2002 NeXus Design Team. All rights reserved.