From afe7d79c534badfe8b1f93098db442f38722d67d Mon Sep 17 00:00:00 2001 From: Rubel Date: Wed, 22 Nov 2023 10:53:46 +0100 Subject: [PATCH] adding an example for field. --- pynxtools/dataconverter/readers/xrd/config.py | 16 ++++++++++------ .../dataconverter/readers/xrd/xrd_helper.py | 1 + 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/pynxtools/dataconverter/readers/xrd/config.py b/pynxtools/dataconverter/readers/xrd/config.py index 6679aa1c3..d9bcca208 100644 --- a/pynxtools/dataconverter/readers/xrd/config.py +++ b/pynxtools/dataconverter/readers/xrd/config.py @@ -1,14 +1,16 @@ """This is config file that mainly maps nexus definition to data path in raw file.""" +# field: {file_exp: {'value': "", +# '@units': ""},} # pylint: disable=C0301 xrdml_1_5 = { "/ENTRY[entry]/2theta_plot/chi": "", - "/ENTRY[entry]/2theta_plot/intensity": "file:/detector", - "/ENTRY[entry]/2theta_plot/omega": "file:/Omega", + "/ENTRY[entry]/2theta_plot/intensity": {"file": ["/detector"]}, + "/ENTRY[entry]/2theta_plot/omega": {"file": ["/Omega"]}, "/ENTRY[entry]/2theta_plot/phi": "", - "/ENTRY[entry]/2theta_plot/two_theta": "file:/2Theta", - "/ENTRY[entry]/COLLECTION[collection]/beam_attenuation_factors": "file:/beamAttenuationFactors", - "/ENTRY[entry]/COLLECTION[collection]/count_time": "file:/countTime", + "/ENTRY[entry]/2theta_plot/two_theta": {"file": ["/2Theta"]}, + "/ENTRY[entry]/COLLECTION[collection]/beam_attenuation_factors": {"file": ["/beamAttenuationFactors"]}, + "/ENTRY[entry]/COLLECTION[collection]/count_time": {"file": ["/countTime"]}, "/ENTRY[entry]/COLLECTION[collection]/count_time/@units": "", "/ENTRY[entry]/COLLECTION[collection]/data_file": "", "/ENTRY[entry]/COLLECTION[collection]/goniometer_x": "file:/X", @@ -44,5 +46,7 @@ "/ENTRY[entry]/definition": "NXxrd_pan", "/ENTRY[entry]/method": "X-Ray Diffraction (XRD)", "/ENTRY[entry]/q_plot/intensity": "file:/detector", - "/ENTRY[entry]/q_plot/q": "" + "/ENTRY[entry]/q_plot/q": "", + "/@default": "entry", + "/ENTRY[entry]/@default": "2theta_plot", } diff --git a/pynxtools/dataconverter/readers/xrd/xrd_helper.py b/pynxtools/dataconverter/readers/xrd/xrd_helper.py index e3e16711b..2e43a09b2 100644 --- a/pynxtools/dataconverter/readers/xrd/xrd_helper.py +++ b/pynxtools/dataconverter/readers/xrd/xrd_helper.py @@ -1,4 +1,5 @@ """XRD helper stuffs.""" + # Copyright The NOMAD Authors. # # This file is part of NOMAD. See https://nomad-lab.eu for further info.