Skip to content
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

NXdata linking of signal #205

Merged
merged 5 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
82 changes: 55 additions & 27 deletions base_classes/NXdata.nxdl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,20 @@ without this attribute being set to "true".-->
the axes attribute can be omitted.
</doc>
</attribute>
<attribute name="reference">
<doc>
Points to the path of a field defining the data to which the `DATA` group refers.

This concept allows to link the data to a respective field in the NeXus hierarchy, thereby
defining the physical quantity it represents.

Example:
If the data corresponds to a readout of a detector, ``@reference`` links
to that detectors data:

@reference: '/entry/instrument/detector/data' for a 2D detector
</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 @@ -283,33 +297,6 @@ AXISNAME_indices documentation copied from datarules.rst
to avoid string parsing in reading applications.
</doc>
</attribute>
<attribute name="AXISNAME_depends">
<doc>
Points to the path of a field defining the axis on which the ``AXISNAME`` axis depends.

This concept allows to link an axis to a respective field in the NeXus hierarchy, thereby
defining the physical quantity it represents.

Here, *AXISNAME* is to be replaced by the name of each
field described in the ``axes`` attribute.

Examples:
If a calibration has been performed, ``@AXISNAME_depends`` links to the result of
that calibration:

@AXISNAME_depends: '/entry/process/calibration/calibrated_axis'

If the axis corresponds to a coordinate of a detector, ``@AXISNAME_depends`` links
to that detector axis:

@AXISNAME_depends: '/entry/instrument/detector/axis/some_axis' for a 2D detector

If the axis is a scanned motor, ``@AXISNAME_depends`` links to the transformation
describing the respective motion, e.g.:

@AXISNAME_depends: '/entry/instrument/detector/transformations/some_transformation' for a motion of the detector
</doc>
</attribute>
<field name="AXISNAME" type="NX_NUMBER" nameType="any">
<doc>
Dimension scale defining an axis of the data.
Expand Down Expand Up @@ -354,6 +341,30 @@ AXISNAME_indices documentation copied from datarules.rst
The ``axes`` *group* attribute is now preferred.
</doc>
</attribute>
<attribute name="reference">
<doc>
Points to the path of a field defining the axis to which the ``AXISNAME`` axis refers.

This concept allows to link an axis to a respective field in the NeXus hierarchy, thereby
defining the physical quantity it represents.

Examples:
If a calibration has been performed, ``@reference`` links to the result of
that calibration:

@reference: '/entry/process/calibration/calibrated_axis'

If the axis corresponds to a coordinate of a detector, ``@reference`` links
to that detector axis:

@reference: '/entry/instrument/detector/axis/some_axis' for a 2D detector

If the axis is a scanned motor, ``@reference`` links to the transformation
describing the respective motion, e.g.:

@reference: '/entry/instrument/detector/transformations/some_transformation' for a motion of the detector
</doc>
</attribute>
</field>
<field name="FIELDNAME_errors" type="NX_NUMBER" nameType="any">
<doc>
Expand Down Expand Up @@ -408,6 +419,23 @@ AXISNAME_indices documentation copied from datarules.rst
data label
</doc>
</attribute>
<attribute name="reference">
<doc>
Points to the path of a field defining the data to which the `DATA` field refers.

This concept allows to link the data to a respective field in the NeXus hierarchy, thereby
defining the physical quantity it represents.

Here, *DATA* is to be replaced by the name of each
data field.

Example:
If the data corresponds to a readout of a detector, ``@reference`` links
to that detectors data:

@reference: '/entry/instrument/detector/data' for a 2D detector
</doc>
</attribute>
</field>
<field name="errors" type="NX_NUMBER" deprecated="Use ``DATA_errors`` instead (NIAC2018)">
<doc>
Expand Down
74 changes: 49 additions & 25 deletions base_classes/nyaml/NXdata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,18 @@ NXdata(NXobject):

If there are no axes at all (such as with a stack of images),
the axes attribute can be omitted.
\@reference:
lukaspie marked this conversation as resolved.
Show resolved Hide resolved
doc: |
Points to the path of a field defining the data to which the `DATA` group refers.

This concept allows to link the data to a respective field in the NeXus hierarchy, thereby
defining the physical quantity it represents.

Example:
If the data corresponds to a readout of a detector, ``@reference`` links
to that detectors data:

@reference: '/entry/instrument/detector/data' for a 2D detector
\@AXISNAME_indices:
type: NX_INT

Expand Down Expand Up @@ -238,31 +250,6 @@ NXdata(NXobject):
.. note:: Attributes potentially containing multiple values
(axes and _indices) are to be written as string or integer arrays,
to avoid string parsing in reading applications.
\@AXISNAME_depends:
doc: |
Points to the path of a field defining the axis on which the ``AXISNAME`` axis depends.

This concept allows to link an axis to a respective field in the NeXus hierarchy, thereby
defining the physical quantity it represents.

