Skip to content

Commit

Permalink
Merge pull request #558 from nexusformat/schema_update_555
Browse files Browse the repository at this point in the history
XML Schema version 3.3 now
  • Loading branch information
prjemian authored May 2, 2017
2 parents 264117c + b459b66 commit 4aa4215
Show file tree
Hide file tree
Showing 7 changed files with 460 additions and 103 deletions.
2 changes: 1 addition & 1 deletion NXDL_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.2
3.3
83 changes: 42 additions & 41 deletions base_classes/NXtransformations.nxdl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://definition.nexusformat.org/nxdl/3.1 ../nxdl.xsd"
>
<!--
nxdl.xsd rules do not allow us to show this as a variable name
- we'll use AXISNAME in ALL CAPS for consistency with the
use in NXDATA. We'll use ``AXISUNITS`` for the units appropriate
to the type of axis.
-->


<doc>
Collection of axis-based translations and rotations to describe a geometry.
May also contain axes that do not move and therefore do not have a transformation
Expand All @@ -49,62 +43,64 @@

A nested sequence of transformations lists the offset and rotation steps
needed to describe the position and orientation of any movable or fixed device.

There will be one or more transformations (axes) defined by one or more fields
for each transformation. The all-caps name ``AXISNAME`` designates the
particular axis generating a transformation (e.g. a rotation axis or a translation
axis or a general axis). The all-caps name ``AXISUNITS`` designates the
units appropriate to the transformation_type value, i.e. ``NX_LENGTH`` for
``translation``, ``NX_ANGLE`` for ``rotation``, and ``NX_UNITLESS`` for
axes for which no transformation type is specified.

axis or a general axis). The attribute ``units="NX_TRANSFORMATION"`` designates the
units will be appropriate to the ``transformation_type`` attribute:

* ``NX_LENGTH`` for ``translation``
* ``NX_ANGLE`` for ``rotation``
* ``NX_UNITLESS`` for axes for which no transformation type is specified

This class will usually contain all axes of a sample stage or goniometer or
a detector. The NeXus default McSTAS coordinate frame is assumed, but additional
useful coordinate axes may be defined by using axes for which no transformation
type has been specified.

The entry point (``depends_on``) will be outside of this class and point to a
field in here. Following the chain may also require following ``depends_on``
links to transformations outside, for example to a common base table. If
a relative path is given, it is relative to the group enclosing the ``depends_on``
specification.

For a chain of three transformations, where :math:`T_1` depends on :math:`T_2`
and that in turn depends on :math:`T_3`, the final transformation :math:`T_f` is

.. math::

T_f = T_3 T_2 T_1

T_f = T_3 T_2 T_1
In explicit terms, the transformations are a subset of affine transformations
expressed as 4x4 matrices that act on homogeneous coordinates, :math:`w=(x,y,z,1)^T`.

For rotation and translation,

.. math::

T_r &amp;= \left( \begin{matrix} R &amp; o \\
0_3 &amp; 1 \end{matrix} \right) \\
T_t &amp;= \left( \begin{matrix} I_3 &amp; t + o \\
0_3 &amp; 1 \end{matrix} \right)

.. math::
T_r &amp;= \left( \begin{matrix} R &amp; o \\
0_3 &amp; 1 \end{matrix} \right) \\
T_t &amp;= \left( \begin{matrix} I_3 &amp; t + o \\
0_3 &amp; 1 \end{matrix} \right)
where :math:`R` is the usual 3x3 rotation matrix, :math:`o` is an offset vector,
:math:`0_3` is a row of 3 zeros, :math:`I_3` is the 3x3 identity matrix and
:math:`t` is the translation vector.

:math:`o` is given the ``offset`` attribute, :math:`t` is given by the ``vector``
attribute multiplied by the field value, and :math:`R` is defined as a rotation
about an axis in the direction of ``vector``, of angle of the field value.
</doc>
<field name="AXISNAME" nameType="any" units="AXISUNITS" type="NX_NUMBER" maxOccurs="unbounded">
<field name="AXISNAME" nameType="any" units="NX_TRANSFORMATION" type="NX_NUMBER" maxOccurs="unbounded">
<doc>
Units need to be appropriate for translation or rotation

The name of this field is not forced. The user is free to use any name
that does not cause confusion. When using more than one ``AXISNAME`` field,
make sure that each field name is unique in the same group, as required
by HDF5.

