From 7157d25ccad2be20fdb110a2701fcbcb5edbf7d6 Mon Sep 17 00:00:00 2001 From: Aaron Brewster Date: Mon, 13 Mar 2023 15:17:04 -0700 Subject: [PATCH 01/13] Add new datatype, the union of NX_CHAR and NX_NUMBER --- nxdlTypes.xsd | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/nxdlTypes.xsd b/nxdlTypes.xsd index 8811142b9..06ec4b833 100644 --- a/nxdlTypes.xsd +++ b/nxdlTypes.xsd @@ -619,4 +619,14 @@ + + + Any valid character string or NeXus number representation + + + + From db047de1b74c5c8052adda685405fec282a6540c Mon Sep 17 00:00:00 2001 From: Aaron Brewster Date: Mon, 13 Mar 2023 15:17:33 -0700 Subject: [PATCH 02/13] Change AXISNAME field of NXdata to allow character values --- base_classes/NXdata.nxdl.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/base_classes/NXdata.nxdl.xml b/base_classes/NXdata.nxdl.xml index 774c65325..68d4b918c 100644 --- a/base_classes/NXdata.nxdl.xml +++ b/base_classes/NXdata.nxdl.xml @@ -273,13 +273,17 @@ but not to describe how the data is to be plotted. (https://www.nexusformat.org/NIAC2018Minutes.html#nxdata-plottype--attribute) - + Dimension scale defining an axis of the data. Client is responsible for defining the dimensions of the data. The name of this field may be changed to fit the circumstances. Standard NeXus client tools will use the attributes to determine how to use this field. + + Most dimensions scales 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. From 3dc02baa3beeb1dabd63c987f076b7404188387b Mon Sep 17 00:00:00 2001 From: Aaron Brewster Date: Mon, 13 Mar 2023 15:44:45 -0700 Subject: [PATCH 03/13] Whitespace --- base_classes/NXdata.nxdl.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/base_classes/NXdata.nxdl.xml b/base_classes/NXdata.nxdl.xml index 68d4b918c..2ee17d382 100644 --- a/base_classes/NXdata.nxdl.xml +++ b/base_classes/NXdata.nxdl.xml @@ -275,16 +275,16 @@ - Dimension scale defining an axis of the data. - Client is responsible for defining the dimensions of the data. - The name of this field may be changed to fit the circumstances. - Standard NeXus client tools will use the attributes to determine - how to use this field. + Dimension scale defining an axis of the data. + Client is responsible for defining the dimensions of the data. + The name of this field may be changed to fit the circumstances. + Standard NeXus client tools will use the attributes to determine + how to use this field. Most dimensions scales 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. - + A *dimension scale* must have a rank of 1 and has length ``n``. From 6d2370324cc8aacd963be57796a8282388089098 Mon Sep 17 00:00:00 2001 From: Aaron Brewster Date: Fri, 17 Mar 2023 11:01:15 -0700 Subject: [PATCH 04/13] Add NXdata attribute default_slice Which slice of data to show in a plot by default. This is useful especially for datasets with more than 2 dimensions. --- base_classes/NXdata.nxdl.xml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/base_classes/NXdata.nxdl.xml b/base_classes/NXdata.nxdl.xml index 2ee17d382..8cd34d853 100644 --- a/base_classes/NXdata.nxdl.xml +++ b/base_classes/NXdata.nxdl.xml @@ -115,6 +115,38 @@ the axes attribute can be omitted. + + + Which slice of data to show in a plot by default. This is useful especially for + datasets with more than 2 dimensions. + + Should be an array of strings of length equal to the number of dimesions + in the data, with the following possible values: + * ".": All the data in this dimension should be included + * Integer: Only this slice should be used. + * String: Only this slice should be used. Use if AXISNAME_indices is a string + array. + + Example:: + + data: NXdata + @signal = "data" + @axes = ["image_id", "channel", ".", "."] + @image_id_indices = 0 + @channel_indices = 1 + @default_slice = [".", "difference", ".", "."] + image_id = [1, ..., nP] + channel = ["threshold_1", "threshold_2", "difference"] + data = uint[nP, nC, i, j] + + Here, a data array with four dimensions, including the number of images + (nP) and number of channels (nC), specifies more dimensions than can be + visualized with a 2D image viewer for a given image. Therefore the + default_slice attribute specifies that the "difference" channel should be + shown by default. + + +