4.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 or attribute. 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. The default type NX_CHAR
is applied in cases
where a field or attribute is defined in an NXDL specification without explicit assignment of a type
.
- ISO8601:
ISO8601 date/time stamp. It is recommended to add an explicit time zone, otherwise the local time zone is assumed per ISO8601. The norm is that if there is no time zone, it is assumed local time, however, when a file moves from one country to another it is undefined. If the local time zone is written, the ambiguity is gone.
- NX_BINARY:
any representation of binary data - if text, line terminator is [CR][LF]
- NX_BOOLEAN:
true/false value ( true | 1 | false | 0 )
- NX_CCOMPLEX:
Compound type cartesian representation of complex numbers (real and imaginary parts) in NeXus.
- NX_CHAR:
The preferred string representation is UTF-8. Both fixed-length strings and variable-length strings are valid. String arrays cannot be used where only a string is expected (title, start_time, end_time,
NX_class
attribute,…). Fields or attributes requiring the use of string arrays will be clearly marked as such (like theNXdata
attributeauxiliary_signals
). This is the default field type.
- NX_COMPLEX:
Compound type representation of complex numbers (either cartesian or polar form) in NeXus.
- NX_DATE_TIME:
Alias for the
ISO8601
date/time stamp. It is recommended to add an explicit time zone, otherwise the local time zone is assumed per 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_PCOMPLEX:
Compound type polar representation of complex numbers (amplitude and phase in radians) in NeXus.
- NX_POSINT:
any representation of a positive integer number (greater than zero)
- NX_QUATERNION:
Compound type representation of quaternion numbers (real,i,j,k) in NeXus.
- 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:
- units of angle,
example(s):
rad
- NX_ANY:
units for things like logs that aren’t picky on units
- NX_AREA:
- units of area,
example(s):
m^2
|barns
- NX_CHARGE:
- units of electrical charge,
example(s):
C
- NX_COUNT:
units of quantity of item(s) such as number of photons, neutrons, pulses, or other counting events
- NX_CROSS_SECTION:
- units of area (alias of NX_AREA),
example(s):
barn
- NX_CURRENT:
- units of electrical current,
example(s):
A
- NX_DIMENSIONLESS:
- units for fields where the units cancel out (NOTE: not the same as NX_UNITLESS),
example(s):
m/m
- NX_EMITTANCE:
- units of emittance (
length * angle
) of a radiation source, example(s):
nm*rad
- units of emittance (
- NX_ENERGY:
- units of energy,
example(s):
J
|keV
- NX_FLUX:
- units of flux,
example(s):
1/s/cm^2
- NX_FREQUENCY:
- units of frequency,
example(s):
Hz
- NX_LENGTH:
- units of length,
example(s):
m
- NX_MASS:
- units of mass,
example(s):
g
- NX_MASS_DENSITY:
- units of mass density,
example(s):
g/cm^3
- NX_MOLECULAR_WEIGHT:
- units of molecular weight,
example(s):
g/mol
- NX_PERIOD:
- units of time, period of pulsed source (alias to NX_TIME),
example(s):
us
- NX_PER_AREA:
- units of 1/length^2,
example(s):
1/m^2
- NX_PER_LENGTH:
- units of 1/length,
example(s):
1/m
- NX_POWER:
- units of power,
example(s):
W
- NX_PRESSURE:
- units of pressure,
example(s):
Pa
- NX_PULSES:
DEPRECATED: see NX_COUNT
units of clock pulses (alias to NX_NUMBER)
- NX_SCATTERING_LENGTH_DENSITY:
- units of scattering length density,
example(s):
m/m^3
- NX_SOLID_ANGLE:
- units of solid angle,
example(s):
sr
|steradian
- NX_TEMPERATURE:
- units of temperature,
example(s):
K
- NX_TIME:
- units of time,
example(s):
s
- NX_TIME_OF_FLIGHT:
- units of (neutron) time of flight (alias to NX_TIME),
example(s):
s
- NX_TRANSFORMATION:
units of the specified transformation
could be any of these:
NX_LENGTH
,NX_ANGLE
, orNX_UNITLESS
There will be one or more transformations defined by one or more fields for each transformation. The units type
NX_TRANSFORMATION
designates the particular axis generating a transformation (e.g. a rotation axis or a translation axis or a general axis).NX_TRANSFORMATION
designates the units will be appropriate to the type of transformation, indicated in the NXtransformations base class by thetransformation_type
value:NX_LENGTH
fortranslation
NX_ANGLE
forrotation
NX_UNITLESS
for axes for which no transformation type is specified.
- 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),
example(s):
""
- NX_VOLTAGE:
- units of voltage,
example(s):
V
- NX_VOLUME:
- units of volume,
example(s):
m^3
- NX_WAVELENGTH:
- units of wavelength,
example(s):
angstrom
- NX_WAVENUMBER:
- units of wavenumber or Q,
example(s):
1/nm
|1/angstrom