Here, *AXISNAME* is to be replaced by the name of each
field described in the ``axes`` attribute.

Examples:
If a calibration has been performed, ``@AXISNAME_depends`` links to the result of
that calibration:

@AXISNAME_depends: '/entry/process/calibration/calibrated_axis'

If the axis corresponds to a coordinate of a detector, ``@AXISNAME_depends`` links
to that detector axis:

@AXISNAME_depends: '/entry/instrument/detector/axis/some_axis' for a 2D detector

If the axis is a scanned motor, ``@AXISNAME_depends`` links to the transformation
describing the respective motion, e.g.:

@AXISNAME_depends: '/entry/instrument/detector/transformations/some_transformation' for a motion of the detector
AXISNAME(NX_NUMBER):
nameType: any
doc: |
Expand Down Expand Up @@ -301,6 +288,28 @@ NXdata(NXobject):
N.B. The ``axis`` attribute is the old way of designating a link.
Do not use the ``axes`` attribute with the ``axis`` attribute.
The ``axes`` *group* attribute is now preferred.
\@reference:
doc: |
Points to the path of a field defining the axis to which the ``AXISNAME`` axis refers.

This concept allows to link an axis to a respective field in the NeXus hierarchy, thereby
defining the physical quantity it represents.

Examples:
If a calibration has been performed, ``@reference`` links to the result of
that calibration:

@reference: '/entry/process/calibration/calibrated_axis'

If the axis corresponds to a coordinate of a detector, ``@reference`` links
to that detector axis:

@reference: '/entry/instrument/detector/axis/some_axis' for a 2D detector

If the axis is a scanned motor, ``@reference`` links to the transformation
describing the respective motion, e.g.:

@reference: '/entry/instrument/detector/transformations/some_transformation' for a motion of the detector
FIELDNAME_errors(NX_NUMBER):
nameType: any
doc: |
Expand Down Expand Up @@ -350,6 +359,21 @@ NXdata(NXobject):
\@long_name:
doc: |
data label
\@reference:
doc: |
Points to the path of a field defining the data to which the `DATA` field refers.

This concept allows to link the data to a respective field in the NeXus hierarchy, thereby
defining the physical quantity it represents.

Here, *DATA* is to be replaced by the name of each
data field.

Example:
If the data corresponds to a readout of a detector, ``@reference`` links
to that detectors data:

@reference: '/entry/instrument/detector/data' for a 2D detector
errors(NX_NUMBER):
deprecated: Use ``DATA_errors`` instead (NIAC2018)
doc: |
Expand Down
14 changes: 11 additions & 3 deletions contributed_definitions/NXdata_mpes.nxdl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@
<doc>
Calibrated energy axis.

In an application definition, this could be a link to either
/entry/process/energy_calibration/calibrated_axis or
/entry/process/energy_correction/calibrated_axis.
Could be linked from the respective '@reference' field.
</doc>
<attribute name="type" type="NX_CHAR">
<doc>
Expand All @@ -62,6 +60,16 @@
</item>
</enumeration>
</attribute>
<attribute name="reference">
<doc>
The energy can be dispersed according to different strategies. ``@reference`` points to
the path of a field defining the calibrated axis which the ``energy`` axis refers.

For example:
@reference: 'entry/process/energy_calibration/calibrated_axis'
@reference: 'entry/process/energy_referencing/calibrated_axis'
</doc>
</attribute>
</field>
<field name="kN" type="NX_NUMBER" units="NX_WAVENUMBER">
<doc>
Expand Down
53 changes: 40 additions & 13 deletions contributed_definitions/NXmpes.nxdl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -870,21 +870,48 @@
<doc>
Calibrated energy axis.

This could be a link to either
/entry/process/energy_calibration/calibrated_axis or
/entry/process/energy_correction/calibrated_axis.
Could be linked from the respective '@reference' field.
</doc>
<attribute name="type" recommended="true"/>
<attribute name="type" type="NX_CHAR">
<doc>
The energy can be either stored as kinetic or as binding energy.
</doc>
<enumeration>
<item value="kinetic">
<doc>
Calibrated kinetic energy axis.

In case the kinetic energy axis is referenced to the Fermi level :math:`E_F`
(e.g., in entry/process/energy_referencing), kinetic energies :math:`E` are
provided as :math:`E-E_F`.

This concept is related to term `3.35`_ of the ISO 18115-1:2023 standard.

.. _3.35: https://www.iso.org/obp/ui/en/#iso:std:iso:18115:-1:ed-3:v1:en:term:3.35
</doc>
</item>
<item value="binding">
<doc>
Calibrated binding energy axis.

This concept is related to term `12.16`_ of the ISO 18115-1:2023 standard.

