-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: 1381 change to the axes attribute meaning #1396
base: main
Are you sure you want to change the base?
Changes from 17 commits
b1ad2e6
26315aa
d19ff47
7844bda
d85f56c
61343dd
939fb7e
ecd53dc
69e53c9
9a78a11
1c61a09
6a014b5
115e631
c8e5d6c
27cfde3
37306ef
e37a676
0bf8672
6b23f02
c27e2d3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,8 +50,8 @@ | |
|
||
<doc> | ||
The :ref:`NXdata` class is designed to encapsulate all the information required for a set of data to be plotted. | ||
NXdata groups contain plottable data (sometimes referred to as *signals* or *dependent variables*) and their | ||
associated axis coordinates (sometimes referred to as *axes* or *independent variables*). | ||
NXdata groups contain plottable data (also referred to as *signals* or *dependent variables*) and their | ||
associated axis coordinates (also referred to as *axes* or *independent variables*). | ||
|
||
The actual names of the :ref:`DATA </NXdata/DATA-field>` and :ref:`AXISNAME </NXdata/AXISNAME-field>` fields | ||
can be chosen :ref:`freely <validItemName>`, as indicated by the upper case (this is a common convention in all NeXus classes). | ||
|
@@ -60,176 +60,181 @@ | |
does not describe how the data is to be plotted or even the dimensionality of the plot. | ||
https://www.nexusformat.org/NIAC2018Minutes.html#nxdata-plottype--attribute | ||
|
||
**Usage:** | ||
|
||
.. admonition:: Plot data versus x axis | ||
|
||
.. code-block:: | ||
|
||
data:NXdata | ||
@signal = "data" | ||
@axes = ["x"] | ||
data: float[100] | ||
x: float[100] | ||
|
||
More complex cases are supported | ||
|
||
* histogram data: ``x`` has one more value than ``data``. | ||
* alternative axes: instead of a single ``x`` axis you can have several axes, one of which being the default. | ||
* signals with more than one dimension: ``data`` could be 2D with axes ``x`` and ``y`` along each dimension. | ||
* axes with more than one dimension: ``data`` could be 2D with axes ``x`` and ``y`` also being 2D, providing a | ||
unique ``[x, y]`` coordinate for each ``data`` point. | ||
woutdenolf marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
**Signals:** | ||
|
||
.. index:: plotting | ||
|
||
|
||
.. admonition:: Defined by | ||
|
||
* :ref:`DATA </NXdata/DATA-field>` fields | ||
* the :ref:`signal </NXdata@signal-attribute>` attribute | ||
* the :ref:`auxiliary_signals</NXdata@auxiliary_signals-attribute>` attribute | ||
|
||
The :ref:`DATA </NXdata/DATA-field>` fields contain the signal values to be plotted. The name of the field | ||
to be used as the *default plot signal* is provided by the :ref:`signal </NXdata@signal-attribute>` attribute. | ||
The names of the fields to be used as *secondary plot signals* are provided by the | ||
:ref:`auxiliary_signals</NXdata@auxiliary_signals-attribute>` attribute. | ||
|
||
An example with three signals, one of which being the default | ||
.. admonition:: An example with three signals, one of which being the default | ||
|
||
.. code-block:: | ||
.. code-block:: | ||
|
||
data:NXdata | ||
@signal = "data1" | ||
@auxiliary_signals = ["data2", "data3"] | ||
data1: float[10,20,30] --> the default signal | ||
data2: float[10,20,30] | ||
data3: float[10,20,30] | ||
data:NXdata | ||
@signal = "data1" | ||
@auxiliary_signals = ["data2", "data3"] | ||
data1: float[10,20,30] --> the default signal | ||
data2: float[10,20,30] | ||
data3: float[10,20,30] | ||
|
||
**Axes:** | ||
|
||
.. index:: axes (attribute) | ||
.. index:: coordinates | ||
|
||
The :ref:`AXISNAME </NXdata/AXISNAME-field>` fields contain the axis coordinates associated with the data values. | ||
The names of all :ref:`AXISNAME </NXdata/AXISNAME-field>` fields are listed in the | ||
:ref:`axes </NXdata@axes-attribute>` attribute. | ||
|
||
`Rank` | ||
|
||
:ref:`AXISNAME </NXdata/AXISNAME-field>` fields are typically one-dimensional arrays, which annotate one of the dimensions. | ||
.. admonition:: Defined by | ||
|
||
An example of this would be | ||
* :ref:`AXISNAME </NXdata/AXISNAME-field>` fields | ||
* the :ref:`axes </NXdata@axes-attribute>` attribute | ||
* :ref:`AXISNAME_indices </NXdata@AXISNAME_indices-attribute>` attributes | ||
|
||
.. code-block:: | ||
The fields and attributes are defined as follows | ||
|
||
data:NXdata | ||
@signal = "data" | ||
@axes = ["x", "y"] --> the order matters | ||
data: float[10,20] | ||
x: float[10] --> coordinates along the first dimension | ||
y: float[20] --> coordinates along the second dimension | ||
1. The :ref:`AXISNAME </NXdata/AXISNAME-field>` fields contain the axis coordinates associated with the signal values. | ||
|
||
In this example each data point ``data[i,j]`` has axis coordinates ``[x[i], y[j]]``. | ||
2. The :ref:`axes </NXdata@axes-attribute>` attribute provides the names of the :ref:`AXISNAME </NXdata/AXISNAME-field>` | ||
fields to be used as the `default axis` for each dimension of the :ref:`DATA </NXdata/DATA-field>` fields. | ||
|
||
However, the fields can also have a rank greater than 1, in which case the rank of each | ||
:ref:`AXISNAME </NXdata/AXISNAME-field>` must be equal to the number of data dimensions it spans. | ||
3. The :ref:`AXISNAME_indices </NXdata@AXISNAME_indices-attribute>` attributes describe the :ref:`DATA </NXdata/DATA-field>` | ||
dimensions spanned by the corresponding :ref:`AXISNAME </NXdata/AXISNAME-field>` fields. | ||
|
||
An example of this would be | ||
Additional requirements for a complete definition | ||
|
||
.. code-block:: | ||
1. The length of the :ref:`axes </NXdata@axes-attribute>` attribute must be equal to the rank of the :ref:`DATA </NXdata/DATA-field>` | ||
fields. When a particular dimension has no default axis, the string “.” is used in that position. | ||
|
||
data:NXdata | ||
@signal = "data" | ||
@axes = ["x", "y"] --> the order does NOT matter | ||
@x_indices = [0, 1] | ||
@y_indices = [0, 1] | ||
data: float[10,20] | ||
x: float[10,20] --> coordinates along both dimensions | ||
y: float[10,20] --> coordinates along both dimensions | ||
2. The number of values in :ref:`AXISNAME_indices </NXdata@AXISNAME_indices-attribute>` must be equal to the rank of the corresponding | ||
:ref:`AXISNAME </NXdata/AXISNAME-field>` field. | ||
|
||
In this example each data point ``data[i,j]`` has axis coordinates ``[x[i,j], y[i,j]]``. | ||
3. When :ref:`AXISNAME_indices </NXdata@AXISNAME_indices-attribute>` is missing for a given | ||
:ref:`AXISNAME </NXdata/AXISNAME-field>` field, the positions of the :ref:`AXISNAME </NXdata/AXISNAME-field>` | ||
field name in the :ref:`axes </NXdata@axes-attribute>` attribute are used. | ||
|
||
`Dimensions` | ||
4. When :ref:`AXISNAME_indices </NXdata@AXISNAME_indices-attribute>` is the same as the indices of "AXISNAME" in the | ||
:ref:`axes </NXdata@axes-attribute>` attribute, there is no need to provide | ||
:ref:`AXISNAME_indices </NXdata@AXISNAME_indices-attribute>`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only for 1D axis fields? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this applies in general then When
So if a 1D There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, a pathological case could be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok I see. So omitting indices can only work unambiguously in 1D cases. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another pathological case would be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Eeeeww! That's pathological, and likely a mistake. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah ok, the first example. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Agreed but technically the definition does not present it as far as I can see, which we should probably fix but not sure how. Stating that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @prjemian Can you modify the code provided in #1396 (comment) to prove that the current specs allow a 1D signal to be used for multiple dimensions without breaking support for multi-dimensional axes? I don't think it is possible. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure I know how to proceed on this directly. For the variety of different formats considered by canSAS, the discussion resulted in this documentation where the examples are repeated. Those are the places I would examine to test multi-dimensional data. |
||
|
||
The data dimensions annotated by an :ref:`AXISNAME </NXdata/AXISNAME-field>` field are defined by the | ||
:ref:`AXISNAME_indices </NXdata@AXISNAME_indices-attribute>` attribute. When this attribute is missing, | ||
the position(s) of the :ref:`AXISNAME </NXdata/AXISNAME-field>` string in the | ||
:ref:`axes </NXdata@axes-attribute>` attribute are used. | ||
5. The indices of "AXISNAME" in the :ref:`axes </NXdata@axes-attribute>` attribute must be a subset of | ||
:ref:`AXISNAME_indices </NXdata@AXISNAME_indices-attribute>`. | ||
|
||
When all :ref:`AXISNAME </NXdata/AXISNAME-field>` fields are one-dimensional, and none of the data dimensions | ||
have more than one axis, the :ref:`AXISNAME_indices </NXdata@AXISNAME_indices-attribute>` attributes | ||
are often omitted. If one of the data dimensions has no :ref:`AXISNAME </NXdata/AXISNAME-field>` field, | ||
the string “.” can be used in the corresponding index of the axes list. | ||
6. The shape of an :ref:`AXISNAME </NXdata/AXISNAME-field>` field must correspond to the shape of the | ||
:ref:`DATA </NXdata/DATA-field>` dimensions it spans. This means that for each dimension ``i`` in ``[0, AXISNAME.ndim)`` | ||
spanned by an :ref:`AXISNAME </NXdata/AXISNAME-field>` field the number of data points along this dimension | ||
``DATA.shape[AXISNAME_indices[i]]`` must be equal to the number of axis values along this dimension ``AXISNAME.shape[i]`` | ||
or the number of bin edges ``AXISNAME.shape[i]+1`` in case of histogram data. | ||
woutdenolf marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
An example of this would be | ||
Highlight concequences that follow the definition | ||
woutdenolf marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
.. code-block:: | ||
1. An :ref:`AXISNAME </NXdata/AXISNAME-field>` field can have more than one dimension and can therefore span | ||
more than one :ref:`DATA </NXdata/DATA-field>` dimension. Conversely, one :ref:`DATA </NXdata/DATA-field>` dimension | ||
can be spanned by more than one :ref:`AXISNAME </NXdata/AXISNAME-field>` field. The default axis name (if any) | ||
of each dimension can be found in the :ref:`axes </NXdata@axes-attribute>` attribute. | ||
|
||
data:NXdata | ||
@signal = "data" | ||
@axes = ["x", ".", "z"] --> the order matters | ||
data: float[10,20,30] | ||
x: float[10] --> coordinates along the first dimension | ||
z: float[30] --> coordinates along the third dimension | ||
2. A list of all available axes is not provided directly. All strings in the :ref:`axes </NXdata@axes-attribute>` attribute | ||
(excluding the “.” string) are axis field names. In addition the prefix of an attribute ending with the string "_indices" is also | ||
an axis field name. | ||
|
||
When using :ref:`AXISNAME_indices </NXdata@AXISNAME_indices-attribute>` this becomes | ||
.. admonition:: The following example covers all axes features supported | ||
|
||
.. code-block:: | ||
.. code-block:: | ||
|
||
data:NXdata | ||
@signal = "data" | ||
@axes = ["x", "z"] --> the order does NOT matter | ||
data: float[10,20,30] | ||
@x_indices = 0 | ||
@z_indices = 2 | ||
x: float[10] --> coordinates along the first dimension | ||
z: float[30] --> coordinates along the third dimension | ||
data:NXdata | ||
@signal = "data" | ||
@axes = ["x_set", "y_set", "."] --> default axes for all three dimensions | ||
@x_encoder_indices = [0, 1] | ||
@y_encoder_indices = 1 --> or [1] | ||
data: float[10,7,1024] | ||
x_encoder: float[11,7] --> coordinates along the first and second dimensions | ||
y_encoder: float[7] --> coordinates along the second dimension | ||
x_set: float[10] --> coordinates along the first dimension | ||
y_set: float[7] --> coordinates along the second dimension | ||
|
||
When providing :ref:`AXISNAME_indices </NXdata@AXISNAME_indices-attribute>` attributes it is recommended | ||
to do it for all axes. | ||
One scientific application that provided such data is 2D scanning X-Ray Fluorescence (XRF) | ||
where the sample is scanned through a focussed X-ray beam in two dimensions and an XRF spectrum | ||
with 1024 channels is recorded at each position. In addition the x motor is scanned | ||
continuously and both motors have an encoder which records the actual motor position as | ||
opposed to the requested or `set` position. | ||
|
||
`Non-trivial axes` | ||
.. image:: data/example2D_hist.png | ||
:width: 100% | ||
|
||
What follows are two examples where :ref:`AXISNAME_indices </NXdata@AXISNAME_indices-attribute>` attributes | ||
cannot be omitted. | ||
1. ``@axes`` has three values which corresponds to the ``data`` rank of three | ||
|
||
The first is an example where data dimensions have alternative axis coordinates. The NXdata group represents | ||
a stack of images collected at different energies. The ``wavelength`` is an alternative axis of ``energy`` | ||
for the last dimension (or vice versa). | ||
2. ``x_set`` and ``y_set`` are the default axes for the first two dimensions while the third | ||
dimension does not have a default axis or any axis for that matter. | ||
|
||
.. code-block:: | ||
3. ``x_set_indices`` and ``y_set_indices`` are omitted because they would be equal to | ||
the position of ``"x_set"`` and ``"y_set"`` in ``@axes``. | ||
|
||
data:NXdata | ||
@signal = "data" | ||
@axes = ["x", "y", "energy", "wavelength"] --> the order does NOT matter | ||
@x_indices = 0 | ||
@y_indices = 1 | ||
@energy_indices = 2 | ||
@wavelength_indices = 2 | ||
data: float[10,20,30] | ||
x: float[10] --> coordinates along the first dimension | ||
y: float[20] --> coordinates along the second dimension | ||
energy: float[30] --> coordinates along the third dimension | ||
wavelength: float[30] --> coordinates along the third dimension | ||
4. The first dimension is spanned by two axes ``x_set`` and ``x_encoder``. Since | ||
the x motor is scanned continuously, the encoder records the edge of every bin | ||
on which an XRF spectrum is recorded yielding 11 values instead of 10 along the | ||
first dimension. The ``x_encoder`` spans two dimensions because the actual x edges | ||
are slightly different for every x motion at each y position. | ||
|
||
The second is an example with coordinates that span more than one dimension. The NXdata group represents data | ||
from 2D mesh scans performed at multiple energies. Each data point ``data[i,j,k]`` has axis coordinates | ||
``[x[i,j,k], y[i,j,k], energy[k]]``. | ||
5. The second dimension is spanned by two axes ``y_set`` and ``y_encoder``. The axes | ||
have as many values are there are data points along the second dimension. This is | ||
because the y motor moves one step after each scan of the x motor. Since the y | ||
motor does not move while scanning x, there is no need for ``y_encoder`` to span | ||
the first dimension because the value along this dimension remains constant. | ||
|
||
.. code-block:: | ||
**Uncertainties:** | ||
|
||
data:NXdata | ||
@signal = "data" | ||
@axes = ["x", "y", "energy"] --> the order does NOT matter | ||
@x_indices = [0, 1, 2] | ||
@y_indices = [0, 1, 2] | ||
@energy_indices = 2 | ||
data: float[10,20,30] | ||
x: float[10,20,30] --> coordinates along all dimensions | ||
y: float[10,20,30] --> coordinates along all dimensions | ||
energy: float[30] --> coordinates along the third dimension | ||
.. admonition:: Defined by | ||
|
||
**Uncertainties:** | ||
* :ref:`FIELDNAME_errors </NXdata/FIELDNAME_errors-field>` fields | ||
|
||
Standard deviations on data values as well as coordinates can be provided by | ||
:ref:`FIELDNAME_errors </NXdata/FIELDNAME_errors-field>` fields where ``FIELDNAME`` is the name of a | ||
:ref:`DATA </NXdata/DATA-field>` field or an :ref:`AXISNAME </NXdata/AXISNAME-field>` field. | ||
|
||
An example of uncertainties on the signal, auxiliary signals and axis coordinates | ||
|
||
.. code-block:: | ||
|
||
data:NXdata | ||
@signal = "data1" | ||
@auxiliary_signals = ["data2", "data3"] | ||
@axes = ["x", "z"] | ||
@x_indices = 0 | ||
@z_indices = 2 | ||
data1: float[10,20,30] | ||
data2: float[10,20,30] | ||
data3: float[10,20,30] | ||
x: float[10] | ||
z: float[30] | ||
data1_errors: float[10,20,30] | ||
data2_errors: float[10,20,30] | ||
data3_errors: float[10,20,30] | ||
x_errors: float[10] | ||
z_errors: float[30] | ||
.. admonition:: An example of uncertainties on the signal, auxiliary signals and axis coordinates | ||
|
||
.. code-block:: | ||
|
||
data:NXdata | ||
@signal = "data1" | ||
@auxiliary_signals = ["data2", "data3"] | ||
@axes = ["x", ".", "z"] | ||
data1: float[10,20,30] | ||
data2: float[10,20,30] | ||
data3: float[10,20,30] | ||
x: float[10] | ||
z: float[30] | ||
data1_errors: float[10,20,30] | ||
data2_errors: float[10,20,30] | ||
data3_errors: float[10,20,30] | ||
x_errors: float[10] | ||
z_errors: float[30] | ||
|
||
</doc> | ||
|
||
|
@@ -316,11 +321,13 @@ | |
--> | ||
<!-- AXISNAME_indices documentation copied from datarules.rst --> | ||
<doc> | ||
The ``AXISNAME_indices`` attribute is a single integer or an array of integers that defines which :ref:`data </NXdata/DATA-field>` | ||
dimension(s) are spanned by the corresponding axis. The first dimension index is ``0`` (zero). | ||
The ``AXISNAME_indices`` attribute is a single integer or an array of integers that defines which :ref:`DATA </NXdata/DATA-field>` | ||
dimensions are spanned by the corresponding axis. The first dimension index is ``0`` (zero). | ||
|
||
The number of indices must be equal to the rank of the :ref:`AXISNAME </NXdata/AXISNAME-field>` field. | ||
|
||
When the ``AXISNAME_indices`` attribute is missing for an :ref:`AXISNAME </NXdata/AXISNAME-field>` field, its value becomes the index | ||
(or indices) of the :ref:`AXISNAME </NXdata/AXISNAME-field>` name in the :ref:`axes </NXdata@axes-attribute>` attribute. | ||
When the ``AXISNAME_indices`` attribute is missing for a given :ref:`AXISNAME </NXdata/AXISNAME-field>` field, its value becomes | ||
the index (or indices) of the :ref:`AXISNAME </NXdata/AXISNAME-field>` name in the :ref:`axes </NXdata@axes-attribute>` attribute. | ||
|
||
.. note:: When ``AXISNAME_indices`` contains multiple integers, it must be saved as an actual array | ||
of integers and not a comma separated string. | ||
|
@@ -329,26 +336,33 @@ | |
<attribute name="axes"> | ||
<doc> | ||
.. index:: plotting | ||
|
||
The ``axes`` attribute is a list of strings which are the names of the :ref:`AXISNAME </NXdata/AXISNAME-field>` fields | ||
that contain the values of the coordinates along the :ref:`data </NXdata/DATA-field>` dimensions. | ||
to be used as the default axis along every :ref:`DATA </NXdata/DATA-field>` dimension. As a result the length must | ||
be equal to the rank of the :ref:`DATA </NXdata/DATA-field>` fields. The string "." can be used for | ||
dimensions without a default axis. | ||
|
||
.. note:: When ``axes`` contains multiple strings, it must be saved as an actual array | ||
of strings and not a single comma separated string. | ||
</doc> | ||
<dimensions rank="1"> | ||
<dim index="1" value="dataRank"/> | ||
</dimensions> | ||
</attribute> | ||
|
||
<!-- Data and coordinate fields --> | ||
<field name="AXISNAME" type="NX_CHAR_OR_NUMBER" nameType="any"> | ||
<doc> | ||
Coordinate values along one or more :ref:`data </NXdata/DATA-field>` dimensions. The rank must be equal | ||
to the number of dimensions it spans. | ||
|
||
Coordinate values along one or more :ref:`DATA </NXdata/DATA-field>` dimensions. | ||
|
||
The shape of an ``AXISNAME`` field must correspond to the shape of the :ref:`DATA </NXdata/DATA-field>` | ||
dimensions it spans. This means that for each ``i`` in ``[0, AXISNAME.ndim)`` the number of data points | ||
``DATA.shape[AXISNAME_indices[i]]`` must be equal to the number of coordinates ``AXISNAME.shape[i]`` or the | ||
woutdenolf marked this conversation as resolved.
Show resolved
Hide resolved
|
||
number of bin edges ``AXISNAME.shape[i]+1`` in case of histogram data. | ||
|
||
As the upper case ``AXISNAME`` indicates, the names of the ``AXISNAME`` fields can be chosen :ref:`freely <validItemName>`. | ||
The :ref:`axes </NXdata@axes-attribute>` attribute can be used to find all datasets in the | ||
``NXdata`` that contain coordinate values. | ||
|
||
Most AXISNAME fields will be sequences of numbers but if an axis is better represented using names, such as channel names, | ||
Most ``AXISNAME`` fields 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> | ||
<attribute name="long_name"><doc>Axis label</doc></attribute> | ||
|
@@ -380,7 +394,7 @@ | |
<field name="DATA" type="NX_NUMBER" nameType="any"> | ||
<doc> | ||
.. index:: plotting | ||
|
||
Data values to be used as the NeXus *plottable data*. As the upper case ``DATA`` | ||
indicates, the names of the ``DATA`` fields can be chosen :ref:`freely <validItemName>`. The :ref:`signal attribute </NXdata@signal-attribute>` | ||
and :ref:`auxiliary_signals attribute</NXdata@auxiliary_signals-attribute>` can be used to find all datasets in the ``NXdata`` | ||
|
@@ -424,10 +438,12 @@ | |
<doc> | ||
"Errors" (meaning *uncertainties* or *standard deviations*) | ||
associated with any field named ``FIELDNAME`` in this ``NXdata`` | ||
group (e.g. an axis, signal or auxiliary signal). | ||
group. This can be a :ref:`DATA </NXdata/DATA-field>` field | ||
(signal or auxiliary signal) or a :ref:`AXISNAME </NXdata/AXISNAME-field>` | ||
field (axis). | ||
|
||
The dimensions of the ``FIELDNAME_errors`` field must match | ||
the dimensions of the ``FIELDNAME`` field. | ||
the dimensions of the corresponding ``FIELDNAME`` field. | ||
</doc> | ||
</field> | ||
<field name="errors" type="NX_NUMBER" deprecated="Use ``DATA_errors`` instead (NIAC2018)"> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@signal
is optional and if missing, we usedata
so maybe simplest example should omit it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not know this. Not specified in the definition. I'll add it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess when
@axes
is missing, we use[".", ".", ...]
(as many dots as rank)?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If
@signal
is missing, there is no rule that says"data"
is required as a field name. In this case and multiple fields, selection of the signal field for the default plot is not guaranteed.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought
NXdata
evolved from a fixed signal field (usually calleddata
, see e.g.definitions/base_classes/NXdata.nxdl.xml
Line 152 in 04bfe4c
@signal=1
so to be backwardly compatible, a modern parser could assume the group attributesignal
if missing is"data"
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that @prjemian is correct. I just scanned through the minutes of all the NIAC meetings, and I can't find any reference to a default name for the
signal
. I believe that the current (non-deprecated) method of defining signals and axes requires bothsignal
andaxes
attributes to be defined at group level.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was found that assigning these links to fields would break when the fields were linked (local or external) into other groups. Such field attributes could produce a group with multiple field
@signal
attributes.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we need to make these attributes
required
then.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could bring that up again for a NIAC vote. Should not make it required until then, since NIAC voted the other way.
Consider a simple use case (for not having this attribute). User wants to save a 2-D image, only the 2-D image. NeXus file consists of
/entry:NXentry/data:NXdata/image
whereimage
is the 2-D image. We've gotten strong pushback on requiring@signal
in this use case.