diff --git a/pynxtools/dataconverter/readers/xrd/config.py b/pynxtools/dataconverter/readers/xrd/config.py index d9bcca208..a3b83acf4 100644 --- a/pynxtools/dataconverter/readers/xrd/config.py +++ b/pynxtools/dataconverter/readers/xrd/config.py @@ -1,52 +1,69 @@ """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/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]/COLLECTION[collection]/count_time/@units": "", - "/ENTRY[entry]/COLLECTION[collection]/data_file": "", - "/ENTRY[entry]/COLLECTION[collection]/goniometer_x": "file:/X", - "/ENTRY[entry]/COLLECTION[collection]/goniometer_x/@units": "", - "/ENTRY[entry]/COLLECTION[collection]/goniometer_y": "file:/Y", - "/ENTRY[entry]/COLLECTION[collection]/goniometer_y/@units": "", - "/ENTRY[entry]/COLLECTION[collection]/goniometer_z": "file:/Z", - "/ENTRY[entry]/COLLECTION[collection]/goniometer_z/@units": "", - "/ENTRY[entry]/COLLECTION[collection]/measurement_type": "file:/xrdMeasurements/xrdMeasurement/measurementType", - "/ENTRY[entry]/INSTRUMENT[instrument]/DETECTOR[detector]/integration_time": "", - "/ENTRY[entry]/INSTRUMENT[instrument]/DETECTOR[detector]/integration_time/@units": "", - "/ENTRY[entry]/INSTRUMENT[instrument]/DETECTOR[detector]/scan_axis": "file:/xrdMeasurements/xrdMeasurement/scan/scanAxis", - "/ENTRY[entry]/INSTRUMENT[instrument]/DETECTOR[detector]/scan_mode": "file:/xrdMeasurements/xrdMeasurement/scan/mode", - "/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source]/k_alpha_one": "file:/xrdMeasurements/xrdMeasurement/usedWavelength/kAlpha1", - "/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source]/k_alpha_one/@units": "file:/xrdMeasurements/xrdMeasurement/usedWavelength/kAlpha1/unit", - "/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source]/k_alpha_two": "file:/xrdMeasurements/xrdMeasurement/usedWavelength/kAlpha2", - "/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source]/k_alpha_two/@units": "file:/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source]/k_alpha_two/@units", - "/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source]/kbeta": "", - "/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source]/kbeta/@units": "", - "/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source]/ratio_k_alphatwo_k_alphaone": "", - "/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source]/ratio_k_alphatwo_k_alphaone/@units": "", - "/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source]/xray_tube_current": "file:/xrdMeasurements/xrdMeasurement/incidentBeamPath/xRayTube/current", - "/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source]/xray_tube_current/@units": "", - "/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source]/source_peak_wavelength": "", - "/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source]/source_peak_wavelength/@units": "", - "/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source]/xray_tube_material": "file:/xrdMeasurements/xrdMeasurement/incidentBeamPath/xRayTube/anodeMaterial", - "/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source]/xray_tube_voltage": "file:/xrdMeasurements/xrdMeasurement/incidentBeamPath/xRayTube/tension", - "/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source]/xray_tube_voltage/@units": "file:/xrdMeasurements/xrdMeasurement/incidentBeamPath/xRayTube/tension/unit", - "/ENTRY[entry]/SAMPLE[sample]/prepared_by": "", - "/ENTRY[entry]/SAMPLE[sample]/sample_id": "", - "/ENTRY[entry]/SAMPLE[sample]/sample_mode": "", - "/ENTRY[entry]/SAMPLE[sample]/sample_name": "", + "/ENTRY[entry]/2theta_plot/chi": {"file_exp": {"value": "", + "@units": ""},}, + "/ENTRY[entry]/2theta_plot/intensity": {"file_exp": {"value": "/detector", + "@units": ""},}, + "/ENTRY[entry]/2theta_plot/omega": {"file_exp": {"value": "/Omega", + "@units": ""},}, + "/ENTRY[entry]/2theta_plot/phi": {"file_exp": {"value": "/Omega", + "@units": ""},}, + "/ENTRY[entry]/2theta_plot/two_theta": {"file_exp": {"value": "/2Theta", + "@units": ""},}, + "/ENTRY[entry]/COLLECTION[collection]/beam_attenuation_factors": {"file_exp": {"value": "/beamAttenuationFactors", + "@units": ""},}, + "/ENTRY[entry]/COLLECTION[collection]/count_time": {"file_exp": {"value": "/countTime", + "@units": ""},}, + "/ENTRY[entry]/COLLECTION[collection]/data_file": {"file_exp": {"value": "",}}, + "/ENTRY[entry]/COLLECTION[collection]/goniometer_x": {"file_exp": {"value": "/X", + "@units": ""},}, + "/ENTRY[entry]/COLLECTION[collection]/goniometer_y": {"file_exp": {"value": "/Y", + "@units": ""},}, + "/ENTRY[entry]/COLLECTION[collection]/goniometer_z": {"file_exp": {"value": "/Z", + "@units": ""},}, + "/ENTRY[entry]/COLLECTION[collection]/measurement_type": {"file_exp": {"value": "/xrdMeasurements/xrdMeasurement/measurementType", + "@units": ""},}, + "/ENTRY[entry]/INSTRUMENT[instrument]/DETECTOR[detector]/integration_time": {"file_exp": {"value": "", + "@units": ""},}, + "/ENTRY[entry]/INSTRUMENT[instrument]/DETECTOR[detector]/integration_time/@units": {"file_exp": {"value": "", + "@units": ""},}, + "/ENTRY[entry]/INSTRUMENT[instrument]/DETECTOR[detector]/scan_axis": {"file_exp": {"value": "/xrdMeasurements/xrdMeasurement/scan/scanAxis", + "@units": ""},}, + "/ENTRY[entry]/INSTRUMENT[instrument]/DETECTOR[detector]/scan_mode": {"file_exp": {"value": "/xrdMeasurements/xrdMeasurement/scan/mode", + "@units": ""},}, + "/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source]/k_alpha_one": {"file_exp": {"value": "/xrdMeasurements/xrdMeasurement/usedWavelength/kAlpha1", + "@units": "/xrdMeasurements/xrdMeasurement/usedWavelength/kAlpha1/unit"},}, + "/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source]/k_alpha_two": {"file_exp": {"value": "/xrdMeasurements/xrdMeasurement/usedWavelength/kAlpha2", + "@units": "/xrdMeasurements/xrdMeasurement/usedWavelength/kAlpha2/unit"},}, + "/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source]/kbeta": {"file_exp": {"value": "", + "@units": ""},}, + "/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source]/ratio_k_alphatwo_k_alphaone": {"file_exp": {"value": "", + "@units": ""},}, + "/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source]/xray_tube_current": {"file_exp": {"value": "/xrdMeasurements/xrdMeasurement/incidentBeamPath/xRayTube/current", + "@units": ""},}, + "/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source]/source_peak_wavelength": {"file_exp": {"value": "", + "@units": ""},}, + "/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source]/xray_tube_material": {"file_exp": {"value": "/xrdMeasurements/xrdMeasurement/incidentBeamPath/xRayTube/anodeMaterial", + "@units": ""},}, + "/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source]/xray_tube_voltage": {"file_exp": {"value": "/xrdMeasurements/xrdMeasurement/incidentBeamPath/xRayTube/tension", + "@units": "/xrdMeasurements/xrdMeasurement/incidentBeamPath/xRayTube/tension/unit"},}, + "/ENTRY[entry]/SAMPLE[sample]/prepared_by": {"file_exp": {"value": "", + },}, + "/ENTRY[entry]/SAMPLE[sample]/sample_id": {"file_exp": {"value": "", + },}, + "/ENTRY[entry]/SAMPLE[sample]/sample_mode": {"file_exp": {"value": "", + },}, + "/ENTRY[entry]/SAMPLE[sample]/sample_name": {"file_exp": {"value": "", + },}, "/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/intensity": {"file_exp": {"value": "/detector", + "@units": ""}, + }, + "/ENTRY[entry]/q_plot/q": {"file_exp": {"value": "", + "@units": ""},}, "/@default": "entry", "/ENTRY[entry]/@default": "2theta_plot", } diff --git a/pynxtools/dataconverter/readers/xrd/eln_data.scheme.archive.yaml b/pynxtools/dataconverter/readers/xrd/eln_data.scheme.archive.yaml new file mode 100644 index 000000000..3a9c0ce07 --- /dev/null +++ b/pynxtools/dataconverter/readers/xrd/eln_data.scheme.archive.yaml @@ -0,0 +1,301 @@ +definitions: + name: <ADD PREFERED NAME> + sections: + xrd_pan: + base_sections: + - nomad.datamodel.metainfo.eln.NexusDataConverter + - nomad.datamodel.data.EntryData + m_annotations: + template: + reader: <READER_NAME> + nxdl: NX<NAME>.nxdl + eln: + hide: [] + quantities: + definition: + type: str + m_annotations: + eln: + component: StringEditQuantity + defaultDisplayUnit: <No Default unit> + description: ' Official NeXus NXDL schema to which this file conforms. ' + method: + type: str + m_annotations: + eln: + component: StringEditQuantity + defaultDisplayUnit: <No Default unit> + description: ' Method used to collect the data default=''X-Ray Diffraction + (XRD)'' ' + sub_sections: + Instrument: + section: + m_annotations: + eln: + overview: true + sub_sections: + Source: + section: + m_annotations: + eln: + overview: true + quantities: + xray_tube_material: + type: str + m_annotations: + eln: + component: StringEditQuantity + defaultDisplayUnit: <No Default unit> + description: ' Type of the X-ray tube. ' + xray_tube_current: + type: np.float64 + unit: '<hint: NX_CURRENT>' + value: <ADD default value> + m_annotations: + eln: + component: NumberEditQuantity + defaultDisplayUnit: <No Default unit> + description: ' Current of the X-ray tube. ' + xray_tube_voltage: + type: np.float64 + unit: '<hint: NX_VOLTAGE>' + value: <ADD default value> + m_annotations: + eln: + component: NumberEditQuantity + defaultDisplayUnit: <No Default unit> + description: ' Voltage of the X-ray tube. ' + k_alpha_one: + type: np.float64 + unit: '<hint: NX_WAVELENGTH>' + value: <ADD default value> + m_annotations: + eln: + component: NumberEditQuantity + defaultDisplayUnit: <No Default unit> + description: ' Wavelength of the K\u03b1 1 line. ' + k_alpha_two: + type: np.float64 + unit: '<hint: NX_WAVELENGTH>' + value: <ADD default value> + m_annotations: + eln: + component: NumberEditQuantity + defaultDisplayUnit: <No Default unit> + description: ' Wavelength of the K\u03b1 2 line. ' + ratio_k_alphatwo_k_alphaone: + type: np.float64 + unit: '<hint: NX_DIMENSIONLESS>' + value: <ADD default value> + m_annotations: + eln: + component: NumberEditQuantity + defaultDisplayUnit: <No Default unit> + description: ' K\u03b1 2/K\u03b1 1 intensity ratio. ' + kbeta: + type: np.float64 + unit: '<hint: NX_WAVELENGTH>' + value: <ADD default value> + m_annotations: + eln: + component: NumberEditQuantity + defaultDisplayUnit: <No Default unit> + description: ' Wavelength of the K\u00df line. ' + source_peak_wavelength: + type: np.float64 + unit: '<hint: NX_WAVELENGTH>' + value: <ADD default value> + m_annotations: + eln: + component: NumberEditQuantity + defaultDisplayUnit: <No Default unit> + description: ' Wavelength of the X-ray source. Used to convert + from 2-theta to Q. ' + Detector: + section: + m_annotations: + eln: + overview: true + quantities: + scan_axis: + type: str + m_annotations: + eln: + component: StringEditQuantity + defaultDisplayUnit: <No Default unit> + description: ' Axis scanned. ' + scan_mode: + type: str + m_annotations: + eln: + component: StringEditQuantity + defaultDisplayUnit: <No Default unit> + description: ' Mode of scan. ' + integration_time: + type: np.float64 + unit: '<hint: NX_TIME>' + value: <ADD default value> + m_annotations: + eln: + component: NumberEditQuantity + defaultDisplayUnit: <No Default unit> + description: ' Integration time per channel. ' + Collection: + section: + m_annotations: + eln: + overview: true + quantities: + data_file: + type: str + m_annotations: + eln: + component: StringEditQuantity + defaultDisplayUnit: <No Default unit> + description: ' Name of the data file. ' + measurement_type: + type: str + m_annotations: + eln: + component: StringEditQuantity + defaultDisplayUnit: <No Default unit> + description: ' Type of measurement. ' + beam_attenuation_factors: + type: str + m_annotations: + eln: + component: StringEditQuantity + defaultDisplayUnit: <No Default unit> + description: ' Beam attenuation factors over the path. ' + goniometer_x: + type: np.float64 + unit: '<hint: NX_LENGTH>' + value: <ADD default value> + m_annotations: + eln: + component: NumberEditQuantity + defaultDisplayUnit: <No Default unit> + description: ' Goniometer position X. ' + goniometer_y: + type: np.float64 + unit: '<hint: NX_LENGTH>' + value: <ADD default value> + m_annotations: + eln: + component: NumberEditQuantity + defaultDisplayUnit: <No Default unit> + description: ' Goniometer position Y. ' + goniometer_z: + type: np.float64 + unit: '<hint: NX_LENGTH>' + value: <ADD default value> + m_annotations: + eln: + component: NumberEditQuantity + defaultDisplayUnit: <No Default unit> + description: ' Goniometer position Z ' + count_time: + type: np.float64 + unit: '<hint: NX_TIME>' + value: <ADD default value> + m_annotations: + eln: + component: NumberEditQuantity + defaultDisplayUnit: <No Default unit> + description: ' Total time of count. ' + 2theta_plot: + section: + m_annotations: + eln: + overview: true + quantities: + intensity: + type: np.float64 + m_annotations: + eln: + component: NumberEditQuantity + defaultDisplayUnit: <No Default unit> + description: ' Number of scattered electrons per unit time. ' + two_theta: + type: np.float64 + m_annotations: + eln: + component: NumberEditQuantity + defaultDisplayUnit: <No Default unit> + description: ' Axis scale represeting the 2-theta range of the difractogram. ' + omega: + type: np.float64 + m_annotations: + eln: + component: NumberEditQuantity + defaultDisplayUnit: <No Default unit> + description: ' The omega range of the difractogram. ' + phi: + type: np.float64 + m_annotations: + eln: + component: NumberEditQuantity + defaultDisplayUnit: <No Default unit> + description: ' The phi range of the difractogram ' + chi: + type: np.float64 + m_annotations: + eln: + component: NumberEditQuantity + defaultDisplayUnit: <No Default unit> + description: ' The chi range of the difractogram ' + Q_plot: + section: + m_annotations: + eln: + overview: true + quantities: + q: + type: np.float64 + m_annotations: + eln: + component: NumberEditQuantity + defaultDisplayUnit: <No Default unit> + description: ' Axis scale representing wavevector for scatter energy. ' + intensity: + type: np.float64 + m_annotations: + eln: + component: NumberEditQuantity + defaultDisplayUnit: <No Default unit> + description: ' Number of ecattered electrons per unit time ' + Sample: + section: + m_annotations: + eln: + overview: true + quantities: + sample_mode: + type: str + m_annotations: + eln: + component: StringEditQuantity + defaultDisplayUnit: <No Default unit> + description: ' Mode of sample. ' + sample_id: + type: str + m_annotations: + eln: + component: StringEditQuantity + defaultDisplayUnit: <No Default unit> + description: ' Id of sample. ' + sample_name: + type: str + m_annotations: + eln: + component: StringEditQuantity + defaultDisplayUnit: <No Default unit> + description: ' Usually in xrd sample are being analysed, but sample + might be identified by assumed name or given name. ' + prepared_by: + type: str + m_annotations: + eln: + component: StringEditQuantity + defaultDisplayUnit: <No Default unit> + description: ' '