Table Of Contents

Previous topic

3.2.1.1. NXDL Elements and Data Types

Next topic

3.3. Base Class Definitions

This Page

3.2.1.2. NXDL: Data Types and Units

Data Types allowed in NXDL specifications

Data types for use in NXDL describe the expected type of data for a NeXus field. These terms are very broad. More specific terms are used in actual NeXus data files that describe size and array dimensions. In addition to the types in the following table, the NAPI type is defined when one wishes to permit a field with any of these data types.

ISO8601:ISO 8601 date and time representation (http://www.w3.org/TR/NOTE-datetime)
NX_BINARY:any representation of binary data - if text, line terminator is [CR][LF]
NX_BOOLEAN:true/false value ( true | 1 | false | 0 )
NX_CHAR:any string representation
NX_DATE_TIME:alias of ISO8601
NX_FLOAT:any representation of a floating point number
NX_INT:any representation of an integer number
NX_NUMBER:any valid NeXus number representation
NX_POSINT:any representation of a positive integer number (greater than zero)
NX_UINT:any representation of an unsigned integer number (includes zero)

Unit Categories allowed in NXDL specifications

Unit categories in NXDL specifications describe the expected type of units for a NeXus field. They should describe valid units consistent with the NeXus units section. The values for unit categories are restricted (by an enumeration) to the following table.

NX_ANGLE:example: degrees or radians or arcminutes or
NX_ANY:usage: things like logs that aren’t picky on units
NX_AREA:example: m2 or barns
NX_CHARGE:example: pC or C
NX_CROSS_SECTION:
 example: barns
NX_CURRENT:example: A
NX_DIMENSIONLESS:
 for fields where the units cancel out, example: “” or mm/mm (NOTE: not the same as NX_UNITLESS)
NX_EMITTANCE:emittance (length * angle) of a radiation source, example: nm*rad
NX_ENERGY:example: J or keV
NX_FLUX:example: s-1 cm-2
NX_FREQUENCY:example: Hz
NX_LENGTH:example: m
NX_MASS:example: g
NX_MASS_DENSITY:
 example: g cm-3
NX_MOLECULAR_WEIGHT:
 example: g mol-1
NX_PERIOD:(alias to NX_TIME) period of pulsed source, example: microseconds
NX_PER_AREA:example: cm-2
NX_PER_LENGTH:example: cm-1
NX_POWER:example: W
NX_PRESSURE:example: Pa
NX_PULSES:(alias to NX_NUMBER) clock pulses
NX_SCATTERING_LENGTH_DENSITY:
 example: cm-2
NX_SOLID_ANGLE:example: sr | steradian
NX_TEMPERATURE:example: K
NX_TIME:example: s
NX_TIME_OF_FLIGHT:
 (alias to NX_TIME) example: s
NX_UNITLESS:for fields that don’t have a unit (e.g. hkl) so that they don’t inherit the wrong units (NOTE: not the same as NX_DIMENSIONLESS)
NX_VOLTAGE:example: V
NX_VOLUME:example: m3
NX_WAVELENGTH:example: Angstrom
NX_WAVENUMBER:units for Q, example: Angstrom-1 or nm-1