Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 43 additions & 7 deletions base_classes/NXdata.nxdl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,38 @@
the axes attribute can be omitted.
</doc>
</attribute>
<attribute name="default_slice">
<doc>
Which slice of data to show in a plot by default. This is useful especially for
datasets with more than 2 dimensions.

Should be an array of strings of length equal to the number of dimesions
Comment thread
phyy-nx marked this conversation as resolved.
Outdated
in the data, with the following possible values:
* ".": All the data in this dimension should be included
* Integer: Only this slice should be used.
Comment thread
woutdenolf marked this conversation as resolved.
* String: Only this slice should be used. Use if AXISNAME_indices is a string
Comment thread
phyy-nx marked this conversation as resolved.
Outdated
array.

Example::

data:NXdata
@signal = "data"
@axes = ["image_id", "channel", ".", "."]
@image_id_indices = 0
@channel_indices = 1
@default_slice = [".", "difference", ".", "."]
image_id = [1, ..., nP]
channel = ["threshold_1", "threshold_2", "difference"]
data = uint[nP, nC, i, j]

Here, a data array with four dimensions, including the number of images
(nP) and number of channels (nC), specifies more dimensions than can be
visualized with a 2D image viewer for a given image. Therefore the
default_slice attribute specifies that the "difference" channel should be
shown by default.

</doc>
</attribute>
<attribute name="AXISNAME_indices" type="NX_INT">
<!--
nxdl.xsd rules do not allow us to show this as a variable name
Expand Down Expand Up @@ -273,14 +305,18 @@
but not to describe how the data is to be plotted.
(https://www.nexusformat.org/NIAC2018Minutes.html#nxdata-plottype--attribute)
</doc>
<field name="AXISNAME" type="NX_NUMBER" nameType="any">
<field name="AXISNAME" type="NX_CHAR_OR_NUMBER" nameType="any">
<doc>
Dimension scale defining an axis of the data.
Client is responsible for defining the dimensions of the data.
The name of this field may be changed to fit the circumstances.
Standard NeXus client tools will use the attributes to determine
how to use this field.
</doc>
Dimension scale defining an axis of the data.
Client is responsible for defining the dimensions of the data.
The name of this field may be changed to fit the circumstances.
Standard NeXus client tools will use the attributes to determine
how to use this field.

Most dimensions scales will be sequences of numbers but if an
axis is better represented using names, such as channel names,
an array of NX_CHAR can be provided.
</doc>
<dimensions rank="1">
<doc>
A *dimension scale* must have a rank of 1 and has length ``n``.
Expand Down
11 changes: 11 additions & 0 deletions nxdlTypes.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@
nxdl:NX_POSINT
nxdl:NX_QUATERNION
nxdl:NX_UINT
nxdl:NX_CHAR_OR_NUMBER
"/>
</xs:simpleType>

Expand Down Expand Up @@ -619,4 +620,14 @@
<xs:restriction base="xs:unsignedByte" />
</xs:simpleType>

<xs:simpleType name="NX_CHAR_OR_NUMBER">
<xs:annotation>
<xs:documentation>Any valid character string or NeXus number representation</xs:documentation>
</xs:annotation>
<xs:union memberTypes="
nxdl:NX_NUMBER
nxdl:NX_CHAR
" />
</xs:simpleType>

</xs:schema>