.. _12.16: https://www.iso.org/obp/ui/en/#iso:std:iso:18115:-1:ed-3:v1:en:term:12.16
</doc>
</item>
</enumeration>
</attribute>
<attribute name="reference" type="NX_CHAR" recommended="true">
<doc>
The energy can be dispersed according to different strategies. ``@reference`` points to
the path of a field defining the calibrated axis which the ``energy`` axis refers.

For example:
@reference: 'entry/process/energy_calibration/calibrated_axis'
</doc>
</attribute>
</field>
<attribute name="energy_depends" type="NX_CHAR" optional="true">
<doc>
The energy can be dispersed according to different strategies. ``energy_depends`` points to
the path of a field defining the calibrated axis on which the energy axis depends.

For example:
@energy_depends: 'entry/process/energy_calibration'
</doc>
</attribute>
<attribute name="energy_indices" recommended="true"/>
</group>
</group>
</definition>
67 changes: 35 additions & 32 deletions contributed_definitions/NXmpes_arpes.nxdl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -355,52 +355,55 @@ with higher granularity in the data description.
<attribute name="energy_indices"/>
<attribute name="angular0_indices"/>
<attribute name="angular1_indices"/>
<attribute name="angular0_depends">
<doc>
Points to the path to a field defining the axis on which the angular axis depends.
For example:
@angular0_depends: '/entry/sample/transformations/sample_tilt' for a manipulator angular scan
@angular0_depends: '/entry/instrument/detector/sensor_x' for a 2D detector
@angular0_depends: '/entry/instrument/collectioncolumn/deflector' for a deflector scan
@angular0_depends: '/entry/process/calibration/angular0_calibration/calibrated_axis' for a preprocessed axis.
</doc>
</attribute>
<attribute name="angular1_depends">
<doc>
Points to the path to a field defining the axis on which the angular axis depends.
For example:
@angular1_depends: '/entry/sample/transformations/sample_polar' for a manipulator angular scan
@angular1_depends: '/entry/instrument/detector/sensor_x' for a 2D detector
@angular1_depends: '/entry/instrument/collectioncolumn/deflector' for a deflector scan
@angular1_depends: '/entry/process/calibration/angular1_calibration/calibrated_axis' for a preprocessed axis.
</doc>
</attribute>
<attribute name="energy_depends">
<doc>
Points to the path to a field defining the axis on which the energy axis depends.
For example:
@energy_depends: '/entry/instrument/detector/sensor_y' for a 2D detector
@energy_depends: '/entry/instrument/energydispersion/center_kinetic_energy' for a swept scan
@energy_depends: '/entry/process/calibration/energy_calibration/calibrated_axis' for a preprocessed axis.
</doc>
</attribute>
<field name="energy" type="NX_NUMBER" units="NX_ENERGY">
<doc>
Trace of the energy axis. Could be linked from the respective 'AXISNAME_depends'
Trace of the energy axis. Could be linked from the respective ``@reference``
field.
</doc>
<attribute name="reference" recommended="true">
<doc>
Points to the path of a field defining the calibrated axis which the energy axis refers.

For example:
@reference: '/entry/instrument/detector/sensor_y' for a 2D detector
@reference: '/entry/instrument/energydispersion/center_kinetic_energy' for a swept scan
@reference: '/entry/process/calibration/energy_calibration/calibrated_axis' for a preprocessed axis.
</doc>
</attribute>
</field>
<field name="angular0" type="NX_NUMBER" units="NX_ANGLE">
<doc>
Trace of the first angular axis. Could be linked from the respective
'AXISNAME_depends' field.
``@reference`` field.
</doc>
<attribute name="reference" recommended="true">
<doc>
Points to the path of a field defining the calibrated axis which the ``angular0`` axis refers.

For example:
@reference: '/entry/sample/transformations/sample_tilt' for a manipulator angular scan
@reference: '/entry/instrument/detector/sensor_x' for a 2D detector
@reference: '/entry/instrument/collectioncolumn/deflector' for a deflector scan
@reference: '/entry/process/calibration/angular0_calibration/calibrated_axis' for a preprocessed axis.
</doc>
</attribute>
</field>
<field name="angular1" type="NX_NUMBER" units="NX_ANGLE">
<doc>
Trace of the second axis. Could be linked from the respective 'AXISNAME_depends'
Trace of the second axis. Could be linked from the respective ``@reference``
field.
</doc>
<attribute name="reference" recommended="true">
<doc>
Points to the path of a field defining the calibrated axis which the ``angular1`` axis refers.

For example:
@reference: '/entry/sample/transformations/sample_polar' for a manipulator angular scan
@reference: '/entry/instrument/detector/sensor_y' for a 2D detector
@reference: '/entry/instrument/collectioncolumn/deflector' for a deflector scan
@reference: '/entry/process/calibration/angular1_calibration/calibrated_axis' for a preprocessed axis.
</doc>
</attribute>
</field>
<field name="data" type="NX_NUMBER" units="NX_ANY">
<doc>
Expand Down
Loading
Loading