diff --git a/.github/workflows/plugin_test.yaml b/.github/workflows/plugin_test.yaml index b977ffdb0..12feee163 100644 --- a/.github/workflows/plugin_test.yaml +++ b/.github/workflows/plugin_test.yaml @@ -39,13 +39,13 @@ jobs: branch: main tests_to_run: tests/. - plugin: pynxtools-spm - branch: main + branch: RepalceNexusFile tests_to_run: tests/. - plugin: pynxtools-xps - branch: main + branch: adapt-testing tests_to_run: tests/. - plugin: pynxtools-xrd - branch: main + branch: RepalceNexusFile tests_to_run: tests/. steps: diff --git a/src/pynxtools/nexus/nexus.py b/src/pynxtools/nexus/nexus.py index f8b333b1d..7061adc04 100644 --- a/src/pynxtools/nexus/nexus.py +++ b/src/pynxtools/nexus/nexus.py @@ -2,6 +2,7 @@ """Read files from different format and print it in a standard NeXus format""" import logging +import math import os import sys from functools import cache, lru_cache @@ -425,6 +426,96 @@ def get_inherited_hdf_nodes( return (class_path, nxdl_elem_path, elist) +def safe_str(value, precision: int = 8) -> str: + """Return a deterministic string representation of arrays, lists, or scalars. + + Floats are formatted consistently across systems to ensure deterministic + output. Special handling is applied to simplify representation: + - `0.0` → `'0.0'` + - `1.0` → `'1'` + - `1.50` → `'1.5'` + - Non-integer floats keep up to `precision` decimals with trailing zeros + and dots removed. + + Arrays and lists are formatted elementwise using the same rules. + + Args: + value: The input value to format. Can be a scalar, list, tuple, + NumPy array, or basic type such as int, float, str, or bytes. + precision (int): Maximum number of decimal places for non-integer + floats. Defaults to 8. + + Returns: + str: Deterministic string representation of the input. + """ + # Normalize NumPy scalar and 0D array types + if isinstance(value, np.generic): + value = value.item() + elif isinstance(value, np.ndarray) and value.shape == (): + value = value.item() + + def format_float(value: float) -> str: + """Format a float deterministically.""" + if value == 0.0: + # Preserve sign of zero + if math.copysign(1.0, value) < 0: + return "-0.0" + return "0.0" + if math.isnan(value): + return "nan" + if math.isinf(value): + return "inf" if value > 0 else "-inf" + if value.is_integer(): + return str(int(value)) + if abs(value) < 10**-precision or abs(value) >= 10 ** (precision + 1): + return f"{value:.{precision}e}" + return f"{value:.{precision}f}".rstrip("0").rstrip(".") + + # --- Arrays --- + if isinstance(value, np.ndarray): + flat = value.flatten() + formatted = [] + for v in flat: + if isinstance(v, (np.generic, np.ndarray)): + v = v.item() + if isinstance(v, float): + formatted.append(format_float(v)) + elif isinstance(v, str): + formatted.append(v) + elif isinstance(v, bytes): + formatted.append(v.decode(errors="replace")) + else: + formatted.append(str(v)) + reshaped = np.array(formatted, dtype=object).reshape(value.shape) + return np.array2string( + reshaped, + separator=", ", + formatter={"all": lambda x: str(x)}, + max_line_width=1000000, + threshold=6, + ) + + # --- Lists / tuples --- + if isinstance(value, list | tuple): + formatted = [safe_str(v, precision) for v in value] + return f"[{', '.join(formatted)}]" + + # --- Floats --- + if isinstance(value, float | np.floating): + return format_float(float(value)) + + # --- Integers / booleans --- + elif isinstance(value, (int, np.integer, bool, np.bool_)): + return str(value) + + # --- Strings / bytes --- + elif isinstance(value, (bytes, str)): + return value if isinstance(value, str) else value.decode(errors="replace") + + # --- Fallback --- + return str(value) + + def process_node(hdf_node, hdf_path, parser, logger, doc=True): """Processes an hdf5 node. - it logs the node found and also checks for its attributes @@ -436,11 +527,11 @@ def process_node(hdf_node, hdf_path, parser, logger, doc=True): if isinstance(hdf_node, h5py.Dataset): logger.debug(f"===== FIELD (/{hdf_path}): {hdf_node}") val = ( - str(decode_if_string(hdf_node[()])).split("\n") + safe_str(decode_if_string(hdf_node[()])).split("\n") if len(hdf_node.shape) <= 1 - else str(decode_if_string(hdf_node[0])).split("\n") + else safe_str(decode_if_string(hdf_node[0])).split("\n") ) - logger.debug(f"value: {val[0]} {'...' if len(val) > 1 else ''}") + logger.debug(f"value: {val[0]}{' ...' if len(val) > 1 else ''}") else: logger.debug( f"===== GROUP (/{hdf_path} " @@ -460,8 +551,8 @@ def process_node(hdf_node, hdf_path, parser, logger, doc=True): ) for key, value in hdf_node.attrs.items(): logger.debug(f"===== ATTRS (/{hdf_path}@{key})") - val = str(decode_if_string(value)).split("\n") - logger.debug(f"value: {val[0]} {'...' if len(val) > 1 else ''}") + val = safe_str(decode_if_string(value)).split("\n") + logger.debug(f"value: {val[0]}{' ...' if len(val) > 1 else ''}") (req_str, nxdef, nxdl_path) = get_nxdl_doc(hdf_info, logger, doc, attr=key) if ( parser is not None diff --git a/src/pynxtools/nomad/parser.py b/src/pynxtools/nomad/parser.py index 249213723..fbac2aefe 100644 --- a/src/pynxtools/nomad/parser.py +++ b/src/pynxtools/nomad/parser.py @@ -149,7 +149,7 @@ def _get_value(hdf_node): def decode_array(arr): result = [] for x in arr: - if isinstance(x, (np.ndarray, list)): + if isinstance(x, np.ndarray | list): result.append(decode_array(x)) else: result.append(str(decode_or_not(x))) diff --git a/src/pynxtools/testing/nexus_conversion.py b/src/pynxtools/testing/nexus_conversion.py index ef9082742..c8dfabd0c 100644 --- a/src/pynxtools/testing/nexus_conversion.py +++ b/src/pynxtools/testing/nexus_conversion.py @@ -62,7 +62,14 @@ class ReaderTest: """Generic test for reader plugins.""" def __init__( - self, nxdl, reader_name, files_or_dir, tmp_path, caplog, **kwargs + self, + nxdl, + reader_name, + files_or_dir, + tmp_path, + caplog, + ref_log_path=None, + **kwargs, ) -> None: """Initialize the test object. @@ -75,13 +82,15 @@ def __init__( files_or_dir : str List of input files or full path string to the example data directory that contains all the files required for running the data conversion through the reader. - ref_nexus_file : str - Full path string to the reference NeXus file generated from the same - set of input files. tmp_path : pathlib.PosixPath Pytest fixture variable, used to clean up the files generated during the test. caplog : _pytest.logging.LogCaptureFixture Pytest fixture variable, used to capture the log messages during the test. + ref_log_path : str + Full path string to the reference log file generated from the same + set of input files in files_or_dir. This can also be parsed automatically if + files_or_dir is the full path string to the example data directory and there + is only one reference log file. kwargs : dict[str, Any] Any additional keyword arguments to be passed to the readers' read function. """ @@ -91,11 +100,11 @@ def __init__( self.reader = get_reader(self.reader_name) self.files_or_dir = files_or_dir - self.ref_nexus_file = "" self.tmp_path = tmp_path self.caplog = caplog - self.created_nexus = f"{tmp_path}/{os.sep}/output.nxs" + self.ref_log_path = ref_log_path self.kwargs = kwargs + self.created_nexus = f"{tmp_path}/{os.sep}/output.nxs" def convert_to_nexus( self, @@ -114,15 +123,18 @@ def convert_to_nexus( example_files = self.files_or_dir else: example_files = sorted(glob(os.path.join(self.files_or_dir, "*"))) - self.ref_nexus_file = [file for file in example_files if file.endswith(".nxs")][ - 0 - ] + + if not self.ref_log_path: + self.ref_log_path = next( + (file for file in example_files if file.endswith(".log")), None + ) + assert self.ref_log_path, "Reference nexus .log file not found" + input_files = [ file for file in example_files - if not file.endswith((".nxs", "ref_output.txt")) + if not file.endswith((".nxs", "ref_output.txt", ".log")) ] - assert self.ref_nexus_file, "Reference nexus (.nxs) file not found" assert ( self.nxdl in self.reader.supported_nxdls @@ -167,10 +179,17 @@ def convert_to_nexus( assert test_output == [] - # Validate created file using the validate_nexus functionality + def validate_nexus_file( + self, + caplog_level: Literal["ERROR", "WARNING"] = "ERROR", + ignore_undocumented: bool = False, + ): + """Validate the created NeXus using the validate_nexus functionality.""" with self.caplog.at_level(caplog_level): validate(self.created_nexus, ignore_undocumented=ignore_undocumented) + def parse_nomad(self): + """Test if the created NeXus file can be parsed by NOMAD.""" if NOMAD_AVAILABLE: kwargs = dict( strict=True, @@ -304,9 +323,8 @@ def extra_lines(lines1: list[str], lines2: list[str]) -> list[str | None]: raise AssertionError("\n".join(diffs)) # Load log paths - ref_log_path = get_log_file(self.ref_nexus_file, "ref_nexus.log", self.tmp_path) gen_log_path = get_log_file(self.created_nexus, "gen_nexus.log", self.tmp_path) - gen_lines, ref_lines = load_logs(gen_log_path, ref_log_path) + gen_lines, ref_lines = load_logs(gen_log_path, self.ref_log_path) # Compare logs compare_logs(gen_lines, ref_lines) diff --git a/tests/data/nexus/Ref_nexus_test.log b/tests/data/nexus/Ref_nexus_test.log index 7c4a7e40e..9f99a0cf1 100644 --- a/tests/data/nexus/Ref_nexus_test.log +++ b/tests/data/nexus/Ref_nexus_test.log @@ -3,27 +3,27 @@ DEBUG - classpath: None DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//@HDF5_Version) -DEBUG - value: 1.10.5 +DEBUG - value: 1.10.5 DEBUG - classpath: None DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//@file_name) -DEBUG - value: /home/tommaso/Desktop/NeXus/Test/201805_WSe2_arpes.nxs +DEBUG - value: /home/tommaso/Desktop/NeXus/Test/201805_WSe2_arpes.nxs DEBUG - classpath: None DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//@file_time) -DEBUG - value: 2020-06-04T19:19:48.464472 +DEBUG - value: 2020-06-04T19:19:48.464472 DEBUG - classpath: None DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//@h5py_version) -DEBUG - value: 2.10.0 +DEBUG - value: 2.10.0 DEBUG - classpath: None DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//@nexusformat_version) -DEBUG - value: 0.5.2 +DEBUG - value: 0.5.2 DEBUG - classpath: None DEBUG - NOT IN SCHEMA DEBUG - @@ -54,7 +54,7 @@ DEBUG - respectively) that exists within the same group. DEBUG - ===== ATTRS (//entry@NX_class) -DEBUG - value: NXentry +DEBUG - value: NXentry DEBUG - classpath: ['NXentry'] DEBUG - classes: NXarpes.nxdl.xml:/ENTRY @@ -63,7 +63,7 @@ NXobject.nxdl.xml: DEBUG - @NX_class [NX_CHAR] DEBUG - DEBUG - ===== FIELD (//entry/collection_time): -DEBUG - value: 7200 +DEBUG - value: 7200 DEBUG - classpath: ['NXentry', 'NX_FLOAT'] DEBUG - classes: NXentry.nxdl.xml:/collection_time @@ -74,7 +74,7 @@ DEBUG - suspended due to e.g. temperature out of range DEBUG - ===== ATTRS (//entry/collection_time@units) -DEBUG - value: s +DEBUG - value: s DEBUG - classpath: ['NXentry', 'NX_FLOAT'] DEBUG - classes: NXentry.nxdl.xml:/collection_time @@ -295,7 +295,7 @@ DEBUG - respectively) that exists within the same group. DEBUG - ===== ATTRS (//entry/data@NX_class) -DEBUG - value: NXdata +DEBUG - value: NXdata DEBUG - classpath: ['NXentry', 'NXdata'] DEBUG - classes: NXarpes.nxdl.xml:/ENTRY/DATA @@ -306,7 +306,7 @@ NXobject.nxdl.xml: DEBUG - @NX_class [NX_CHAR] DEBUG - DEBUG - ===== ATTRS (//entry/data@axes) -DEBUG - value: ['angles' 'energies' 'delays'] +DEBUG - value: [angles, energies, delays] DEBUG - classpath: ['NXentry', 'NXdata'] DEBUG - classes: NXarpes.nxdl.xml:/ENTRY/DATA @@ -329,7 +329,7 @@ DEBUG - of strings and not a single comma separated string. DEBUG - ===== ATTRS (//entry/data@signal) -DEBUG - value: data +DEBUG - value: data DEBUG - classpath: ['NXentry', 'NXdata'] DEBUG - classes: NXarpes.nxdl.xml:/ENTRY/DATA @@ -355,7 +355,7 @@ DEBUG - for a summary of the discussion. DEBUG - ===== FIELD (//entry/data/angles): -DEBUG - value: [-1.96735314 -1.91500657 -1.86266001 -1.81031344 -1.75796688 -1.70562031 ... +DEBUG - value: [-1.96735314, -1.91500657, -1.86266001, ..., 2.06333233, 2.1156789, 2.16802546] DEBUG - classpath: ['NXentry', 'NXdata', 'NX_CHAR_OR_NUMBER'] DEBUG - classes: NXdata.nxdl.xml:/AXISNAME @@ -376,14 +376,14 @@ DEBUG - an array of NX_CHAR can be provided. DEBUG - ===== ATTRS (//entry/data/angles@target) -DEBUG - value: /entry/instrument/analyser/angles +DEBUG - value: /entry/instrument/analyser/angles DEBUG - classpath: ['NXentry', 'NXdata', 'NX_CHAR_OR_NUMBER'] DEBUG - classes: NXdata.nxdl.xml:/AXISNAME DEBUG - @target - IS NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//entry/data/angles@units) -DEBUG - value: 1/Å +DEBUG - value: 1/Å DEBUG - classpath: ['NXentry', 'NXdata', 'NX_CHAR_OR_NUMBER'] DEBUG - classes: NXdata.nxdl.xml:/AXISNAME @@ -395,7 +395,7 @@ DEBUG - See the section :ref:`Design-Units` for more information. DEBUG - ===== FIELD (//entry/data/data): -DEBUG - value: [[0. 0. 0. ... 0. 0. 0.] ... +DEBUG - value: [[0.0, 0.0, 0.0, ..., 0.0, 0.0, 0.0], ... DEBUG - classpath: ['NXentry', 'NXdata', 'NX_NUMBER'] DEBUG - classes: NXdata.nxdl.xml:/DATA @@ -413,20 +413,20 @@ DEBUG - The maximum rank is ``32`` for compatibility with backend file formats. DEBUG - ===== ATTRS (//entry/data/data@target) -DEBUG - value: /entry/instrument/analyser/data +DEBUG - value: /entry/instrument/analyser/data DEBUG - classpath: ['NXentry', 'NXdata', 'NX_NUMBER'] DEBUG - classes: NXdata.nxdl.xml:/DATA DEBUG - @target - IS NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//entry/data/data@units) -DEBUG - value: counts +DEBUG - value: counts DEBUG - classpath: ['NXentry', 'NXdata', 'NX_NUMBER'] DEBUG - classes: NXdata.nxdl.xml:/DATA DEBUG - NXdata.nxdl.xml:/DATA@units - REQUIRED, but undefined unit category DEBUG - ===== FIELD (//entry/data/delays): -DEBUG - value: [-1.1 -1.08041237 -1.06082474 -1.04123711 -1.02164948 -1.00206186 ... +DEBUG - value: [-1.1, -1.08041237, -1.06082474, ..., 2.66082474, 2.68041237, 2.7] DEBUG - classpath: ['NXentry', 'NXdata', 'NX_CHAR_OR_NUMBER'] DEBUG - classes: NXdata.nxdl.xml:/AXISNAME @@ -447,14 +447,14 @@ DEBUG - an array of NX_CHAR can be provided. DEBUG - ===== ATTRS (//entry/data/delays@target) -DEBUG - value: /entry/instrument/analyser/delays +DEBUG - value: /entry/instrument/analyser/delays DEBUG - classpath: ['NXentry', 'NXdata', 'NX_CHAR_OR_NUMBER'] DEBUG - classes: NXdata.nxdl.xml:/AXISNAME DEBUG - @target - IS NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//entry/data/delays@units) -DEBUG - value: fs +DEBUG - value: fs DEBUG - classpath: ['NXentry', 'NXdata', 'NX_CHAR_OR_NUMBER'] DEBUG - classes: NXdata.nxdl.xml:/AXISNAME @@ -466,7 +466,7 @@ DEBUG - See the section :ref:`Design-Units` for more information. DEBUG - ===== FIELD (//entry/data/energies): -DEBUG - value: [ 2.5 2.46917808 2.43835616 2.40753425 2.37671233 2.34589041 ... +DEBUG - value: [2.5, 2.46917808, 2.43835616, ..., -1.90753425, -1.93835616, -1.96917808] DEBUG - classpath: ['NXentry', 'NXdata', 'NX_CHAR_OR_NUMBER'] DEBUG - classes: NXdata.nxdl.xml:/AXISNAME @@ -487,14 +487,14 @@ DEBUG - an array of NX_CHAR can be provided. DEBUG - ===== ATTRS (//entry/data/energies@target) -DEBUG - value: /entry/instrument/analyser/energies +DEBUG - value: /entry/instrument/analyser/energies DEBUG - classpath: ['NXentry', 'NXdata', 'NX_CHAR_OR_NUMBER'] DEBUG - classes: NXdata.nxdl.xml:/AXISNAME DEBUG - @target - IS NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//entry/data/energies@units) -DEBUG - value: eV +DEBUG - value: eV DEBUG - classpath: ['NXentry', 'NXdata', 'NX_CHAR_OR_NUMBER'] DEBUG - classes: NXdata.nxdl.xml:/AXISNAME @@ -506,7 +506,7 @@ DEBUG - See the section :ref:`Design-Units` for more information. DEBUG - ===== FIELD (//entry/definition): -DEBUG - value: NXarpes +DEBUG - value: NXarpes DEBUG - classpath: ['NXentry', 'NX_CHAR'] DEBUG - classes: NXarpes.nxdl.xml:/ENTRY/definition @@ -534,7 +534,7 @@ DEBUG - *It is advised* to use :ref:`NXsubentry`, instead, as the overlay position. DEBUG - ===== FIELD (//entry/duration): -DEBUG - value: 7200 +DEBUG - value: 7200 DEBUG - classpath: ['NXentry', 'NX_INT'] DEBUG - classes: NXentry.nxdl.xml:/duration @@ -542,13 +542,13 @@ DEBUG - <> DEBUG - documentation (NXentry.nxdl.xml:/duration): DEBUG - Duration of measurement DEBUG - ===== ATTRS (//entry/duration@units) -DEBUG - value: s +DEBUG - value: s DEBUG - classpath: ['NXentry', 'NX_INT'] DEBUG - classes: NXentry.nxdl.xml:/duration DEBUG - NXentry.nxdl.xml:/duration@units [NX_TIME] DEBUG - ===== FIELD (//entry/end_time): -DEBUG - value: 2018-05-01T09:22:00+02:00 +DEBUG - value: 2018-05-01T09:22:00+02:00 DEBUG - classpath: ['NXentry', 'NX_DATE_TIME'] DEBUG - classes: NXentry.nxdl.xml:/end_time @@ -556,7 +556,7 @@ DEBUG - <> DEBUG - documentation (NXentry.nxdl.xml:/end_time): DEBUG - Ending time of measurement DEBUG - ===== FIELD (//entry/entry_identifier): -DEBUG - value: Run 22118 +DEBUG - value: Run 22118 DEBUG - classpath: ['NXentry', 'NX_CHAR'] DEBUG - classes: NXentry.nxdl.xml:/entry_identifier @@ -565,7 +565,7 @@ DEBUG - DEPRECATED - Use the field :ref:`identifier_entry -DEBUG - value: F-20170538 +DEBUG - value: F-20170538 DEBUG - classpath: ['NXentry', 'NX_CHAR'] DEBUG - classes: NXentry.nxdl.xml:/experiment_identifier @@ -610,7 +610,7 @@ DEBUG - respectively) that exists within the same group. DEBUG - ===== ATTRS (//entry/instrument@NX_class) -DEBUG - value: NXinstrument +DEBUG - value: NXinstrument DEBUG - classpath: ['NXentry', 'NXinstrument'] DEBUG - classes: NXarpes.nxdl.xml:/ENTRY/INSTRUMENT @@ -650,7 +650,7 @@ DEBUG - respectively) that exists within the same group. DEBUG - ===== ATTRS (//entry/instrument/analyser@NX_class) -DEBUG - value: NXdetector +DEBUG - value: NXdetector DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXdetector'] DEBUG - classes: NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/analyser @@ -661,7 +661,7 @@ NXobject.nxdl.xml: DEBUG - @NX_class [NX_CHAR] DEBUG - DEBUG - ===== FIELD (//entry/instrument/analyser/acquisition_mode): -DEBUG - value: fixed +DEBUG - value: fixed DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXdetector', 'NX_CHAR'] DEBUG - classes: NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/analyser/acquisition_mode @@ -683,12 +683,12 @@ DEBUG - DEBUG - documentation (NXdetector.nxdl.xml:/acquisition_mode): DEBUG - The acquisition mode of the detector. DEBUG - ===== FIELD (//entry/instrument/analyser/amplifier_type): -DEBUG - value: MCP +DEBUG - value: MCP DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXdetector'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/instrument/analyser/angles): -DEBUG - value: [-1.96735314 -1.91500657 -1.86266001 -1.81031344 -1.75796688 -1.70562031 ... +DEBUG - value: [-1.96735314, -1.91500657, -1.86266001, ..., 2.06333233, 2.1156789, 2.16802546] DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXdetector', 'NX_NUMBER'] DEBUG - classes: NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/analyser/angles @@ -700,25 +700,25 @@ DEBUG - using the normal NXdata methods. DEBUG - ===== ATTRS (//entry/instrument/analyser/angles@target) -DEBUG - value: /entry/instrument/analyser/angles +DEBUG - value: /entry/instrument/analyser/angles DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXdetector', 'NX_NUMBER'] DEBUG - classes: NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/analyser/angles DEBUG - @target - IS NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//entry/instrument/analyser/angles@units) -DEBUG - value: 1/Å +DEBUG - value: 1/Å DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXdetector', 'NX_NUMBER'] DEBUG - classes: NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/analyser/angles DEBUG - NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/analyser/angles@units [NX_ANGLE] DEBUG - ===== FIELD (//entry/instrument/analyser/contrast_aperture): -DEBUG - value: Out +DEBUG - value: Out DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXdetector'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/instrument/analyser/data): -DEBUG - value: [[0. 0. 0. ... 0. 0. 0.] ... +DEBUG - value: [[0.0, 0.0, 0.0, ..., 0.0, 0.0, 0.0], ... DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXdetector', 'NX_NUMBER'] DEBUG - classes: NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/analyser/data @@ -752,7 +752,7 @@ DEBUG - shown here are merely illustrative of coordination between related datasets. DEBUG - ===== ATTRS (//entry/instrument/analyser/data@target) -DEBUG - value: /entry/instrument/analyser/data +DEBUG - value: /entry/instrument/analyser/data DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXdetector', 'NX_NUMBER'] DEBUG - classes: NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/analyser/data @@ -760,7 +760,7 @@ NXdetector.nxdl.xml:/data DEBUG - @target - IS NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//entry/instrument/analyser/data@units) -DEBUG - value: counts +DEBUG - value: counts DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXdetector', 'NX_NUMBER'] DEBUG - classes: NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/analyser/data @@ -768,32 +768,32 @@ NXdetector.nxdl.xml:/data DEBUG - NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/analyser/data@units - REQUIRED, but undefined unit category DEBUG - NXdetector.nxdl.xml:/data@units [NX_ANY] DEBUG - ===== FIELD (//entry/instrument/analyser/delays): -DEBUG - value: [-1.1 -1.08041237 -1.06082474 -1.04123711 -1.02164948 -1.00206186 ... +DEBUG - value: [-1.1, -1.08041237, -1.06082474, ..., 2.66082474, 2.68041237, 2.7] DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXdetector'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//entry/instrument/analyser/delays@target) -DEBUG - value: /entry/instrument/analyser/delays +DEBUG - value: /entry/instrument/analyser/delays DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXdetector'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//entry/instrument/analyser/delays@units) -DEBUG - value: fs +DEBUG - value: fs DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXdetector'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/instrument/analyser/detector_type): -DEBUG - value: DLD +DEBUG - value: DLD DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXdetector'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/instrument/analyser/dispersion_scheme): -DEBUG - value: Time of flight +DEBUG - value: Time of flight DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXdetector'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/instrument/analyser/energies): -DEBUG - value: [ 2.5 2.46917808 2.43835616 2.40753425 2.37671233 2.34589041 ... +DEBUG - value: [2.5, 2.46917808, 2.43835616, ..., -1.90753425, -1.93835616, -1.96917808] DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXdetector', 'NX_NUMBER'] DEBUG - classes: NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/analyser/energies @@ -805,20 +805,20 @@ DEBUG - using the normal NXdata methods. DEBUG - ===== ATTRS (//entry/instrument/analyser/energies@target) -DEBUG - value: /entry/instrument/analyser/energies +DEBUG - value: /entry/instrument/analyser/energies DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXdetector', 'NX_NUMBER'] DEBUG - classes: NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/analyser/energies DEBUG - @target - IS NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//entry/instrument/analyser/energies@units) -DEBUG - value: eV +DEBUG - value: eV DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXdetector', 'NX_NUMBER'] DEBUG - classes: NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/analyser/energies DEBUG - NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/analyser/energies@units [NX_ENERGY] DEBUG - ===== FIELD (//entry/instrument/analyser/entrance_slit_setting): -DEBUG - value: 0 +DEBUG - value: 0 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXdetector', 'NX_NUMBER'] DEBUG - classes: NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/analyser/entrance_slit_setting @@ -826,7 +826,7 @@ DEBUG - <> DEBUG - documentation (NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/analyser/entrance_slit_setting): DEBUG - dial setting of the entrance slit DEBUG - ===== FIELD (//entry/instrument/analyser/entrance_slit_shape): -DEBUG - value: straight +DEBUG - value: straight DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXdetector', 'NX_CHAR'] DEBUG - classes: NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/analyser/entrance_slit_shape @@ -837,7 +837,7 @@ DEBUG - -> straight DEBUG - documentation (NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/analyser/entrance_slit_shape): DEBUG - DEBUG - ===== FIELD (//entry/instrument/analyser/entrance_slit_size): -DEBUG - value: 750 +DEBUG - value: 750 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXdetector', 'NX_NUMBER'] DEBUG - classes: NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/analyser/entrance_slit_size @@ -845,43 +845,43 @@ DEBUG - <> DEBUG - documentation (NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/analyser/entrance_slit_size): DEBUG - size of the entrance slit DEBUG - ===== ATTRS (//entry/instrument/analyser/entrance_slit_size@units) -DEBUG - value: um +DEBUG - value: um DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXdetector', 'NX_NUMBER'] DEBUG - classes: NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/analyser/entrance_slit_size DEBUG - NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/analyser/entrance_slit_size@units [NX_LENGTH] DEBUG - ===== FIELD (//entry/instrument/analyser/extractor_voltage): -DEBUG - value: 6030 +DEBUG - value: 6030 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXdetector'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//entry/instrument/analyser/extractor_voltage@units) -DEBUG - value: V +DEBUG - value: V DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXdetector'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/instrument/analyser/field_aperture_x): -DEBUG - value: -0.2 +DEBUG - value: -0.2 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXdetector'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//entry/instrument/analyser/field_aperture_x@units) -DEBUG - value: um +DEBUG - value: um DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXdetector'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/instrument/analyser/field_aperture_y): -DEBUG - value: 5.35 +DEBUG - value: 5.35 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXdetector'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//entry/instrument/analyser/field_aperture_y@units) -DEBUG - value: um +DEBUG - value: um DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXdetector'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/instrument/analyser/lens_mode): -DEBUG - value: 20180430_KPEEM_M_-2.5_FoV6.2_rezAA_20ToF_focused.sav +DEBUG - value: 20180430_KPEEM_M_-2.5_FoV6.2_rezAA_20ToF_focused.sav DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXdetector', 'NX_CHAR'] DEBUG - classes: NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/analyser/lens_mode @@ -889,12 +889,12 @@ DEBUG - <> DEBUG - documentation (NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/analyser/lens_mode): DEBUG - setting for the electron analyser lens DEBUG - ===== FIELD (//entry/instrument/analyser/magnification): -DEBUG - value: -1.5 +DEBUG - value: -1.5 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXdetector'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/instrument/analyser/pass_energy): -DEBUG - value: 20 +DEBUG - value: 20 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXdetector', 'NX_NUMBER'] DEBUG - classes: NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/analyser/pass_energy @@ -902,18 +902,18 @@ DEBUG - <> DEBUG - documentation (NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/analyser/pass_energy): DEBUG - energy of the electrons on the mean path of the analyser DEBUG - ===== ATTRS (//entry/instrument/analyser/pass_energy@units) -DEBUG - value: eV +DEBUG - value: eV DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXdetector', 'NX_NUMBER'] DEBUG - classes: NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/analyser/pass_energy DEBUG - NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/analyser/pass_energy@units [NX_ENERGY] DEBUG - ===== FIELD (//entry/instrument/analyser/projection): -DEBUG - value: reciprocal +DEBUG - value: reciprocal DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXdetector'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/instrument/analyser/region_origin): -DEBUG - value: [0 0] +DEBUG - value: [0, 0] DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXdetector', 'NX_INT'] DEBUG - classes: NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/analyser/region_origin @@ -921,7 +921,7 @@ DEBUG - <> DEBUG - documentation (NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/analyser/region_origin): DEBUG - origin of rectangular region selected for readout DEBUG - ===== FIELD (//entry/instrument/analyser/region_size): -DEBUG - value: [ 80 146] +DEBUG - value: [80, 146] DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXdetector', 'NX_INT'] DEBUG - classes: NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/analyser/region_size @@ -929,12 +929,12 @@ DEBUG - <> DEBUG - documentation (NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/analyser/region_size): DEBUG - size of rectangular region selected for readout DEBUG - ===== FIELD (//entry/instrument/analyser/sensor_count): -DEBUG - value: 4 +DEBUG - value: 4 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXdetector'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/instrument/analyser/sensor_size): -DEBUG - value: [ 80 146] +DEBUG - value: [80, 146] DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXdetector', 'NX_INT'] DEBUG - classes: NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/analyser/sensor_size @@ -942,7 +942,7 @@ DEBUG - <> DEBUG - documentation (NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/analyser/sensor_size): DEBUG - number of raw active elements in each dimension DEBUG - ===== FIELD (//entry/instrument/analyser/time_per_channel): -DEBUG - value: 7200 +DEBUG - value: 7200 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXdetector', 'NX_NUMBER'] DEBUG - classes: NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/analyser/time_per_channel @@ -950,18 +950,18 @@ DEBUG - <> DEBUG - documentation (NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/analyser/time_per_channel): DEBUG - todo: define more clearly DEBUG - ===== ATTRS (//entry/instrument/analyser/time_per_channel@units) -DEBUG - value: s +DEBUG - value: s DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXdetector', 'NX_NUMBER'] DEBUG - classes: NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/analyser/time_per_channel DEBUG - NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/analyser/time_per_channel@units [NX_TIME] DEBUG - ===== FIELD (//entry/instrument/analyser/working_distance): -DEBUG - value: 4 +DEBUG - value: 4 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXdetector'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//entry/instrument/analyser/working_distance@units) -DEBUG - value: mm +DEBUG - value: mm DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXdetector'] DEBUG - NOT IN SCHEMA DEBUG - @@ -1002,7 +1002,7 @@ DEBUG - respectively) that exists within the same group. DEBUG - ===== ATTRS (//entry/instrument/beam_probe_0@NX_class) -DEBUG - value: NXbeam +DEBUG - value: NXbeam DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXbeam'] DEBUG - classes: NXinstrument.nxdl.xml:/BEAM @@ -1011,7 +1011,7 @@ NXobject.nxdl.xml: DEBUG - @NX_class [NX_CHAR] DEBUG - DEBUG - ===== FIELD (//entry/instrument/beam_probe_0/distance): -DEBUG - value: 0 +DEBUG - value: 0 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXbeam', 'NX_FLOAT'] DEBUG - classes: NXbeam.nxdl.xml:/distance @@ -1019,38 +1019,38 @@ DEBUG - <> DEBUG - documentation (NXbeam.nxdl.xml:/distance): DEBUG - Distance from sample. Note, it is recommended to use NXtransformations instead. DEBUG - ===== ATTRS (//entry/instrument/beam_probe_0/distance@units) -DEBUG - value: cm +DEBUG - value: cm DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXbeam', 'NX_FLOAT'] DEBUG - classes: NXbeam.nxdl.xml:/distance DEBUG - NXbeam.nxdl.xml:/distance@units [NX_LENGTH] DEBUG - ===== FIELD (//entry/instrument/beam_probe_0/photon_energy): -DEBUG - value: 36.49699020385742 +DEBUG - value: 36.4969902 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXbeam'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//entry/instrument/beam_probe_0/photon_energy@units) -DEBUG - value: eV +DEBUG - value: eV DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXbeam'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/instrument/beam_probe_0/polarization_angle): -DEBUG - value: 0.0 +DEBUG - value: 0.0 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXbeam'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//entry/instrument/beam_probe_0/polarization_angle@units) -DEBUG - value: deg +DEBUG - value: deg DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXbeam'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/instrument/beam_probe_0/polarization_ellipticity): -DEBUG - value: 0.0 +DEBUG - value: 0.0 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXbeam'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/instrument/beam_probe_0/pulse_duration): -DEBUG - value: 70 +DEBUG - value: 70 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXbeam', 'NX_FLOAT'] DEBUG - classes: NXbeam.nxdl.xml:/pulse_duration @@ -1060,28 +1060,28 @@ DEBUG - FWHM duration of the pulses at the given location. DEBUG - ===== ATTRS (//entry/instrument/beam_probe_0/pulse_duration@units) -DEBUG - value: fs +DEBUG - value: fs DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXbeam', 'NX_FLOAT'] DEBUG - classes: NXbeam.nxdl.xml:/pulse_duration DEBUG - NXbeam.nxdl.xml:/pulse_duration@units [NX_TIME] DEBUG - ===== FIELD (//entry/instrument/beam_probe_0/size_x): -DEBUG - value: 500 +DEBUG - value: 500 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXbeam'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//entry/instrument/beam_probe_0/size_x@units) -DEBUG - value: um +DEBUG - value: um DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXbeam'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/instrument/beam_probe_0/size_y): -DEBUG - value: 200 +DEBUG - value: 200 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXbeam'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//entry/instrument/beam_probe_0/size_y@units) -DEBUG - value: um +DEBUG - value: um DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXbeam'] DEBUG - NOT IN SCHEMA DEBUG - @@ -1122,7 +1122,7 @@ DEBUG - respectively) that exists within the same group. DEBUG - ===== ATTRS (//entry/instrument/beam_pump_0@NX_class) -DEBUG - value: NXbeam +DEBUG - value: NXbeam DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXbeam'] DEBUG - classes: NXinstrument.nxdl.xml:/BEAM @@ -1131,7 +1131,7 @@ NXobject.nxdl.xml: DEBUG - @NX_class [NX_CHAR] DEBUG - DEBUG - ===== FIELD (//entry/instrument/beam_pump_0/average_power): -DEBUG - value: 6.21289 +DEBUG - value: 6.21289 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXbeam', 'NX_FLOAT'] DEBUG - classes: NXbeam.nxdl.xml:/average_power @@ -1141,23 +1141,23 @@ DEBUG - Average power at the at the given location. DEBUG - ===== ATTRS (//entry/instrument/beam_pump_0/average_power@units) -DEBUG - value: uW +DEBUG - value: uW DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXbeam', 'NX_FLOAT'] DEBUG - classes: NXbeam.nxdl.xml:/average_power DEBUG - NXbeam.nxdl.xml:/average_power@units [NX_POWER] DEBUG - ===== FIELD (//entry/instrument/beam_pump_0/center_wavelength): -DEBUG - value: 800 +DEBUG - value: 800 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXbeam'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//entry/instrument/beam_pump_0/center_wavelength@units) -DEBUG - value: nm +DEBUG - value: nm DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXbeam'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/instrument/beam_pump_0/distance): -DEBUG - value: 0 +DEBUG - value: 0 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXbeam', 'NX_FLOAT'] DEBUG - classes: NXbeam.nxdl.xml:/distance @@ -1165,13 +1165,13 @@ DEBUG - <> DEBUG - documentation (NXbeam.nxdl.xml:/distance): DEBUG - Distance from sample. Note, it is recommended to use NXtransformations instead. DEBUG - ===== ATTRS (//entry/instrument/beam_pump_0/distance@units) -DEBUG - value: cm +DEBUG - value: cm DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXbeam', 'NX_FLOAT'] DEBUG - classes: NXbeam.nxdl.xml:/distance DEBUG - NXbeam.nxdl.xml:/distance@units [NX_LENGTH] DEBUG - ===== FIELD (//entry/instrument/beam_pump_0/fluence): -DEBUG - value: 5 +DEBUG - value: 5 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXbeam', 'NX_FLOAT'] DEBUG - classes: NXbeam.nxdl.xml:/fluence @@ -1181,38 +1181,38 @@ DEBUG - Incident energy fluence at the given location. DEBUG - ===== ATTRS (//entry/instrument/beam_pump_0/fluence@units) -DEBUG - value: mJ/cm^2 +DEBUG - value: mJ/cm^2 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXbeam', 'NX_FLOAT'] DEBUG - classes: NXbeam.nxdl.xml:/fluence DEBUG - NXbeam.nxdl.xml:/fluence@units [mJ/cm^2] DEBUG - ===== FIELD (//entry/instrument/beam_pump_0/photon_energy): -DEBUG - value: 1.55 +DEBUG - value: 1.55 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXbeam'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//entry/instrument/beam_pump_0/photon_energy@units) -DEBUG - value: eV +DEBUG - value: eV DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXbeam'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/instrument/beam_pump_0/polarization_angle): -DEBUG - value: nan +DEBUG - value: nan DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXbeam'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//entry/instrument/beam_pump_0/polarization_angle@units) -DEBUG - value: deg +DEBUG - value: deg DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXbeam'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/instrument/beam_pump_0/polarization_ellipticity): -DEBUG - value: -1.0 +DEBUG - value: -1 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXbeam'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/instrument/beam_pump_0/pulse_duration): -DEBUG - value: 50 +DEBUG - value: 50 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXbeam', 'NX_FLOAT'] DEBUG - classes: NXbeam.nxdl.xml:/pulse_duration @@ -1222,13 +1222,13 @@ DEBUG - FWHM duration of the pulses at the given location. DEBUG - ===== ATTRS (//entry/instrument/beam_pump_0/pulse_duration@units) -DEBUG - value: fs +DEBUG - value: fs DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXbeam', 'NX_FLOAT'] DEBUG - classes: NXbeam.nxdl.xml:/pulse_duration DEBUG - NXbeam.nxdl.xml:/pulse_duration@units [NX_TIME] DEBUG - ===== FIELD (//entry/instrument/beam_pump_0/pulse_energy): -DEBUG - value: 1.24258 +DEBUG - value: 1.24258 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXbeam', 'NX_FLOAT'] DEBUG - classes: NXbeam.nxdl.xml:/pulse_energy @@ -1238,38 +1238,38 @@ DEBUG - Energy of a single pulse at the given location. DEBUG - ===== ATTRS (//entry/instrument/beam_pump_0/pulse_energy@units) -DEBUG - value: nJ +DEBUG - value: nJ DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXbeam', 'NX_FLOAT'] DEBUG - classes: NXbeam.nxdl.xml:/pulse_energy DEBUG - NXbeam.nxdl.xml:/pulse_energy@units [NX_ENERGY] DEBUG - ===== FIELD (//entry/instrument/beam_pump_0/size_x): -DEBUG - value: 500 +DEBUG - value: 500 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXbeam'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//entry/instrument/beam_pump_0/size_x@units) -DEBUG - value: um +DEBUG - value: um DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXbeam'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/instrument/beam_pump_0/size_y): -DEBUG - value: 200 +DEBUG - value: 200 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXbeam'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//entry/instrument/beam_pump_0/size_y@units) -DEBUG - value: um +DEBUG - value: um DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXbeam'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/instrument/energy_resolution): -DEBUG - value: 100 +DEBUG - value: 100 DEBUG - classpath: ['NXentry', 'NXinstrument'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//entry/instrument/energy_resolution@units) -DEBUG - value: meV +DEBUG - value: meV DEBUG - classpath: ['NXentry', 'NXinstrument'] DEBUG - NOT IN SCHEMA DEBUG - @@ -1301,7 +1301,7 @@ DEBUG - respectively) that exists within the same group. DEBUG - ===== ATTRS (//entry/instrument/manipulator@NX_class) -DEBUG - value: NXpositioner +DEBUG - value: NXpositioner DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXpositioner'] DEBUG - classes: NXinstrument.nxdl.xml:/POSITIONER @@ -1311,97 +1311,97 @@ NXobject.nxdl.xml: DEBUG - @NX_class [NX_CHAR] DEBUG - DEBUG - ===== FIELD (//entry/instrument/manipulator/pos_x1): -DEBUG - value: 11.3 +DEBUG - value: 11.3 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXpositioner'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//entry/instrument/manipulator/pos_x1@units) -DEBUG - value: um +DEBUG - value: um DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXpositioner'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/instrument/manipulator/pos_x2): -DEBUG - value: 11.3 +DEBUG - value: 11.3 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXpositioner'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//entry/instrument/manipulator/pos_x2@units) -DEBUG - value: um +DEBUG - value: um DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXpositioner'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/instrument/manipulator/pos_y): -DEBUG - value: 7.2 +DEBUG - value: 7.2 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXpositioner'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//entry/instrument/manipulator/pos_y@units) -DEBUG - value: um +DEBUG - value: um DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXpositioner'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/instrument/manipulator/pos_z1): -DEBUG - value: 20.77 +DEBUG - value: 20.77 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXpositioner'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//entry/instrument/manipulator/pos_z1@units) -DEBUG - value: um +DEBUG - value: um DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXpositioner'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/instrument/manipulator/pos_z2): -DEBUG - value: 21.2 +DEBUG - value: 21.2 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXpositioner'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//entry/instrument/manipulator/pos_z2@units) -DEBUG - value: um +DEBUG - value: um DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXpositioner'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/instrument/manipulator/pos_z3): -DEBUG - value: 20.22 +DEBUG - value: 20.22 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXpositioner'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//entry/instrument/manipulator/pos_z3@units) -DEBUG - value: um +DEBUG - value: um DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXpositioner'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/instrument/manipulator/sample_bias): -DEBUG - value: 29 +DEBUG - value: 29 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXpositioner'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//entry/instrument/manipulator/sample_bias@target) -DEBUG - value: /entry/instrument/manipulator/sample_bias +DEBUG - value: /entry/instrument/manipulator/sample_bias DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXpositioner'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//entry/instrument/manipulator/sample_bias@units) -DEBUG - value: V +DEBUG - value: V DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXpositioner'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/instrument/manipulator/sample_temperature): -DEBUG - value: 300 +DEBUG - value: 300 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXpositioner'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//entry/instrument/manipulator/sample_temperature@target) -DEBUG - value: /entry/instrument/manipulator/sample_temperature +DEBUG - value: /entry/instrument/manipulator/sample_temperature DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXpositioner'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//entry/instrument/manipulator/sample_temperature@units) -DEBUG - value: K +DEBUG - value: K DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXpositioner'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/instrument/manipulator/type): -DEBUG - value: Hexapod +DEBUG - value: Hexapod DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXpositioner'] DEBUG - NOT IN SCHEMA DEBUG - @@ -1447,7 +1447,7 @@ DEBUG - respectively) that exists within the same group. DEBUG - ===== ATTRS (//entry/instrument/monochromator@NX_class) -DEBUG - value: NXmonochromator +DEBUG - value: NXmonochromator DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXmonochromator'] DEBUG - classes: NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/monochromator @@ -1458,7 +1458,7 @@ NXobject.nxdl.xml: DEBUG - @NX_class [NX_CHAR] DEBUG - DEBUG - ===== FIELD (//entry/instrument/monochromator/energy): -DEBUG - value: 36.49699020385742 +DEBUG - value: 36.4969902 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXmonochromator', 'NX_NUMBER'] DEBUG - classes: NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/monochromator/energy @@ -1466,13 +1466,13 @@ DEBUG - <> DEBUG - documentation (NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/monochromator/energy): DEBUG - DEBUG - ===== ATTRS (//entry/instrument/monochromator/energy@units) -DEBUG - value: eV +DEBUG - value: eV DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXmonochromator', 'NX_NUMBER'] DEBUG - classes: NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/monochromator/energy DEBUG - NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/monochromator/energy@units [NX_ENERGY] DEBUG - ===== FIELD (//entry/instrument/monochromator/energy_error): -DEBUG - value: 0.21867309510707855 +DEBUG - value: 0.2186731 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXmonochromator', 'NX_FLOAT'] DEBUG - classes: NXmonochromator.nxdl.xml:/energy_error @@ -1481,7 +1481,7 @@ DEBUG - DEPRECATED - see https://github.com/nexusformat/definitions/issues/820 DEBUG - documentation (NXmonochromator.nxdl.xml:/energy_error): DEBUG - energy standard deviation DEBUG - ===== ATTRS (//entry/instrument/monochromator/energy_error@units) -DEBUG - value: eV +DEBUG - value: eV DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXmonochromator', 'NX_FLOAT'] DEBUG - classes: NXmonochromator.nxdl.xml:/energy_error @@ -1491,22 +1491,22 @@ DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXmonochromator'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//entry/instrument/monochromator/slit@NX_class) -DEBUG - value: NXslit +DEBUG - value: NXslit DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXmonochromator'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/instrument/monochromator/slit/y_gap): -DEBUG - value: 2000.04833984375 +DEBUG - value: 2000.04833984 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXmonochromator'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//entry/instrument/monochromator/slit/y_gap@units) -DEBUG - value: um +DEBUG - value: um DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXmonochromator'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/instrument/name): -DEBUG - value: HEXTOF @ PG-2, Flash +DEBUG - value: HEXTOF @ PG-2, Flash DEBUG - classpath: ['NXentry', 'NXinstrument', 'NX_CHAR'] DEBUG - classes: NXinstrument.nxdl.xml:/name @@ -1547,7 +1547,7 @@ DEBUG - respectively) that exists within the same group. DEBUG - ===== ATTRS (//entry/instrument/source@NX_class) -DEBUG - value: NXsource +DEBUG - value: NXsource DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXsource'] DEBUG - classes: NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/SOURCE @@ -1558,7 +1558,7 @@ NXobject.nxdl.xml: DEBUG - @NX_class [NX_CHAR] DEBUG - DEBUG - ===== FIELD (//entry/instrument/source/bunch_distance): -DEBUG - value: 1 +DEBUG - value: 1 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXsource', 'NX_FLOAT'] DEBUG - classes: NXsource.nxdl.xml:/bunch_distance @@ -1566,13 +1566,13 @@ DEBUG - <> DEBUG - documentation (NXsource.nxdl.xml:/bunch_distance): DEBUG - For storage rings, time between bunches DEBUG - ===== ATTRS (//entry/instrument/source/bunch_distance@units) -DEBUG - value: us +DEBUG - value: us DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXsource', 'NX_FLOAT'] DEBUG - classes: NXsource.nxdl.xml:/bunch_distance DEBUG - NXsource.nxdl.xml:/bunch_distance@units [NX_TIME] DEBUG - ===== FIELD (//entry/instrument/source/bunch_length): -DEBUG - value: 100 +DEBUG - value: 100 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXsource', 'NX_FLOAT'] DEBUG - classes: NXsource.nxdl.xml:/bunch_length @@ -1580,43 +1580,43 @@ DEBUG - <> DEBUG - documentation (NXsource.nxdl.xml:/bunch_length): DEBUG - For storage rings, temporal length of the bunch DEBUG - ===== ATTRS (//entry/instrument/source/bunch_length@units) -DEBUG - value: fs +DEBUG - value: fs DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXsource', 'NX_FLOAT'] DEBUG - classes: NXsource.nxdl.xml:/bunch_length DEBUG - NXsource.nxdl.xml:/bunch_length@units [NX_TIME] DEBUG - ===== FIELD (//entry/instrument/source/burst_distance): -DEBUG - value: 199.5 +DEBUG - value: 199.5 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXsource'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//entry/instrument/source/burst_distance@units) -DEBUG - value: ms +DEBUG - value: ms DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXsource'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/instrument/source/burst_length): -DEBUG - value: 500 +DEBUG - value: 500 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXsource'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//entry/instrument/source/burst_length@units) -DEBUG - value: us +DEBUG - value: us DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXsource'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/instrument/source/burst_number_end): -DEBUG - value: 102680129 +DEBUG - value: 102680129 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXsource'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/instrument/source/burst_number_start): -DEBUG - value: 102644001 +DEBUG - value: 102644001 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXsource'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/instrument/source/current): -DEBUG - value: 1 +DEBUG - value: 1 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXsource', 'NX_FLOAT'] DEBUG - classes: NXsource.nxdl.xml:/current @@ -1624,13 +1624,13 @@ DEBUG - <> DEBUG - documentation (NXsource.nxdl.xml:/current): DEBUG - Accelerator, X-ray tube, or storage ring current DEBUG - ===== ATTRS (//entry/instrument/source/current@units) -DEBUG - value: uA +DEBUG - value: uA DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXsource', 'NX_FLOAT'] DEBUG - classes: NXsource.nxdl.xml:/current DEBUG - NXsource.nxdl.xml:/current@units [NX_CURRENT] DEBUG - ===== FIELD (//entry/instrument/source/energy): -DEBUG - value: 427 +DEBUG - value: 427 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXsource', 'NX_FLOAT'] DEBUG - classes: NXsource.nxdl.xml:/energy @@ -1642,13 +1642,13 @@ DEBUG - the particle beam energy. DEBUG - ===== ATTRS (//entry/instrument/source/energy@units) -DEBUG - value: MeV +DEBUG - value: MeV DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXsource', 'NX_FLOAT'] DEBUG - classes: NXsource.nxdl.xml:/energy DEBUG - NXsource.nxdl.xml:/energy@units [NX_ENERGY] DEBUG - ===== FIELD (//entry/instrument/source/frequency): -DEBUG - value: 10 +DEBUG - value: 10 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXsource', 'NX_FLOAT'] DEBUG - classes: NXsource.nxdl.xml:/frequency @@ -1656,13 +1656,13 @@ DEBUG - <> DEBUG - documentation (NXsource.nxdl.xml:/frequency): DEBUG - Frequency of pulsed source DEBUG - ===== ATTRS (//entry/instrument/source/frequency@units) -DEBUG - value: Hz +DEBUG - value: Hz DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXsource', 'NX_FLOAT'] DEBUG - classes: NXsource.nxdl.xml:/frequency DEBUG - NXsource.nxdl.xml:/frequency@units [NX_FREQUENCY] DEBUG - ===== FIELD (//entry/instrument/source/mode): -DEBUG - value: Burst +DEBUG - value: Burst DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXsource', 'NX_CHAR'] DEBUG - classes: NXsource.nxdl.xml:/mode @@ -1673,7 +1673,7 @@ DEBUG - -> Multi Bunch DEBUG - documentation (NXsource.nxdl.xml:/mode): DEBUG - source operating mode DEBUG - ===== FIELD (//entry/instrument/source/name): -DEBUG - value: FLASH +DEBUG - value: FLASH DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXsource', 'NX_CHAR'] DEBUG - classes: NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/SOURCE/name @@ -1689,7 +1689,7 @@ DEBUG - Name of the component. DEBUG - ===== FIELD (//entry/instrument/source/number_of_bunches): -DEBUG - value: 500 +DEBUG - value: 500 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXsource', 'NX_INT'] DEBUG - classes: NXsource.nxdl.xml:/number_of_bunches @@ -1697,12 +1697,12 @@ DEBUG - <> DEBUG - documentation (NXsource.nxdl.xml:/number_of_bunches): DEBUG - For storage rings, the number of bunches in use. DEBUG - ===== FIELD (//entry/instrument/source/number_of_bursts): -DEBUG - value: 1 +DEBUG - value: 1 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXsource'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/instrument/source/probe): -DEBUG - value: x-ray +DEBUG - value: x-ray DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXsource', 'NX_CHAR'] DEBUG - classes: NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/SOURCE/probe @@ -1725,7 +1725,7 @@ DEBUG - DEBUG - documentation (NXsource.nxdl.xml:/probe): DEBUG - type of radiation probe (pick one from the enumerated list and spell exactly) DEBUG - ===== FIELD (//entry/instrument/source/top_up): -DEBUG - value: True +DEBUG - value: True DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXsource', 'NX_BOOLEAN'] DEBUG - classes: NXsource.nxdl.xml:/top_up @@ -1733,7 +1733,7 @@ DEBUG - <> DEBUG - documentation (NXsource.nxdl.xml:/top_up): DEBUG - Is the synchrotron operating in top_up mode? DEBUG - ===== FIELD (//entry/instrument/source/type): -DEBUG - value: Free Electron Laser +DEBUG - value: Free Electron Laser DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXsource', 'NX_CHAR'] DEBUG - classes: NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/SOURCE/type @@ -1800,7 +1800,7 @@ DEBUG - respectively) that exists within the same group. DEBUG - ===== ATTRS (//entry/instrument/source_pump@NX_class) -DEBUG - value: NXsource +DEBUG - value: NXsource DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXsource'] DEBUG - classes: NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/SOURCE @@ -1811,7 +1811,7 @@ NXobject.nxdl.xml: DEBUG - @NX_class [NX_CHAR] DEBUG - DEBUG - ===== FIELD (//entry/instrument/source_pump/bunch_distance): -DEBUG - value: 1 +DEBUG - value: 1 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXsource', 'NX_FLOAT'] DEBUG - classes: NXsource.nxdl.xml:/bunch_distance @@ -1819,13 +1819,13 @@ DEBUG - <> DEBUG - documentation (NXsource.nxdl.xml:/bunch_distance): DEBUG - For storage rings, time between bunches DEBUG - ===== ATTRS (//entry/instrument/source_pump/bunch_distance@units) -DEBUG - value: us +DEBUG - value: us DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXsource', 'NX_FLOAT'] DEBUG - classes: NXsource.nxdl.xml:/bunch_distance DEBUG - NXsource.nxdl.xml:/bunch_distance@units [NX_TIME] DEBUG - ===== FIELD (//entry/instrument/source_pump/bunch_length): -DEBUG - value: 50 +DEBUG - value: 50 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXsource', 'NX_FLOAT'] DEBUG - classes: NXsource.nxdl.xml:/bunch_length @@ -1833,33 +1833,33 @@ DEBUG - <> DEBUG - documentation (NXsource.nxdl.xml:/bunch_length): DEBUG - For storage rings, temporal length of the bunch DEBUG - ===== ATTRS (//entry/instrument/source_pump/bunch_length@units) -DEBUG - value: fs +DEBUG - value: fs DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXsource', 'NX_FLOAT'] DEBUG - classes: NXsource.nxdl.xml:/bunch_length DEBUG - NXsource.nxdl.xml:/bunch_length@units [NX_TIME] DEBUG - ===== FIELD (//entry/instrument/source_pump/burst_distance): -DEBUG - value: 199.6 +DEBUG - value: 199.6 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXsource'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//entry/instrument/source_pump/burst_distance@units) -DEBUG - value: ms +DEBUG - value: ms DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXsource'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/instrument/source_pump/burst_length): -DEBUG - value: 400 +DEBUG - value: 400 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXsource'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//entry/instrument/source_pump/burst_length@units) -DEBUG - value: us +DEBUG - value: us DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXsource'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/instrument/source_pump/frequency): -DEBUG - value: 10 +DEBUG - value: 10 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXsource', 'NX_FLOAT'] DEBUG - classes: NXsource.nxdl.xml:/frequency @@ -1867,13 +1867,13 @@ DEBUG - <> DEBUG - documentation (NXsource.nxdl.xml:/frequency): DEBUG - Frequency of pulsed source DEBUG - ===== ATTRS (//entry/instrument/source_pump/frequency@units) -DEBUG - value: Hz +DEBUG - value: Hz DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXsource', 'NX_FLOAT'] DEBUG - classes: NXsource.nxdl.xml:/frequency DEBUG - NXsource.nxdl.xml:/frequency@units [NX_FREQUENCY] DEBUG - ===== FIELD (//entry/instrument/source_pump/mode): -DEBUG - value: Burst +DEBUG - value: Burst DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXsource', 'NX_CHAR'] DEBUG - classes: NXsource.nxdl.xml:/mode @@ -1884,7 +1884,7 @@ DEBUG - -> Multi Bunch DEBUG - documentation (NXsource.nxdl.xml:/mode): DEBUG - source operating mode DEBUG - ===== FIELD (//entry/instrument/source_pump/name): -DEBUG - value: User Laser @ FLASH +DEBUG - value: User Laser @ FLASH DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXsource', 'NX_CHAR'] DEBUG - classes: NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/SOURCE/name @@ -1900,7 +1900,7 @@ DEBUG - Name of the component. DEBUG - ===== FIELD (//entry/instrument/source_pump/number_of_bunches): -DEBUG - value: 400 +DEBUG - value: 400 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXsource', 'NX_INT'] DEBUG - classes: NXsource.nxdl.xml:/number_of_bunches @@ -1908,12 +1908,12 @@ DEBUG - <> DEBUG - documentation (NXsource.nxdl.xml:/number_of_bunches): DEBUG - For storage rings, the number of bunches in use. DEBUG - ===== FIELD (//entry/instrument/source_pump/number_of_bursts): -DEBUG - value: 1 +DEBUG - value: 1 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXsource'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/instrument/source_pump/probe): -DEBUG - value: NIR +DEBUG - value: NIR DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXsource', 'NX_CHAR'] DEBUG - classes: NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/SOURCE/probe @@ -1936,17 +1936,17 @@ DEBUG - DEBUG - documentation (NXsource.nxdl.xml:/probe): DEBUG - type of radiation probe (pick one from the enumerated list and spell exactly) DEBUG - ===== FIELD (//entry/instrument/source_pump/rms_jitter): -DEBUG - value: 204.68816194453154 +DEBUG - value: 204.68816194 DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXsource'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//entry/instrument/source_pump/rms_jitter@units) -DEBUG - value: fs +DEBUG - value: fs DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXsource'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/instrument/source_pump/type): -DEBUG - value: OPCPA +DEBUG - value: OPCPA DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXsource', 'NX_CHAR'] DEBUG - classes: NXarpes.nxdl.xml:/ENTRY/INSTRUMENT/SOURCE/type @@ -1980,27 +1980,27 @@ DEBUG - DEBUG - documentation (NXsource.nxdl.xml:/type): DEBUG - type of radiation source (pick one from the enumerated list and spell exactly) DEBUG - ===== FIELD (//entry/instrument/spatial_resolution): -DEBUG - value: 500 +DEBUG - value: 500 DEBUG - classpath: ['NXentry', 'NXinstrument'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//entry/instrument/spatial_resolution@units) -DEBUG - value: um +DEBUG - value: um DEBUG - classpath: ['NXentry', 'NXinstrument'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/instrument/temporal_resolution): -DEBUG - value: 100 +DEBUG - value: 100 DEBUG - classpath: ['NXentry', 'NXinstrument'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//entry/instrument/temporal_resolution@units) -DEBUG - value: fs +DEBUG - value: fs DEBUG - classpath: ['NXentry', 'NXinstrument'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/run_cycle): -DEBUG - value: 2018 User Run Block 2 +DEBUG - value: 2018 User Run Block 2 DEBUG - classpath: ['NXentry', 'NX_CHAR'] DEBUG - classes: NXentry.nxdl.xml:/run_cycle @@ -2042,7 +2042,7 @@ DEBUG - respectively) that exists within the same group. DEBUG - ===== ATTRS (//entry/sample@NX_class) -DEBUG - value: NXsample +DEBUG - value: NXsample DEBUG - classpath: ['NXentry', 'NXsample'] DEBUG - classes: NXarpes.nxdl.xml:/ENTRY/SAMPLE @@ -2053,42 +2053,42 @@ NXobject.nxdl.xml: DEBUG - @NX_class [NX_CHAR] DEBUG - DEBUG - ===== FIELD (//entry/sample/bias): -DEBUG - value: 29 +DEBUG - value: 29 DEBUG - classpath: ['NXentry', 'NXsample'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//entry/sample/bias@target) -DEBUG - value: /entry/instrument/manipulator/sample_bias +DEBUG - value: /entry/instrument/manipulator/sample_bias DEBUG - classpath: ['NXentry', 'NXsample'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//entry/sample/bias@units) -DEBUG - value: V +DEBUG - value: V DEBUG - classpath: ['NXentry', 'NXsample'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/sample/chem_id_cas): -DEBUG - value: 12067-46-8 +DEBUG - value: 12067-46-8 DEBUG - classpath: ['NXentry', 'NXsample'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/sample/chemical_name): -DEBUG - value: Tungsten diselenide +DEBUG - value: Tungsten diselenide DEBUG - classpath: ['NXentry', 'NXsample'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/sample/growth_method): -DEBUG - value: Chemical Vapor Deposition +DEBUG - value: Chemical Vapor Deposition DEBUG - classpath: ['NXentry', 'NXsample'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/sample/layer): -DEBUG - value: bulk +DEBUG - value: bulk DEBUG - classpath: ['NXentry', 'NXsample'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/sample/name): -DEBUG - value: WSe2 +DEBUG - value: WSe2 DEBUG - classpath: ['NXentry', 'NXsample', 'NX_CHAR'] DEBUG - classes: NXarpes.nxdl.xml:/ENTRY/SAMPLE/name @@ -2104,12 +2104,12 @@ DEBUG - Name of the component. DEBUG - ===== FIELD (//entry/sample/preparation_method): -DEBUG - value: in-vacuum cleave +DEBUG - value: in-vacuum cleave DEBUG - classpath: ['NXentry', 'NXsample'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/sample/pressure): -DEBUG - value: 3.27e-10 +DEBUG - value: 3.27000000e-10 DEBUG - classpath: ['NXentry', 'NXsample', 'NX_FLOAT'] DEBUG - classes: NXsample.nxdl.xml:/pressure @@ -2117,28 +2117,28 @@ DEBUG - <> DEBUG - documentation (NXsample.nxdl.xml:/pressure): DEBUG - Applied pressure DEBUG - ===== ATTRS (//entry/sample/pressure@units) -DEBUG - value: mbar +DEBUG - value: mbar DEBUG - classpath: ['NXentry', 'NXsample', 'NX_FLOAT'] DEBUG - classes: NXsample.nxdl.xml:/pressure DEBUG - NXsample.nxdl.xml:/pressure@units [NX_PRESSURE] DEBUG - ===== FIELD (//entry/sample/purity): -DEBUG - value: 0.999 +DEBUG - value: 0.999 DEBUG - classpath: ['NXentry', 'NXsample'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/sample/state): -DEBUG - value: monocrystalline solid +DEBUG - value: monocrystalline solid DEBUG - classpath: ['NXentry', 'NXsample'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/sample/surface_orientation): -DEBUG - value: 0001 +DEBUG - value: 0001 DEBUG - classpath: ['NXentry', 'NXsample'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/sample/temperature): -DEBUG - value: 300 +DEBUG - value: 300 DEBUG - classpath: ['NXentry', 'NXsample', 'NX_NUMBER'] DEBUG - classes: NXarpes.nxdl.xml:/ENTRY/SAMPLE/temperature @@ -2146,20 +2146,20 @@ DEBUG - <> DEBUG - documentation (NXarpes.nxdl.xml:/ENTRY/SAMPLE/temperature): DEBUG - DEBUG - ===== ATTRS (//entry/sample/temperature@target) -DEBUG - value: /entry/instrument/manipulator/sample_temperature +DEBUG - value: /entry/instrument/manipulator/sample_temperature DEBUG - classpath: ['NXentry', 'NXsample', 'NX_NUMBER'] DEBUG - classes: NXarpes.nxdl.xml:/ENTRY/SAMPLE/temperature DEBUG - @target - IS NOT IN SCHEMA DEBUG - DEBUG - ===== ATTRS (//entry/sample/temperature@units) -DEBUG - value: K +DEBUG - value: K DEBUG - classpath: ['NXentry', 'NXsample', 'NX_NUMBER'] DEBUG - classes: NXarpes.nxdl.xml:/ENTRY/SAMPLE/temperature DEBUG - NXarpes.nxdl.xml:/ENTRY/SAMPLE/temperature@units [NX_TEMPERATURE] DEBUG - ===== FIELD (//entry/sample/thickness): -DEBUG - value: 0.5 +DEBUG - value: 0.5 DEBUG - classpath: ['NXentry', 'NXsample', 'NX_FLOAT'] DEBUG - classes: NXsample.nxdl.xml:/thickness @@ -2167,18 +2167,18 @@ DEBUG - <> DEBUG - documentation (NXsample.nxdl.xml:/thickness): DEBUG - sample thickness DEBUG - ===== ATTRS (//entry/sample/thickness@units) -DEBUG - value: mm +DEBUG - value: mm DEBUG - classpath: ['NXentry', 'NXsample', 'NX_FLOAT'] DEBUG - classes: NXsample.nxdl.xml:/thickness DEBUG - NXsample.nxdl.xml:/thickness@units [NX_LENGTH] DEBUG - ===== FIELD (//entry/sample/vendor): -DEBUG - value: HQ Graphene +DEBUG - value: HQ Graphene DEBUG - classpath: ['NXentry', 'NXsample'] DEBUG - NOT IN SCHEMA DEBUG - DEBUG - ===== FIELD (//entry/start_time): -DEBUG - value: 2018-05-01T07:22:00+02:00 +DEBUG - value: 2018-05-01T07:22:00+02:00 DEBUG - classpath: ['NXentry', 'NX_DATE_TIME'] DEBUG - classes: NXarpes.nxdl.xml:/ENTRY/start_time @@ -2189,7 +2189,7 @@ DEBUG - DEBUG - documentation (NXentry.nxdl.xml:/start_time): DEBUG - Starting time of measurement DEBUG - ===== FIELD (//entry/title): -DEBUG - value: Excited-state dynamics of WSe2 in the Valence Band and Core-Levels +DEBUG - value: Excited-state dynamics of WSe2 in the Valence Band and Core-Levels DEBUG - classpath: ['NXentry', 'NX_CHAR'] DEBUG - classes: NXarpes.nxdl.xml:/ENTRY/title @@ -2208,20 +2208,20 @@ DEBUG - DEBUG - NXdata group has been identified: /entry/data DEBUG - ===== GROUP (//entry/data [NXarpes::/NXentry/NXdata]): DEBUG - ===== ATTRS (//entry/data@NX_class) -DEBUG - value: NXdata +DEBUG - value: NXdata DEBUG - ===== ATTRS (//entry/data@axes) -DEBUG - value: ['angles' 'energies' 'delays'] +DEBUG - value: [angles, energies, delays] DEBUG - ===== ATTRS (//entry/data@signal) -DEBUG - value: data +DEBUG - value: data DEBUG - DEBUG - Signal has been identified: /entry/data/data DEBUG - ===== FIELD (//entry/data/data): -DEBUG - value: [[0. 0. 0. ... 0. 0. 0.] ... +DEBUG - value: [[0.0, 0.0, 0.0, ..., 0.0, 0.0, 0.0], ... DEBUG - Dataset referenced as NXdata SIGNAL DEBUG - ===== ATTRS (//entry/data/data@target) -DEBUG - value: /entry/instrument/analyser/data +DEBUG - value: /entry/instrument/analyser/data DEBUG - ===== ATTRS (//entry/data/data@units) -DEBUG - value: counts +DEBUG - value: counts DEBUG - DEBUG - For Axis #0, 1 axes have been identified: [] DEBUG - diff --git a/tests/nexus/test_nexus.py b/tests/nexus/test_nexus.py index b8b34f4dd..38126525d 100644 --- a/tests/nexus/test_nexus.py +++ b/tests/nexus/test_nexus.py @@ -32,7 +32,7 @@ get_nx_classes, get_nx_units, ) -from pynxtools.nexus.nexus import HandleNexus, decode_if_string +from pynxtools.nexus.nexus import HandleNexus, decode_if_string, safe_str logger = logging.getLogger(__name__) @@ -139,6 +139,81 @@ def test_decode_if_string(string_obj, decode, expected): assert result == expected, f"Failed for {string_obj} with decode={decode}" +@pytest.mark.parametrize( + "value,precision,expected_contains", + [ + # --- Floats --- + (0.0, 8, "0.0"), + (-0.0, 8, "-0.0"), # preserve binary zero sign + (0.00000001, 8, "0.00000001"), # not treated as zero + (-0.00000001, 8, "-0.00000001"), + (-0.00000001, 8, "-0.00000001"), + (0.000000001, 8, "1.00000000e-09"), + (1e-9, 8, "1.00000000e-09"), + (1e-15, 8, "1.00000000e-15"), + (-1e-15, 8, "-1.00000000e-15"), + (1.0, 8, "1"), + (1.5, 8, "1.5"), + (1.23456789, 8, "1.23456789"), + (1.234567891, 8, "1.23456789"), + (123456789.0, 8, "123456789"), + # # --- Integers / booleans --- + (0, 8, "0"), + (42, 8, "42"), + (-3, 8, "-3"), + (True, 8, "True"), + (False, 8, "False"), + # # --- Strings / bytes --- + ("hello", 8, "hello"), + (b"hello", 8, "hello"), + (b"\xff", 8, "�"), # invalid UTF-8 safely replaced + # # --- NumPy scalars and 0D arrays --- + (np.array(1.5), 8, "1.5"), + (np.array(1), 8, "1"), + (np.array(True), 8, "True"), + (np.float64(2.0), 8, "2"), + (np.int32(10), 8, "10"), + # # --- NumPy arrays --- + (np.array([0.0, 1.0, 1.25]), 8, "[0.0, 1, 1.25]"), + (np.array([[1.0, 2.0], [3.0, 4.5]]), 8, "[[1, 2],\n [3, 4.5]]"), + (np.array([[1.0000, 2.0000], [3.0000, 4.5000]]), 8, "[[1, 2],\n [3, 4.5]]"), + # # --- Lists / tuples --- + ([1.0, 2.5, [3.0, 4.0]], 8, "[1, 2.5, [3, 4]]"), + ((1.0, 2.0), 8, "[1, 2]"), + # # --- Mixed-type NumPy array --- + (np.array(["a", b"b", 3, 4.5], dtype=object), 8, "[a, b, 3, 4.5]"), + # # --- Nested structures --- + ([[np.array([1.0, 2.0]), [3.0, 4.5]]], 8, "[[[1, 2], [3, 4.5]]]"), + # # --- Custom objects (fallback) --- + (type("Dummy", (), {"__str__": lambda self: "dummy"})(), 8, "dummy"), + # # --- Precision behavior --- + (1.234567891, 4, "1.2346"), + # # --- Extreme float values --- + (1e9, 8, "1000000000"), + (1e-9, 8, "1.00000000e-09"), + ], +) +def test_safe_str(value, precision, expected_contains): + """Test the `safe_str` function. + + This test covers: + - Scalars (float, int, bool, str, bytes) + - NumPy scalars and arrays + - Lists, tuples, and nested structures + - Precision and scientific notation + - Deterministic output across calls + """ + result = safe_str(value, precision) + assert isinstance(result, str), f"Expected string, got {type(result)}" + assert ( + expected_contains == result + ) # , f"{result!r} did not contain {expected_contains!r}" + + # Determinism check + result2 = safe_str(value, precision) + assert result == result2, "safe_str must produce deterministic output" + + def test_get_nexus_classes_units_attributes(): """Check the correct parsing of a separate list for: Nexus classes (base_classes)