Skip to content

Commit

Permalink
change quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
woutdenolf committed Jul 17, 2024
1 parent 6a014b5 commit 115e631
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions base_classes/NXdata.nxdl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@

**Axes examples:**

`1. Single-dimensional axes`
``1. Single-dimensional axes``

:ref:`AXISNAME </NXdata/AXISNAME-field>` fields are typically one-dimensional arrays that span a single :ref:`DATA </NXdata/DATA-field>` dimension.

Expand All @@ -136,9 +136,9 @@

In this example each data point ``data[i,j]`` has axis coordinates ``[x[i], y[j]]``.

Note that `@x_indices` and `@y_indices` attributes can be omitted in this case. However it is strongly encouraged to provide them.
Note that ``@x_indices`` and ``@y_indices`` attributes can be omitted in this case. However it is strongly encouraged to provide them.

`2. Data dimensions spanned by more than one axis`
``2. Data dimensions spanned by more than one axis``

A common case is the need to specify alternative axes for the same dimension

Expand All @@ -155,11 +155,11 @@
tth: float[20] --> coordinates along the second dimension (alternative)
q: float[20] --> coordinates along the second dimension (default)

Note that to recognize `tth` as an axis, `@tth_indices` must be present. Readers that do
not make used of the :ref:`AXISNAME_indices </NXdata@AXISNAME_indices-attribute>` attributes will
not understand that `tth` is an axis and cannot take this field into account.
Note that to recognize ``tth`` as an axis, ``@tth_indices`` must be present. Readers that do
not make use of the :ref:`AXISNAME_indices </NXdata@AXISNAME_indices-attribute>` attributes will
not understand that ``tth`` is an axis and cannot take this field into account.

`3. Multi-dimensional axes`
``3. Multi-dimensional axes``

When coordinates do not form a regular grid, multi-dimensional :ref:`AXISNAME </NXdata/AXISNAME-field>` fields
can be used. Just remember that the shape of an :ref:`AXISNAME </NXdata/AXISNAME-field>` field must be equal to the shape
Expand All @@ -179,13 +179,13 @@
y: float[10,20] --> coordinates along both dimensions

In this example each data point ``data[i,j]`` has axis coordinates ``[x[i,j], y[i,j]]`` and when
plotting, `x` is used along the first data dimension by default and `y` along the second data dimension.
Since `x` and `y` span both dimensions, a reader could choose to use `y` for the first dimension
and `x` for the second as an alternative to the default. A writer could also choose to not specify
any default by defining `@axes = [".", "."]` and leave the decision up the the reader.
plotting, ``x`` is used along the first data dimension by default and `y` along the second data dimension.
Since ``x`` and ``y`` span both dimensions, a reader could choose to use ``y`` for the first dimension
and ``x`` for the second as an alternative to the default. A writer could also choose to not specify
any default by defining ``@axes = [".", "."]`` and leave the decision up the the reader.

Note that omitting `@x_indices` would result in `@x_indices = [0]` as derived from the position of `"x"` in `@axes`.
This would be invalid since the shape `[10,20]` of `x` is not equal to the shape `[10]` of the spanned data dimensions.
Note that omitting ``@x_indices`` would result in ``@x_indices = [0]`` as derived from the position of the string ``"x"`` in ``@axes``.
This would be invalid since the shape ``[10,20]`` of ``x`` is not equal to the shape ``[10]`` of the spanned data dimensions.

Omitting indices for multi-dimensional axes can only be done by repeating the :ref:`AXISNAME </NXdata/AXISNAME-field>`
name in all positions of the :ref:`axes </NXdata@axes-attribute>` attribute which they span. For example
Expand All @@ -202,7 +202,7 @@
a reader would probably treat this particular example as a 1D signal and plot it as such.

In the case of multi-dimensional axes, single-dimensional axes are often introduced as default axes
to support readers that does not use the :ref:`AXISNAME_indices </NXdata@AXISNAME_indices-attribute>` attributes
to support readers that do not make use of the :ref:`AXISNAME_indices </NXdata@AXISNAME_indices-attribute>` attributes
or cannot handle multi-dimensional axes.

The 2D scatter example can be enriched as follows
Expand All @@ -222,12 +222,12 @@
x_set: float[10] --> coordinates along the first dimension
y_set: float[20] --> coordinates along the second dimension

The first dimension is spanned by three axes: `x`, `y` and `x_set`. The second dimension is also
spanned by three axes: `x`, `y` and `y_set`.
The first dimension is spanned by three axes: ``x``, ``y`` and ``x_set``. The second dimension is also
spanned by three axes: ``x``, ``y`` and ``y_set``.

Technically `@x_set_indices` and `@y_set_indices` can be omitted. However it is strongly encouraged to provide them.
Technically ``@x_set_indices`` and ``@y_set_indices`` can be omitted. However it is strongly encouraged to provide them.

`4. Axes without defaults`
``4. Axes without defaults``

Expanding on the 2D scatter example, a stack of 2D scatter data where the stack dimension
does not have an axis can be described as follows
Expand Down

0 comments on commit 115e631

Please sign in to comment.