From cc1ead2c320616c7b29a09c0fe69f7c2a54c0156 Mon Sep 17 00:00:00 2001 From: Pete R Jemian Date: Mon, 7 Mar 2022 14:37:34 -0600 Subject: [PATCH 01/23] MNT #1003 remove paths from example writer --- manual/source/examples/epics/write_nexus_file.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manual/source/examples/epics/write_nexus_file.py b/manual/source/examples/epics/write_nexus_file.py index 1dd61bafb..dba239461 100755 --- a/manual/source/examples/epics/write_nexus_file.py +++ b/manual/source/examples/epics/write_nexus_file.py @@ -25,7 +25,7 @@ def write_nexus_file(fname, image, md={}): # /entry nxentry = nexus.create_group("entry") nxentry.attrs["NX_class"] = "NXentry" - nexus.attrs["default"] = nxentry.name + nexus.attrs["default"] = nxentry.name.split("/")[-1] # /entry/instrument nxinstrument = nxentry.create_group("instrument") @@ -43,7 +43,7 @@ def write_nexus_file(fname, image, md={}): # /entry/data nxdata = nxentry.create_group("data") nxdata.attrs["NX_class"] = "NXdata" - nxentry.attrs["default"] = nxdata.name + nxentry.attrs["default"] = nxdata.name.split("/")[-1] # /entry/data/data --> /entry/instrument/detector/image nxdata["data"] = nexus["/entry/instrument/detector/image"] From 44a1a5d3d031272d30da1e22b85a27014303ae4b Mon Sep 17 00:00:00 2001 From: Pete R Jemian Date: Mon, 7 Mar 2022 14:37:56 -0600 Subject: [PATCH 02/23] DOC #1003 revised example --- manual/source/examples/epics/example.h5 | Bin 18176 -> 51280 bytes .../source/examples/epics/tree_structure.txt | 68 +++++++++--------- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/manual/source/examples/epics/example.h5 b/manual/source/examples/epics/example.h5 index 60a12c6982d0f95fc624d0cb5f68e55e503c14a3..c82af78e6202ccaf18a2f3b39bbf37ec3adf8119 100755 GIT binary patch literal 51280 zcmeHQ4{#LK8Q)7t$X^o#lpvTBL_?I^L4rikTr8$U5E9X1l!4<6C%KY8YjP>rGnY+> z1QjKAurk$3kU^kKB>v4h7%qRRA`B&#a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w+}DR1s3i|giNl+hY$uocOQ&3afAA=oB%D;`a*p80(kx5lAe)k|R8x+{-Ny~n zIBS-s#-`1JX&^LRoHNGC2%RaKXG_J2vCj*i&JZ&#eR9SaD~>Zq8#l}PLTt`ML}(Y2 z>O;Zu?Lfnn9yl*{ICEHkcFk}pqF@gkNFNvN=HoKNlP!C;Hyfd9&AN5P?G$~}EJAVtG z?nG$$l{_mh_&tpch=jJ+8r;wHau?DyD+tw$#H|bx$(v=T8^?$yYfO6vlbO!iN*SuE z1X}t-R&nLOEB=Z>+hxD~2 /entry/instrument/detector/image - instrument:NXinstrument - @NX_class = NXinstrument - detector:NXdetector - @NX_class = NXdetector - image:NX_UINT8[40,30] = __array - __array = [ - [48, 80, 112, '...', 208] - [240, 16, 48, '...', 176] - [208, 240, 16, '...', 144] - ... - [16, 48, 80, '...', 176] - ] - @units = counts - @target = /entry/instrument/detector/image - metadata:NXcollection - @NX_class = NXcollection - bitcoin_value:NX_CHAR = 15000 - detector_state:NX_INT64[] = - size_x:NX_INT64[] = - size_y:NX_INT64[] = - unique_id:NX_INT64[] = +example.h5 : NeXus data file + @H5PY_VERSION = "3.6.0" + @creator = "write_nexus_file()" + @default = "entry" + @file_time = "2022-03-07 14:34:04.418733" + @filename = "example.h5" + entry:NXentry + @NX_class = "NXentry" + @default = "data" + data:NXdata + @NX_class = "NXdata" + @signal = "data" + data --> /entry/instrument/detector/image + instrument:NXinstrument + @NX_class = "NXinstrument" + detector:NXdetector + @NX_class = "NXdetector" + image:NX_UINT8[1024,1024] = __array + __array = [ + [76, 77, 78, '...', 75] + [77, 78, 79, '...', 76] + [78, 79, 80, '...', 77] + ... + [75, 76, 77, '...', 74] + ] + @target = "/entry/instrument/detector/image" + @units = "counts" + metadata:NXcollection + @NX_class = "NXcollection" + bitcoin_value:NX_CHAR = b'15000' + detector_state:NX_INT64[] = + size_x:NX_INT64[] = + size_y:NX_INT64[] = + unique_id:NX_INT64[] = From 66d9168db457e06b345efcb4cbc38c1946e6a8f9 Mon Sep 17 00:00:00 2001 From: Pete R Jemian Date: Mon, 7 Mar 2022 16:48:21 -0600 Subject: [PATCH 03/23] DOC #1003 wording and indices --- base_classes/NXdata.nxdl.xml | 18 +- base_classes/NXentry.nxdl.xml | 66 +++-- base_classes/NXroot.nxdl.xml | 32 ++- base_classes/NXsubentry.nxdl.xml | 8 +- manual/source/datarules.rst | 458 ++++++++++++++++--------------- 5 files changed, 306 insertions(+), 276 deletions(-) diff --git a/base_classes/NXdata.nxdl.xml b/base_classes/NXdata.nxdl.xml index 1de87136a..d0ebc6b47 100644 --- a/base_classes/NXdata.nxdl.xml +++ b/base_classes/NXdata.nxdl.xml @@ -64,12 +64,16 @@ + .. index:: find the default plottable data .. index:: plotting + .. index:: signal attribute value - Declares which dataset is the default. - The value is the name of the dataset to be plotted. - A field of this name *must* exist (either as dataset - or as a link to a dataset). + Declares which NeXus field (HDF5 dataset) is the default. + The value is the name of the NeXus field to be plotted. + A field of this name *must* exist (either as a NeXus field + or as a link to a NeXus field). + The value must match the :ref:`regular expression pattern for NXDL + group and field names <validItemName>`. It is recommended (as of NIAC2014) to use this attribute rather than adding a signal attribute to the dataset. @@ -191,7 +195,7 @@ mr: float[100] --> the default independent data The field named in the ``signal`` attribute **must** exist, either - directly as a dataset or defined through a link. + directly as a NeXus field (HDF5 dataset) or defined through a link. * The group ``axes`` attribute will name the *dimension scale* associated with the plottable data. @@ -308,9 +312,9 @@ This pattern of using ``VARIABLE_errors`` can be used throughout a NeXus data file to associate uncertainties - with a dataset named ``VARIABLE``. This pattern also + with a field named ``VARIABLE``. This pattern also applies to other relationships such as ``VARIABLE_resolutions`` - to connect additional data with a certain dataset. + to connect additional data with a certain field. diff --git a/base_classes/NXentry.nxdl.xml b/base_classes/NXentry.nxdl.xml index d548e5f8e..511ca4cd7 100644 --- a/base_classes/NXentry.nxdl.xml +++ b/base_classes/NXentry.nxdl.xml @@ -2,9 +2,9 @@ - + .. index:: find the default plottable data .. index:: plotting + .. index:: default attribute value Declares which :ref:`NXdata` group contains the data to be shown by default. It is needed to resolve ambiguity when more than one :ref:`NXdata` group exists. - The value is the name of the default :ref:`NXdata` group. + The value is the name of the default :ref:`NXdata` group, which + must be the name of a child of the current group and that child must be a NeXus + group or a link to a NeXus group. The value must match the + :ref:`regular expression pattern for NXDL group and field names + <validItemName>`. For more information about how NeXus identifies the default plottable data, see the @@ -46,41 +52,41 @@ section. - + - (**required**) :ref:`NXentry` describes the measurement. - + (**required**) :ref:`NXentry` describes the measurement. + The top-level NeXus group which contains all the data and associated - information that comprise a single measurement. + information that comprise a single measurement. It is mandatory that there is at least one group of this type in the NeXus file. - + The data group - + .. note:: Before the NIAC2016 meeting [#]_, at least one :ref:`NXdata` group was required in each :ref:`NXentry` group. - At the NIAC2016 meeting, it was decided to make :ref:`NXdata` - an optional group in :ref:`NXentry` groups for data files that + At the NIAC2016 meeting, it was decided to make :ref:`NXdata` + an optional group in :ref:`NXentry` groups for data files that do not use an application definition. - It is recommended strongly that all NeXus data files provide - a NXdata group. - It is permissable to omit the NXdata group only when + It is recommended strongly that all NeXus data files provide + a NXdata group. + It is permissable to omit the NXdata group only when defining the default plot is not practical or possible from the available data. - - For example, neutron event data may not have anything that + + For example, neutron event data may not have anything that makes a useful plot without extensive processing. - + Certain application definitions override this decision and require an :ref:`NXdata` group in the :ref:`NXentry` group. The ``minOccurs=0`` attribute - in the application definition will indicate the + in the application definition will indicate the :ref:`NXdata` group is optional, otherwise, it is required. - - .. [#] NIAC2016: + + .. [#] NIAC2016: https://www.nexusformat.org/NIAC2016.html, https://github.com/nexusformat/NIAC/issues/16 @@ -96,8 +102,8 @@ - Unique identifier for the experiment, - defined by the facility, + Unique identifier for the experiment, + defined by the facility, possibly linked to the proposals @@ -130,13 +136,13 @@ (alternate use: see same field in :ref:`NXsubentry` for preferred) - + Official NeXus NXDL schema to which this entry conforms. - + This field is provided so that :ref:`NXentry` can be the overlay position - in a NeXus data file for an application definition and its + in a NeXus data file for an application definition and its set of groups, fields, and attributes. - + *It is advised* to use :ref:`NXsubentry`, instead, as the overlay position. NXDL version number @@ -145,7 +151,7 @@ Local NXDL schema extended from the entry - specified in the ``definition`` field. + specified in the ``definition`` field. This contains any locally-defined, additional fields in the entry. @@ -202,7 +208,7 @@ The mime type should be an ``image/*`` - diff --git a/base_classes/NXroot.nxdl.xml b/base_classes/NXroot.nxdl.xml index 04e10823d..2cbadef28 100644 --- a/base_classes/NXroot.nxdl.xml +++ b/base_classes/NXroot.nxdl.xml @@ -2,9 +2,9 @@ - These symbols will be used below to coordinate datasets with the same shape. + These symbols will be used below to coordinate fields with the same shape. rank of the ``DATA`` field length of the ``VARIABLE`` field length of the ``x`` field @@ -68,7 +68,7 @@ .. index:: plotting .. index:: signal attribute value - Declares which NeXus field (HDF5 dataset) is the default. + Declares which NeXus field is the default. The value is the name of the NeXus field to be plotted. A field of this name *must* exist (either as a NeXus field or as a link to a NeXus field). @@ -76,7 +76,7 @@ group and field names <validItemName>`. It is recommended (as of NIAC2014) to use this attribute - rather than adding a signal attribute to the dataset. + rather than adding a signal attribute to the field. See https://www.nexusformat.org/2014_How_to_find_default_data.html for a summary of the discussion. @@ -128,7 +128,7 @@ Integer array that defines the indices of the *signal* field (that field will be a multidimensional array) - which need to be used in the *AXISNAME* dataset in + which need to be used in the *AXISNAME* field in order to reference the corresponding axis value. The first index of an array is ``0`` (zero). @@ -198,7 +198,7 @@ mr: float[100] --> the default independent data The field named in the ``signal`` attribute **must** exist, either - directly as a NeXus field (HDF5 dataset) or defined through a link. + directly as a NeXus field or defined through a link. * The group ``axes`` attribute will name the *dimension scale* associated with the plottable data. From cdc40658e7bcb357c3ee411fb92cc0e13d904aec Mon Sep 17 00:00:00 2001 From: Pete R Jemian Date: Mon, 13 Jun 2022 15:56:12 -0500 Subject: [PATCH 10/23] DOC #1003 "field", not "dataset" --- manual/source/datarules.rst | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/manual/source/datarules.rst b/manual/source/datarules.rst index 98da4f670..f5993c07e 100644 --- a/manual/source/datarules.rst +++ b/manual/source/datarules.rst @@ -216,7 +216,7 @@ prefix use meaning URL .. rubric:: Reserved suffixes -When naming a field (or dataset), NeXus has reserved certain suffixes to the names +When naming a field, NeXus has reserved certain suffixes to the names so that a specific meaning may be attached. Consider a field named ``DATASET``, the following table lists the suffixes reserved by NeXus. @@ -241,7 +241,7 @@ suffix reference meaning ``_weights`` .. divide ``DATASET`` by these weights [#]_ ================== ========================================= ================================= -.. [#] If ``DATASET_weights`` exists and has the same shape as the dataset, +.. [#] If ``DATASET_weights`` exists and has the same shape as the field, you are supposed to divide ``DATASET`` by the weights. .. Note that the following line might be added to the above table pending discussion: @@ -255,15 +255,15 @@ suffix reference meaning Variants ######### -Sometimes it is necessary to store alternate values of a NeXus dataset +Sometimes it is necessary to store alternate values of a NeXus field in a NeXus file. A common example may be the beam center of which a rough value is available at data acquisition. But later on, a better beam center is calculated as part of the data reduction. In order to store this without losing the historical information, the original field can be given a variant attribute that points to -a new dataset containing the obsolete value. If even better values -become available, further datasets can be inserted into the chain of variant attributes -pointing to the preceeding value for the dataset. A reader can thus -keep the best value in the pre-defined dataset, and also be able to +a new field containing the obsolete value. If even better values +become available, further fields can be inserted into the chain of variant attributes +pointing to the preceeding value for the field. A reader can thus +keep the best value in the pre-defined field, and also be able to follow the variant chain and locate older variants. A little example is in order to illustrate the scheme: @@ -278,7 +278,7 @@ A little example is in order to illustrate the scheme: beam_center_x_initial_guess NeXus borrowed this scheme from CIF. In this way all the different -variants of a dataset can be preserved. The expectation is that +variants of a field can be preserved. The expectation is that variants will be rarely used and NXprocess groups with the results of data reduction will be written instead. @@ -705,7 +705,7 @@ plottable data is as follows: #. Pick the default plottable field (the *signal* data). Open the ``NXdata`` group selected above. If it has a ``signal`` attribute, - the attribute's value is the name of the field (dataset) to be plotted. + the attribute's value is the name of the field to be plotted. (The value of the ``signal`` attribute :ref:`names ` an existing child of this group. The child group must itself be a NeXus field.) If no ``signal`` attribute is present on the ``NXdata`` @@ -774,8 +774,8 @@ Python code example will identify directly the default plottable data group = group[child_group_name] # assumes group.attrs["NX_class"] == "NXdata" - signal_dataset_name = group.attrs["signal"] - data = group[signal_dataset_name] + signal_field_name = group.attrs["signal"] + data = group[signal_field_name] plot(data) @@ -838,12 +838,12 @@ plottable data is as follows: associated with the plottable data. Such as: ``axes="polar_angle:time_of_flight"`` - #. Parse ``axes`` and open the datasets to describe your + #. Parse ``axes`` and open the fields to describe your :index:`dimension scales ` #. If this field has no attribute ``axes``: - #. Search for datasets with attributes ``axis=1``, ``axis=2``, etc. + #. Search for fields with attributes ``axis=1``, ``axis=2``, etc. #. These are the fields describing your axis. There may be several fields for any axis, i.e. there may be multiple @@ -989,11 +989,11 @@ The default data to be plotted (and any associated axes) is specified using attributes attached to the :ref:`NXdata` group. :``signal``: - Defines the name of the default dataset *in the NXdata group*. - A field of this name *must* exist (either as dataset or link to dataset). + Defines the name of the default field *in the NXdata group*. + A field of this name *must* exist (either as field or link to field). It is recommended to use this attribute - rather than adding a signal attribute to the dataset. [#]_ + rather than adding a signal attribute to the field. [#]_ The procedure to identify the default data to be plotted is quite simple. Given any NeXus data file, any ``NXentry``, or any ``NXdata``, follow the chain as it is described from that point. @@ -1044,7 +1044,7 @@ is specified using attributes attached to the :ref:`NXdata` group. Integer array [#aa]_ that defines the indices of the *signal* field (that field will be a multidimensional array) - which need to be used in the ``AXISNAME`` dataset in + which need to be used in the ``AXISNAME`` field in order to reference the corresponding axis value. The first index of an array is ``0`` (zero). From 4c5d50e1ff1295c542e02e933a24be40042fd88c Mon Sep 17 00:00:00 2001 From: Pete R Jemian Date: Mon, 13 Jun 2022 15:59:56 -0500 Subject: [PATCH 11/23] DOC #1033 consistent with 3368cb2 --- base_classes/NXdata.nxdl.xml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/base_classes/NXdata.nxdl.xml b/base_classes/NXdata.nxdl.xml index 5be186631..6b5f86f9f 100644 --- a/base_classes/NXdata.nxdl.xml +++ b/base_classes/NXdata.nxdl.xml @@ -70,10 +70,8 @@ Declares which NeXus field is the default. The value is the name of the NeXus field to be plotted. - A field of this name *must* exist (either as a NeXus field - or as a link to a NeXus field). - The value must match the :ref:`regular expression pattern for NXDL - group and field names <validItemName>`. + (The value :ref:`names ` an existing child + of this group. The child group must itself be a NeXus group.) It is recommended (as of NIAC2014) to use this attribute rather than adding a signal attribute to the field. From 2106468c3f1ec53c3893611b76331ae1855d7087 Mon Sep 17 00:00:00 2001 From: Pete R Jemian Date: Mon, 13 Jun 2022 16:11:36 -0500 Subject: [PATCH 12/23] DOC #1003 per review --- base_classes/NXentry.nxdl.xml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/base_classes/NXentry.nxdl.xml b/base_classes/NXentry.nxdl.xml index 511ca4cd7..b193c5957 100644 --- a/base_classes/NXentry.nxdl.xml +++ b/base_classes/NXentry.nxdl.xml @@ -40,11 +40,9 @@ to be shown by default. It is needed to resolve ambiguity when more than one :ref:`NXdata` group exists. - The value is the name of the default :ref:`NXdata` group, which - must be the name of a child of the current group and that child must be a NeXus - group or a link to a NeXus group. The value must match the - :ref:`regular expression pattern for NXDL group and field names - <validItemName>`. + The value :ref:`names ` a child group. If that group + itself has a ``default`` attribute, continue this chain until an + :ref:`NXdata` group is reached. For more information about how NeXus identifies the default plottable data, see the From 67c4ea77b11d091b0d74c37df147212eb6b695f1 Mon Sep 17 00:00:00 2001 From: Pete R Jemian Date: Mon, 13 Jun 2022 16:15:46 -0500 Subject: [PATCH 13/23] DOC #1003 per review suggestion --- base_classes/NXroot.nxdl.xml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/base_classes/NXroot.nxdl.xml b/base_classes/NXroot.nxdl.xml index 2cbadef28..389d10169 100644 --- a/base_classes/NXroot.nxdl.xml +++ b/base_classes/NXroot.nxdl.xml @@ -89,13 +89,11 @@ Declares which :ref:`NXentry` group contains the data to be shown by default. - It is needed to resolve ambiguity when + It is used to resolve ambiguity when more than one :ref:`NXentry` group exists. - The value is the name of the default :ref:`NXentry` group. The - value must be the name of a child of the current group and that child must be a - NeXus group or a link to a NeXus group. The value must match the - :ref:`regular expression pattern for NXDL group and field names - <validItemName>`. + The value :ref:`names ` the default :ref:`NXentry` group. The + value must be the name of a child of the current group. The child must be a + NeXus group or a link to a NeXus group. It is recommended (as of NIAC2014) to use this attribute to help define the path to the default dataset to be plotted. From 0c86f8316fc2a9ebe63054e96d6e2e7173a4a8cd Mon Sep 17 00:00:00 2001 From: Pete R Jemian Date: Mon, 13 Jun 2022 16:18:47 -0500 Subject: [PATCH 14/23] DOC #1003 similar wording --- base_classes/NXentry.nxdl.xml | 2 +- base_classes/NXsubentry.nxdl.xml | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/base_classes/NXentry.nxdl.xml b/base_classes/NXentry.nxdl.xml index b193c5957..2c1aea94b 100644 --- a/base_classes/NXentry.nxdl.xml +++ b/base_classes/NXentry.nxdl.xml @@ -38,7 +38,7 @@ Declares which :ref:`NXdata` group contains the data to be shown by default. - It is needed to resolve ambiguity when more than + It is used to resolve ambiguity when one :ref:`NXdata` group exists. The value :ref:`names ` a child group. If that group itself has a ``default`` attribute, continue this chain until an diff --git a/base_classes/NXsubentry.nxdl.xml b/base_classes/NXsubentry.nxdl.xml index 3350ab80c..73e89d254 100644 --- a/base_classes/NXsubentry.nxdl.xml +++ b/base_classes/NXsubentry.nxdl.xml @@ -38,13 +38,11 @@ Declares which :ref:`NXdata` group contains the data to be shown by default. - It is needed to resolve ambiguity when more than + It is used to resolve ambiguity when one :ref:`NXdata` group exists. - The value is the name of the default :ref:`NXdata` group, which - must be the name of a child of the current group and that child must - be a :ref:`NXdata` group or a link to a :ref:`NXdata` group. The - value must match the :ref:`regular expression pattern for NXDL group - and field names <validItemName>`. + The value :ref:`names ` the default :ref:`NXentry` group. The + value must be the name of a child of the current group. The child must be a + NeXus group or a link to a NeXus group. For more information about how NeXus identifies the default plottable data, see the From 588543048b53cfb91538a672ab2b4c92e292a83e Mon Sep 17 00:00:00 2001 From: Ben Watts Date: Tue, 14 Jun 2022 00:05:16 +0200 Subject: [PATCH 15/23] fix indentation --- base_classes/NXentry.nxdl.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base_classes/NXentry.nxdl.xml b/base_classes/NXentry.nxdl.xml index 2c1aea94b..b4b530cd9 100644 --- a/base_classes/NXentry.nxdl.xml +++ b/base_classes/NXentry.nxdl.xml @@ -38,7 +38,7 @@ Declares which :ref:`NXdata` group contains the data to be shown by default. - It is used to resolve ambiguity when + It is used to resolve ambiguity when one :ref:`NXdata` group exists. The value :ref:`names ` a child group. If that group itself has a ``default`` attribute, continue this chain until an From 4a6eabc881a5d03b662b9414cc92f8fadb876a27 Mon Sep 17 00:00:00 2001 From: Ben Watts Date: Tue, 14 Jun 2022 00:16:40 +0200 Subject: [PATCH 16/23] replace '<' with '<' --- base_classes/NXdata.nxdl.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base_classes/NXdata.nxdl.xml b/base_classes/NXdata.nxdl.xml index 6b5f86f9f..136307c00 100644 --- a/base_classes/NXdata.nxdl.xml +++ b/base_classes/NXdata.nxdl.xml @@ -70,7 +70,7 @@ Declares which NeXus field is the default. The value is the name of the NeXus field to be plotted. - (The value :ref:`names ` an existing child + (The value :ref:`names <validItemName>` an existing child of this group. The child group must itself be a NeXus group.) It is recommended (as of NIAC2014) to use this attribute From 01d0a25a5737c091f2b2e315f7e11551240d5ffd Mon Sep 17 00:00:00 2001 From: Ben Watts Date: Tue, 14 Jun 2022 00:17:48 +0200 Subject: [PATCH 17/23] replace "<" with "<" --- base_classes/NXentry.nxdl.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base_classes/NXentry.nxdl.xml b/base_classes/NXentry.nxdl.xml index b4b530cd9..44f172453 100644 --- a/base_classes/NXentry.nxdl.xml +++ b/base_classes/NXentry.nxdl.xml @@ -40,7 +40,7 @@ to be shown by default. It is used to resolve ambiguity when one :ref:`NXdata` group exists. - The value :ref:`names ` a child group. If that group + The value :ref:`names <validItemName>` a child group. If that group itself has a ``default`` attribute, continue this chain until an :ref:`NXdata` group is reached. From 757993bc6936a5fb492963632ffedf79030aeb09 Mon Sep 17 00:00:00 2001 From: Ben Watts Date: Tue, 14 Jun 2022 00:19:45 +0200 Subject: [PATCH 18/23] replace "<" with "<" --- base_classes/NXroot.nxdl.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base_classes/NXroot.nxdl.xml b/base_classes/NXroot.nxdl.xml index 389d10169..54c432c79 100644 --- a/base_classes/NXroot.nxdl.xml +++ b/base_classes/NXroot.nxdl.xml @@ -91,7 +91,7 @@ the data to be shown by default. It is used to resolve ambiguity when more than one :ref:`NXentry` group exists. - The value :ref:`names ` the default :ref:`NXentry` group. The + The value :ref:`names <validItemName>` the default :ref:`NXentry` group. The value must be the name of a child of the current group. The child must be a NeXus group or a link to a NeXus group. From ee1e27d3eb9cc1b094cd25a632143b56c62c12e6 Mon Sep 17 00:00:00 2001 From: Ben Watts Date: Tue, 14 Jun 2022 00:20:35 +0200 Subject: [PATCH 19/23] replace "<" with "<" --- base_classes/NXsubentry.nxdl.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base_classes/NXsubentry.nxdl.xml b/base_classes/NXsubentry.nxdl.xml index 73e89d254..756bc0f26 100644 --- a/base_classes/NXsubentry.nxdl.xml +++ b/base_classes/NXsubentry.nxdl.xml @@ -40,7 +40,7 @@ to be shown by default. It is used to resolve ambiguity when one :ref:`NXdata` group exists. - The value :ref:`names ` the default :ref:`NXentry` group. The + The value :ref:`names <validItemName>` the default :ref:`NXentry` group. The value must be the name of a child of the current group. The child must be a NeXus group or a link to a NeXus group. From 56f14edb02cf2d4f3ae8adbd369824097fc4932e Mon Sep 17 00:00:00 2001 From: Ben Watts Date: Tue, 14 Jun 2022 00:29:30 +0200 Subject: [PATCH 20/23] fix indentation --- base_classes/NXsubentry.nxdl.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/base_classes/NXsubentry.nxdl.xml b/base_classes/NXsubentry.nxdl.xml index 756bc0f26..5f45a76da 100644 --- a/base_classes/NXsubentry.nxdl.xml +++ b/base_classes/NXsubentry.nxdl.xml @@ -38,11 +38,11 @@ Declares which :ref:`NXdata` group contains the data to be shown by default. - It is used to resolve ambiguity when + It is used to resolve ambiguity when one :ref:`NXdata` group exists. - The value :ref:`names <validItemName>` the default :ref:`NXentry` group. The - value must be the name of a child of the current group. The child must be a - NeXus group or a link to a NeXus group. + The value :ref:`names <validItemName>` the default :ref:`NXentry` group. The + value must be the name of a child of the current group. The child must be a + NeXus group or a link to a NeXus group. For more information about how NeXus identifies the default plottable data, see the @@ -85,9 +85,9 @@ - Unique identifier for the experiment, defined by - the facility, possibly linked to the proposals - + Unique identifier for the experiment, defined by + the facility, possibly linked to the proposals + Brief summary of the experiment, including key objectives. From 10d8224dc4f0bf876a35419d89968b4795a1db0e Mon Sep 17 00:00:00 2001 From: Ben Watts Date: Tue, 14 Jun 2022 11:19:44 +0200 Subject: [PATCH 21/23] provide file_time in ISO format --- manual/source/examples/epics/write_nexus_file.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manual/source/examples/epics/write_nexus_file.py b/manual/source/examples/epics/write_nexus_file.py index 1dd61bafb..3b28427ab 100755 --- a/manual/source/examples/epics/write_nexus_file.py +++ b/manual/source/examples/epics/write_nexus_file.py @@ -18,7 +18,7 @@ def write_nexus_file(fname, image, md={}): """ nexus = h5py.File(fname, "w") nexus.attrs["filename"] = fname - nexus.attrs["file_time"] = str(datetime.datetime.now()) + nexus.attrs["file_time"] = datetime.datetime.now().astimezone().isoformat() nexus.attrs["creator"] = "write_nexus_file()" nexus.attrs["H5PY_VERSION"] = h5py.__version__ From c45a025edb7ae72fdeee6d05d0bcb4f06b81cf74 Mon Sep 17 00:00:00 2001 From: Ben Watts Date: Tue, 14 Jun 2022 11:33:15 +0200 Subject: [PATCH 22/23] Add empty line to hopefully fix cross-references WARNING: Failed to create a cross reference. A title or caption not found: find-plottable-data-v3 --- manual/source/datarules.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/manual/source/datarules.rst b/manual/source/datarules.rst index 1342952c4..b1b51f051 100644 --- a/manual/source/datarules.rst +++ b/manual/source/datarules.rst @@ -652,6 +652,7 @@ to find the default plottable data. It is recommended to start with the most recent method, :ref:`Find-Plottable-Data-v3`, first. .. _Find-Plottable-Data-v3: + .. index:: ! find the default plottable data .. index:: ! default attribute value .. index:: ! signal attribute value From 06d52e256d6445f61116dc66e8140a3f2cfa6d3d Mon Sep 17 00:00:00 2001 From: Ben Watts Date: Tue, 14 Jun 2022 11:40:18 +0200 Subject: [PATCH 23/23] try to fix cross-reference --- manual/source/datarules.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manual/source/datarules.rst b/manual/source/datarules.rst index b1b51f051..7f174c98a 100644 --- a/manual/source/datarules.rst +++ b/manual/source/datarules.rst @@ -651,12 +651,12 @@ any of these methods, we present the algorithm for each method to find the default plottable data. It is recommended to start with the most recent method, :ref:`Find-Plottable-Data-v3`, first. -.. _Find-Plottable-Data-v3: - .. index:: ! find the default plottable data .. index:: ! default attribute value .. index:: ! signal attribute value +.. _Find-Plottable-Data-v3: + Version 3 =========