The values given should be the start points of exposures for the corresponding
frames. The end points should be given in ``AXISNAME_end``.
</doc>
Expand All @@ -113,15 +109,16 @@
The transformation_type may be ``translation``, in which case the
values are linear displacements along the axis, ``rotation``,
in which case the values are angular rotations around the axis.

If this attribute is omitted, this field does not specify a transformation
of an object, but is used to document a general axis or direction,
such as the direction of gravity, or of the source.
As such it cannot be used in a depends_on transformation chain.
If this attribute is omitted, this is an axis for which there
is no motion to be specifies, such as the direction of gravity,
or the direction to the source, or a basis vector of a
coordinate frame.
</doc>
<enumeration>
<item value="translation" />
<item value="rotation" />
<!-- <item value="general" /> -->
</enumeration>
</attribute>
<attribute name="vector" type="NX_NUMBER">
Expand All @@ -133,13 +130,17 @@
For ``translation`` axes the direction should be chosen for
increasing displacement.
</doc>
<dimensions rank="1" value="3" />
<dimensions rank="1">
<dim index="1" value="3" />
</dimensions>
</attribute>
<attribute name="offset" type="NX_NUMBER">
<doc>
A fixed offset applied before the transformation (three vector components).
</doc>
<dimensions rank="1" value="3" />
<dimensions rank="1">
<dim index="1" value="3" />
</dimensions>
</attribute>
<attribute name="offset_units" type="NX_CHAR">
<doc>
Expand All @@ -153,20 +154,20 @@
</doc>
</attribute>
</field>
<field name="AXISNAME_end" units="AXISUNITS" nameType="any" type="NX_NUMBER" minOccurs="0">
<field name="AXISNAME_end" units="NX_TRANSFORMATION" nameType="any" type="NX_NUMBER" minOccurs="0">
<doc>
``AXISNAME_end`` is a placeholder for a name constructed from the actual
name of an axis to which ``_end`` has been appended.

The values in this field are the end points of the motions that start
at the corresponding positions given in the ``AXISNAME`` field.
</doc>
</field>
<field name="AXISNAME_increment_set" units="AXISUNITS" nameType="any" type="NX_NUMBER" minOccurs="0">
<field name="AXISNAME_increment_set" units="NX_TRANSFORMATION" nameType="any" type="NX_NUMBER" minOccurs="0">
<doc>
``AXISNAME_increment_set`` is a placeholder for a name constructed from the actual
name of an axis to which ``_increment_set`` has been appended.

The value of this optional field is the intended average range through which
the corresponding axis moves during the exposure of a frame. Ideally, the
value of this field added to each value of ``AXISNAME`` would agree with the
Expand Down
4 changes: 2 additions & 2 deletions manual/source/community.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ code are always welcome!
.. _community.Contributed.Definitions:

Contributed Definitions
========================
=======================

The community is encouraged to provide new definitions
(:ref:`base.class.definitions` or :ref:`application.definitions`) for consideration
Expand All @@ -59,7 +59,7 @@ will be entered in the :ref:`contributed.definitions`
and will be curated according to procedures set forth by the :ref:`NIAC`.

Other Ways NeXus Coordinates with the Scientific Community
============================================================
==========================================================

.. toctree::
:maxdepth: 1
Expand Down
8 changes: 6 additions & 2 deletions manual/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,14 +216,18 @@
# If true, show URL addresses after external links.
#latex_show_urls = False

# Additional stuff for the LaTeX preamble.
latex_preamble = '''
# Additional stuff for the LaTeX preamble_text.
preamble_text = '''
% 2012-09-25,PRJ: #240 temporary diagnostic
\\listfiles
% when done, remove referencing from index.rst and cp from Makefile: latexpdf
\usepackage{enumitem}
\setlistdepth{9}
'''
latex_elements = {
'preamble_text': preamble_text # the new way
}
#latex_preamble = preamble_text # the old way

# Documents to append as an appendix to all manuals.
#latex_appendices = []
Expand Down
7 changes: 7 additions & 0 deletions nxdl.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,13 @@
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="dimensions" type="nx:dimensionsType" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation>
dimensions of an attribute with data value(s) in a NeXus file
</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
<xs:attribute name="name" use="required" type="nx:validItemName">
<xs:annotation>
Expand Down
Loading

0 comments on commit 4aa4215

Please sign in to comment.