diff --git a/.gitmodules b/.gitmodules index 13255c151..304dc9b2d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "pynxtools/definitions"] path = pynxtools/definitions - url = https://github.com/FAIRmat-NFDI/nexus_definitions.git + url = https://github.com/FAIRmat-NFDI/nexus_definitions.git \ No newline at end of file diff --git a/pynxtools/dataconverter/readers/utils.py b/pynxtools/dataconverter/readers/utils.py index 2ccd8accc..1eecc99ef 100644 --- a/pynxtools/dataconverter/readers/utils.py +++ b/pynxtools/dataconverter/readers/utils.py @@ -21,7 +21,8 @@ import re from collections.abc import Mapping from dataclasses import dataclass, replace -from typing import Any, Dict, List, Optional, Tuple +from pathlib import Path +from typing import Any, Dict, List, Optional, Tuple, Union import yaml @@ -276,7 +277,7 @@ def update_config(key, value, rkey): return flattened_config -def parse_json(file_path: str) -> Dict[str, Any]: +def parse_json(file_path: Union[str, Path]) -> Dict[str, Any]: """Parses a metadata json file into a dictionary. Args: @@ -289,13 +290,13 @@ def parse_json(file_path: str) -> Dict[str, Any]: return json.load(file) -def parse_flatten_json(file_path: str) -> Dict[str, Any]: +def parse_flatten_json(file_path: Union[str, Path]) -> Dict[str, Any]: """ Parses a metadata json file into a dictionary and flattens it into a flat dictionary of absolute paths. Args: - file_path (str): The file path of the json file. + file_path (Union[str, Path]): The file path of the json file. Returns: Dict[str, Any]: diff --git a/pynxtools/dataconverter/readers/xps/config/config_sle_specs.json b/pynxtools/dataconverter/readers/xps/config/config_sle_specs.json index 39ddb7d2a..06d406c17 100644 --- a/pynxtools/dataconverter/readers/xps/config/config_sle_specs.json +++ b/pynxtools/dataconverter/readers/xps/config/config_sle_specs.json @@ -1,109 +1,321 @@ { - "/ENTRY[entry]/DATA[data]/@signal": "", - "/ENTRY[entry]/DATA[data]/data": "@data:cycle", - "/ENTRY[entry]/DATA[data]/data/@units": "CPS", - "/ENTRY[entry]/DATA[data]/energy": "@data:energy", - "/ENTRY[entry]/DATA[data]/energy/@type": "binding energy", - "/ENTRY[entry]/DATA[data]/energy/@units": "eV", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/distance": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/distance/@units": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/incident_energy": "@xps_token:beam/excitation_energy", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/incident_energy/@units": "eV", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/incident_energy_spread": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/incident_energy_spread/@units": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/incident_polarization": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/incident_polarization/@units": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/contrast_aperture": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/field_aperture": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/mode": "@xps_token:collectioncolumn/lens_mode", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/projection": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/scheme": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/transmission_function": "@xps_token:collectioncolumn/transmission_function/data", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/transmission_function/@units": "", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/transmission_function/@file": "@xps_token:collectioncolumn/transmission_function/file", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/LENS_EM[L1]/name": "Lens 1", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/LENS_EM[L1]/voltage": "@xps_token:collectioncolumn/lens1_voltage", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/LENS_EM[L1]/voltage/@units": "@xps_token:collectioncolumn/lens1_voltage/@units", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/LENS_EM[L2]/name": "Lens 2", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/LENS_EM[L2]/voltage": "@xps_token:collectioncolumn/lens2_voltage", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/LENS_EM[L2]/voltage/@units": "@xps_token:collectioncolumn/lens2_voltage/@units", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/LENS_EM[coil]/name": "Coil", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/LENS_EM[coil]/current": "@xps_token:collectioncolumn/coil_current", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/LENS_EM[coil]/current/@units": "@xps_token:collectioncolumn/coil_current/@units", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/LENS_EM[Pre Defl X]/name": "Pre-Deflector X", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/LENS_EM[Pre Defl X]/current": "@xps_token:collectioncolumn/pre_deflector_x_current", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/LENS_EM[Pre Defl X]/current/@units": "@xps_token:collectioncolumn/pre_deflector_x_current/@units", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/LENS_EM[Pre Defl Y]/name": "Pre-Deflector Y", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/LENS_EM[Pre Defl Y]/current": "@xps_token:collectioncolumn/pre_deflector_y_current", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/LENS_EM[Pre Defl Y]/current/@units": "@xps_token:collectioncolumn/pre_deflector_y_current/@units", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/LENS_EM[Focus Displacement 1]/name": "Focus Displacement", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/LENS_EM[Focus Displacement 1]/current": "@xps_token:collectioncolumn/focus_displacement_current", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/LENS_EM[Focus Displacement 1]/current/@units": "@xps_token:collectioncolumn/focus_displacement_current/@units", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/DATA[data]/@signal": "", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/DATA[data]/raw": "@detector_data:cycles/Cycle_", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/DATA[data]/raw/@units": "counts", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/amplifier_type": "channeltron", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/detector_type": "DLD", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/ENERGYDISPERSION[energydispersion]/energy_scan_mode": "@xps_token:energydispersion/scan_mode", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/ENERGYDISPERSION[energydispersion]/entrance_slit": "@xps_token:energydispersion/entrance_slit", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/ENERGYDISPERSION[energydispersion]/exit_slit": "@xps_token:energydispersion/exit_slit", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/ENERGYDISPERSION[energydispersion]/iris": "@xps_token:energydispersion/iris_diameter", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/ENERGYDISPERSION[energydispersion]/analyzer_radius": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/ENERGYDISPERSION[energydispersion]/analyzer_radius/@units": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/ENERGYDISPERSION[energydispersion]/pass_energy": "@xps_token:energydispersion/pass_energy", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/ENERGYDISPERSION[energydispersion]/pass_energy/@units": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/ENERGYDISPERSION[energydispersion]/scheme": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/name": "@xps_token:analyser/name", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/description": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/energy_resolution": "@xps_token:data/step_size", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/energy_resolution/@units": "eV", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/fast_axes": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/slow_axes": "energy", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/drain_current": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/drain_current/@units": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/sample_bias": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/sample_bias/@units": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/sample_temperature": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/sample_temperature/@units": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source]/name": "@xps_token:source/name", - "/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source]/probe": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source]/type": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/energy_resolution": "@xps_token:data/step_size", - "/ENTRY[entry]/INSTRUMENT[instrument]/energy_resolution/@units": "eV", - "/ENTRY[entry]/INSTRUMENT[instrument]/work_function": "@xps_token:instrument/workfunction", - "/ENTRY[entry]/INSTRUMENT[instrument]/work_function/@units": "eV", - "/ENTRY[entry]/INSTRUMENT[instrument]/manufacturer": "SPECS GmbH", - "/ENTRY[entry]/PROCESS[process]/angular_calibration/applied": false, - "/ENTRY[entry]/PROCESS[process]/energy_calibration/applied": true, - "/ENTRY[entry]/PROCESS[process]/energy_calibration/calibration_file": "@xps_token:detector/calibration_file", - "/ENTRY[entry]/PROCESS[process]/energy_calibration/calibrated_axis": "@data:energy", - "/ENTRY[entry]/PROCESS[process]/energy_calibration/calibrated_axis/@units": "eV", - "/ENTRY[entry]/PROCESS[process]/momentum_calibration/applied": false, - "/ENTRY[entry]/PROCESS[process]/spatial_calibration/applied": false, - "/ENTRY[entry]/PROCESS[process]/intensity_calibration/applied": true, - "/ENTRY[entry]/PROCESS[process]/intensity_calibration/transmission_function": "@xps_token:collectioncolumn/transmission_function/data", - "/ENTRY[entry]/PROCESS[process]/intensity_calibration/transmission_function/@units": "", - "/ENTRY[entry]/PROCESS[process]/intensity_calibration/transmission_function/@file": "@xps_token:collectioncolumn/transmission_function/file", - "/ENTRY[entry]/SAMPLE[sample]/bias": "None", - "/ENTRY[entry]/SAMPLE[sample]/bias/@units": "None", - "/ENTRY[entry]/SAMPLE[sample]/chemical_formula": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/gas_pressure": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/gas_pressure/@units": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/name": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/preparation_date": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/preparation_description": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/sample_history": "None", - "/ENTRY[entry]/SAMPLE[sample]/situation": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/temperature": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/temperature/@units": "@eln", - "/ENTRY[entry]/USER[user]/address": "@eln", - "/ENTRY[entry]/USER[user]/affiliation": "@eln", - "/ENTRY[entry]/USER[user]/email": "@eln", - "/ENTRY[entry]/USER[user]/name": "@eln", - "/ENTRY[entry]/USER[user]/orcid": "@eln", - "/ENTRY[entry]/definition": "@eln", - "/ENTRY[entry]/definition/@version": "@eln", - "/ENTRY[entry]/end_time": "@eln", - "/ENTRY[entry]/start_time": "@eln", - "/ENTRY[entry]/title": "@eln" -} + "/@default":"entry", + "/ENTRY[entry]":{ + "@default":"data", + "definition":"@eln", + "definition/@version":"@eln", + "title":"@eln", + "start_time":"@eln", + "end_time":"@eln", + "experiment_institution":"@eln", + "experiment_facility":"@eln", + "experiment_laboratory":"@eln", + "entry_identifier":"@eln", + "duration":"None", + "duration/@units":"s", + "method":"@xps_token:region/analysis_method", + "program_name":"@eln" + }, + "/ENTRY[entry]/USER[user]":{ + "name":"@eln", + "affiliation":"@eln", + "address":"@eln", + "orcid":"@eln", + "email":"@eln" + }, + "/ENTRY[entry]/INSTRUMENT[instrument]":{ + "device_information":{ + "vendor":"@eln", + "identifier":"@eln", + "model":"@eln" + }, + "energy_resolution":{ + "physical_quantity":"energy", + "type":"@eln", + "resolution":"@eln", + "resolution/@units":"@eln" + }, + "source_TYPE[source_probe]":{ + "type":"@eln", + "name":"@xps_token:source/name", + "probe":"@eln", + "current":"@xps_token:source/emission_current", + "current/@units":"@xps_token:source/emission_current/@units", + "voltage":"@xps_token:source/source_voltage", + "voltage/@units":"@xps_token:source/source_voltage/@units", + "device_information":{ + "vendor":"@eln", + "identifier":"@eln", + "model":"@eln" + }, + "associated_beam":"@link:/entry/instrument/beam_probe" + }, + "beam_TYPE[beam_probe]":{ + "distance":"@eln", + "distance/@units":"@eln", + "incident_energy":"@xps_token:beam/excitation_energy", + "incident_energy/@units":"@xps_token:beam/excitation_energy/@units", + "incident_energy_spread":"None", + "incident_energy_spread/@units":"None", + "incident_polarization":"None", + "incident_polarization/@units":"None", + "extent":"None", + "associated_source":"@link:/entry/instrument/source_probe" + }, + "ELECTRONANALYSER[electronanalyser]":{ + "@default": "detector0", + "name":"@xps_token:analyser/name", + "description":"@eln", + "voltage_energy_range":"@xps_token:analyser/voltage_energy_range", + "voltage_energy_range/@units":"@xps_token:analyser/voltage_energy_range/@units", + "work_function":"@xps_token:analyser/work_function", + "work_function/@units":"@xps_token:analyser/work_function/@units", + "fast_axes":"None", + "slow_axes":"energy", + "device_information":{ + "vendor":"@eln", + "model":"@eln", + "identifier":"@eln" + }, + "energy_resolution":{ + "physical_quantity":"energy", + "type":"estimated", + "resolution":"@xps_token:data/step_size", + "resolution/@units":"@xps_token:data/step_size/@units" + }, + "transmission_function":{ + "@default":"relative_intensity", + "@signal":"relative_intensity", + "@axes":["kinetic_energy"], + "kinetic_energy":"@xps_token:transmission_function/kinetic_energy", + "kinetic_energy/@units":"@xps_token:transmission_function/kinetic_energy/@units", + "relative_intensity":"@xps_token:collectioncolumn/transmission_function/relative_intensity" + }, + "COLLECTIONCOLUMN[collectioncolumn]":{ + "scheme":"@eln", + "lens_mode":"@xps_token:collectioncolumn/lens_mode", + "projection":"None", + "angular_acceptance":"None", + "spatial_acceptance":"None", + "field_aperture":"None", + "contrast_aperture":"None", + "iris":{ + "size":"@xps_token:collectioncolumn/iris_diameter", + "size/@units":"@xps_token:collectioncolumn/iris_diameter/@units" + }, + "device_information":{ + "vendor":"@eln", + "model":"@eln", + "identifier":"@eln" + }, + "LENS_EM[L1]":{ + "name":"Lens 1", + "voltage":"@xps_token:collectioncolumn/lens1_voltage", + "voltage/@units":"@xps_token:collectioncolumn/lens1_voltage/@units" + }, + "LENS_EM[L2]":{ + "name":"Lens 2", + "voltage":"@xps_token:collectioncolumn/lens2_voltage", + "voltage/@units":"@xps_token:collectioncolumn/lens2_voltage/@units" + }, + "LENS_EM[coil]":{ + "name":"Coil", + "current":"@xps_token:collectioncolumn/coil_current", + "current/@units":"@xps_token:collectioncolumn/coil_current/@units" + }, + "LENS_EM[Pre Defl X]":{ + "name":"Pre-Deflector X", + "current":"@xps_token:collectioncolumn/pre_deflector_x_current", + "current/@units":"@xps_token:collectioncolumn/pre_deflector_x_current/@units" + }, + "LENS_EM[Pre Defl Y]":{ + "name":"Pre-Deflector Y", + "current":"@xps_token:collectioncolumn/pre_deflector_y_current", + "current/@units":"@xps_token:collectioncolumn/pre_deflector_y_current/@units" + }, + "LENS_EM[Focus Displacement]":{ + "name":"Focus Displacement", + "current":"@xps_token:collectioncolumn/focus_displacement_current", + "current/@units":"@xps_token:collectioncolumn/focus_displacement_current/@units" + } + }, + "ENERGYDISPERSION[energydispersion]":{ + "scheme":"@eln", + "pass_energy":"@xps_token:energydispersion/pass_energy", + "pass_energy/@units":"@xps_token:energydispersion/pass_energy/@units", + "energy_scan_mode":"@xps_token:energydispersion/scan_mode", + "entrance_slit/description":"@xps_token:energydispersion/entrance_slit", + "exit_slit/description":"@xps_token:energydispersion/exit_slit", + "device_information":{ + "vendor":"@eln", + "model":"@eln", + "identifier":"@eln" + }, + "diameter":"@eln", + "diameter/@units":"@eln" + }, + "DETECTOR[detector]":{ + "@default":"raw_data", + "amplifier_type":"@eln", + "detector_type":"@eln", + "detector_voltage":"@xps_token:detector/detector_voltage", + "detector_voltage/@units":"@xps_token:detector/detector_voltage/@units", + "amplifier_bias":"@xps_token:detector/bias_voltage_electrons", + "amplifier_bias/@units":"@xps_token:detector/bias_voltage_electrons/@units", + "count_time":"@xps_token:detector/dwell_time", + "count_time/@units":"@xps_token:detector/dwell_time/@units", + "device_information":{ + "vendor":"@eln", + "model":"@eln", + "identifier":"@eln" + }, + "raw_data":{ + "@signal":"raw", + "@default":"raw", + "raw":"@detector_data:cycles/Cycle_", + "raw/@units":"@xps_token:detector/raw_data/raw/@units" + } + } + }, + "MANIPULATOR[manipulator]":{ + "device_information":{ + "vendor":"@eln", + "model":"@eln", + "identifier":"@eln" + }, + "temperature_sensor":{ + "name":"@eln", + "measurement":"@eln", + "type":"@eln", + "attached_to":"@eln", + "value":"@eln" + }, + "sample_heater":{ + "name":"@eln", + "physical_quantity":"@eln", + "type":"@eln", + "heater_power":"@eln", + "PID[pid]/setpoint":"@eln" + }, + "cryostat":{ + "name":"None", + "physical_quantity":"None", + "type":"None", + "PID[pid]/setpoint":"None" + }, + "drain_current_amperemeter":{ + "name":"@eln", + "measurement":"@eln", + "type":"@eln", + "value":"@eln" + }, + "sample_bias_voltmeter":{ + "name":"@eln", + "measurement":"@eln", + "type":"@eln", + "value":"@eln" + }, + "sample_bias_potentiostat":{ + "name":"@eln", + "physical_quantity":"@eln", + "type":"@eln", + "PID[pid]/setpoint":"@eln" + } + }, + "pressure_gauge":{ + "name":"@eln", + "measurement":"@eln", + "type":"@eln", + "value":"@eln", + "value_log/value":"@eln" + }, + "flood_gun":{ + "name":"@eln", + "physical_quantity":"@eln", + "type":"@eln", + "current":"@eln", + "current_log/value":"@eln" + } + }, + "/ENTRY[entry]/PROCESS[process]":{ + "energy_calibration":{ + "calibrated_axis":"@xps_token:process/energy_calibration/energy", + "calibrated_axis/@units":"@xps_token:process/energy_calibration/energy/@units", + "calibration_object":{ + "type":"file", + "path":"@xps_token:process/energy_calibration/calibration_file/path" + } + }, + "energy_referencing":{ + "level":"None", + "reference_peak":"None", + "binding_energy":"None", + "offset":"None", + "calibrated_axis":"None" + }, + "transmission_correction":{ + "transmission_function":"@link:/entry/instrument/electronanalyser/transmission_function", + "calibration_object":{ + "type":"file", + "path":"@xps_token:process/transmission_correction/transmission_function/file" + } + } + }, + "/ENTRY[entry]/SAMPLE[sample]":{ + "name":"@eln", + "sample_id":"@eln", + "atom_types":"@eln", + "physical_form":"@eln", + "situation":"@eln", + "SUBSTANCE[substance]":{ + "name":"@eln", + "molecular_mass":"@eln", + "cas_number":"@eln", + "molecular_formula_hill":"@eln" + }, + "sample_history":{ + "sample_preparation":{ + "start_time":"@eln", + "end_time":"@eln", + "description":"@eln", + "method":"@eln" + }, + "PHYSICAL_PROCESS[sample_loading]":{ + "start_time":"@eln", + "end_time":"@eln", + "description":"@eln", + "method":"@eln" + } + }, + "temperature":{ + "temperature_sensor": "@link:/entry/instrument/manipulator/temperature_sensor", + "sample_heater":"@link:/entry/instrument/manipulator/sample_heater", + "cryostat":"None" + }, + "gas_pressure":{ + "pressure_gauge":"@link:/entry/instrument/pressure_gauge" + }, + "bias":{ + "potentiostat":"@link:/entry/instrument/manipulator/sample_bias_potentiostat", + "voltmeter":"@link:/entry/instrument/manipulator/sample_bias_voltmeter" + }, + "drain_current":{ + "amperemeter":"@link:/entry/instrument/manipulator/drain_current_amperemeter" + }, + "flood_gun_current":{ + "flood_gun":"@link:/entry/instrument/flood_gun" + } + }, + "/ENTRY[entry]/data":{ + "@signal":"data", + "@default":"data", + "@axes":["energy"], + "data":"@data:cycle", + "data/@units":"@xps_token:data/intensity/@units", + "energy":"@link:/entry/process/energy_calibration/calibrated_axis", + "energy/@type":"@xps_token:data/energy/@type", + "energy/@units":"@xps_token:data/energy/@units", + "@energy_indices":"None", + "@energy_depends":"None" + } +} \ No newline at end of file diff --git a/pynxtools/dataconverter/readers/xps/config/config_specs_xy.json b/pynxtools/dataconverter/readers/xps/config/config_specs_xy.json index 19f9c95b0..814ed84d3 100644 --- a/pynxtools/dataconverter/readers/xps/config/config_specs_xy.json +++ b/pynxtools/dataconverter/readers/xps/config/config_specs_xy.json @@ -1,85 +1,286 @@ -{ - "/ENTRY[entry]/DATA[data]/@signal": "", - "/ENTRY[entry]/DATA[data]/data": "@data:cycle", - "/ENTRY[entry]/DATA[data]/data/@units": "@xps_token:data/y_units", - "/ENTRY[entry]/DATA[data]/energy": "@data:energy", - "/ENTRY[entry]/DATA[data]/energy/@type": "@xps_token:data/x_units", - "/ENTRY[entry]/DATA[data]/energy/@units": "eV", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/distance": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/distance/@units": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/incident_energy": "@xps_token:beam/excitation_energy", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/incident_energy/@units": "eV", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/incident_energy_spread": "", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/incident_energy_spread/@units": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/incident_polarization": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/incident_polarization/@units": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/contrast_aperture": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/field_aperture": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/mode": "@xps_token:collectioncolumn/lens_mode", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/projection": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/scheme": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/DATA[data]/@signal": "raw", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/DATA[data]/raw": "@detector_data:cycles/Cycle_", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/DATA[data]/raw/@units": "counts", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/amplifier_type": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/detector_type": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/count_time": "@xps_token:region/dwell_time", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/count_time/@units": "s", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/detector_voltage": "@xps_token:detector/detector_voltage", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/detector_voltage/@units": "V", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/ENERGYDISPERSION[energydispersion]/energy_scan_mode": "@xps_token:energydispersion/scan_mode", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/ENERGYDISPERSION[energydispersion]/entrance_slit": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/ENERGYDISPERSION[energydispersion]/exit_slit": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/ENERGYDISPERSION[energydispersion]/pass_energy": "@xps_token:energydispersion/pass_energy", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/ENERGYDISPERSION[energydispersion]/pass_energy/@units": "eV", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/ENERGYDISPERSION[energydispersion]/scheme": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/description": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/energy_resolution": "@xps_token:data/step_size", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/energy_resolution/@units": "eV", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/fast_axes": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/slow_axes": "energy", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/name": "@xps_token:analyser/analyser_name", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/target_bias/": "@xps_token:analyser/target_bias", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/target_bias/@units": "V", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/drain_current": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/drain_current/@units": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/sample_bias": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/sample_bias/@units": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/sample_temperature": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/sample_temperature/@units": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source]/name": "@xps_token:source/source_label", - "/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source]/probe": "photon", - "/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source]/type": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/energy_resolution": "@xps_token:data/step_size", - "/ENTRY[entry]/INSTRUMENT[instrument]/energy_resolution/@units": "eV", - "/ENTRY[entry]/INSTRUMENT[instrument]/work_function/": "@xps_token:instrument/work_function", - "/ENTRY[entry]/INSTRUMENT[instrument]/work_function/@units": "eV", - "/ENTRY[entry]/PROCESS[process]/angular_calibration/applied": false, - "/ENTRY[entry]/PROCESS[process]/energy_calibration/applied": "@eln", - "/ENTRY[entry]/PROCESS[process]/energy_calibration/calibrated_axis": "@data:energy", - "/ENTRY[entry]/PROCESS[process]/energy_calibration/calibrated_axis/@units": "eV", - "/ENTRY[entry]/PROCESS[process]/momentum_calibration/applied": false, - "/ENTRY[entry]/PROCESS[process]/spatial_calibration/applied": false, - "/ENTRY[entry]/SAMPLE[sample]/bias": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/bias/@units": "V", - "/ENTRY[entry]/SAMPLE[sample]/chemical_formula": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/gas_pressure": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/gas_pressure/@units": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/name": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/preparation_date": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/preparation_description": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/sample_history": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/situation": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/temperature": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/temperature/@units": "@eln", - "/ENTRY[entry]/USER[user]/address": "@eln", - "/ENTRY[entry]/USER[user]/affiliation": "@eln", - "/ENTRY[entry]/USER[user]/email": "@eln", - "/ENTRY[entry]/USER[user]/name": "@eln", - "/ENTRY[entry]/USER[user]/orcid": "@eln", - "/ENTRY[entry]/method": "@xps_token:region/analysis_method", - "/ENTRY[entry]/definition": "@eln", - "/ENTRY[entry]/definition/@version": "@eln", - "/ENTRY[entry]/start_time": "@eln", - "/ENTRY[entry]/title": "@eln" -} +{ + "/@default":"None", + "/ENTRY[entry]":{ + "@default":"data", + "definition":"@eln", + "definition/@version":"@eln", + "title":"@eln", + "start_time":"@xps_token:time_stamp", + "end_time":"@eln", + "method":"@xps_token:region/analysis_method", + "experiment_institution":"@eln", + "experiment_facility":"@eln", + "experiment_laboratory":"@eln", + "entry_identifier":"@eln", + "data_file": "@xps_token:file_info/data_file", + "sequence_file": "@xps_token:file_info/sequence_file" + }, + "/ENTRY[entry]/USER[user]":{ + "name":"@eln", + "affiliation":"@eln", + "address":"@eln", + "orcid":"@eln", + "email":"@eln" + }, + "/ENTRY[entry]/INSTRUMENT[instrument]":{ + "device_information":{ + "vendor":"None", + "identifier":"None", + "model":"None" + }, + "energy_resolution":{ + "physical_quantity":"energy", + "type":"derived", + "resolution":"@xps_token:data/step_size", + "resolution/@units":"eV" + }, + "source_TYPE[source_probe]":{ + "type":"@eln", + "name": "@xps_token:source/source_label", + "probe":"photon", + "device_information":{ + "vendor":"@eln", + "identifier":"@eln", + "model":"@eln" + }, + "associated_beam":"@link:/entry/instrument/beam_probe" + }, + "beam_TYPE[beam_probe]":{ + "distance":"@eln", + "distance/@units":"@eln", + "incident_energy":"@xps_token:beam/excitation_energy", + "incident_energy/@units":"eV", + "incident_energy_spread":"None", + "incident_energy_spread/@units":"None", + "incident_polarization":"None", + "incident_polarization/@units":"None", + "extent":"None", + "associated_source":"@link:/entry/instrument/source_probe" + }, + "ELECTRONANALYSER[electronanalyser]":{ + "@default": "None", + "description":"@eln", + "name": "@eln", + "work_function":"@eln", + "work_function/@units":"@eln", + "fast_axes":"None", + "slow_axes":"energy", + "device_information":{ + "vendor":"None", + "model":"None", + "identifier":"None" + }, + "energy_resolution":{ + "physical_quantity":"energy", + "type":"@xps_token:data/step_size", + "resolution":"eV" + }, + "transmission_function":"None", + "COLLECTIONCOLUMN[collectioncolumn]":{ + "scheme":"@eln", + "lens_mode":"@xps_token:collectioncolumn/lens_mode", + "projection":"None", + "angular_acceptance":"None", + "spatial_acceptance":"None", + "field_aperture":"None", + "contrast_aperture":"None", + "iris":"None", + "device_information":{ + "vendor":"@eln", + "model":"@eln", + "identifier":"@eln" + } + }, + "ENERGYDISPERSION[energydispersion]":{ + "scheme":"@eln", + "pass_energy":"@xps_token:energydispersion/pass_energy", + "pass_energy/@units":"eV", + "energy_scan_mode":"@xps_token:energydispersion/acquisition_mode", + "entrance_slit":{ + "description":"@eln", + "shape":"@eln", + "size":"@eln", + "size/@units": "@eln" + }, + "exit_slit":"None", + "device_information":{ + "vendor":"@eln", + "model":"@eln", + "identifier":"@eln" + } + }, + "DETECTOR[detector]":{ + "@default":"raw_data", + "amplifier_type":"@eln", + "count_time": "@xps_token:region/dwell_time", + "count_time/@units": "@xps_token:region/dwell_time/time", + "detector_type":"@eln", + "device_information":{ + "vendor":"@eln", + "model":"@eln", + "identifier":"@eln" + }, + "raw_data":{ + "@signal":"None", + "@default":"raw", + "raw":"@detector_data:cycles/Cycle_", + "raw/@units":"counts" + } + } + }, + "MANIPULATOR[manipulator]":{ + "device_information":{ + "vendor":"@eln", + "model":"@eln", + "identifier":"@eln" + }, + "temperature_sensor":{ + "name":"@eln", + "measurement":"@eln", + "type":"@eln", + "attached_to":"@eln", + "value":"@eln" + }, + "sample_heater":{ + "name":"@eln", + "physical_quantity":"@eln", + "type":"@eln", + "heater_power":"@eln", + "PID[pid]/setpoint":"@eln" + }, + "cryostat":{ + "name":"None", + "physical_quantity":"None", + "type":"None", + "PID[pid]/setpoint":"None" + }, + "drain_current_amperemeter":{ + "name":"@eln", + "measurement":"@eln", + "type":"@eln", + "value":"@eln" + }, + "sample_bias_voltmeter":{ + "name":"@eln", + "measurement":"@eln", + "type":"@eln", + "value":"@eln" + }, + "sample_bias_potentiostat":{ + "name":"@eln", + "physical_quantity":"@eln", + "type":"@eln", + "PID[pid]/setpoint":"@eln" + }, + "POSITIONER[positioner_x]":{ + "value": "@eln", + "value/@units": "@eln" + }, + "POSITIONER[positioner_y]":{ + "value": "@eln", + "value/@units": "@eln" + }, + "POSITIONER[positioner_z]":{ + "value": "@eln", + "value/@units": "@eln" + }, + "POSITIONER[positioner_phi]":{ + "value": "@eln", + "value/@units": "@eln" + }, + }, + "pressure_gauge":{ + "name":"@eln", + "measurement":"@eln", + "type":"@eln", + "value":"@eln", + "value_log/value":"@eln" + }, + "flood_gun":{ + "name":"@eln", + "physical_quantity":"@eln", + "type":"@eln", + "current":"@eln", + "current_log/value":"@eln" + } + }, + "/ENTRY[entry]/PROCESS[process]":{ + "energy_calibration":{ + "calibrated_axis":"@data:energy", + "calibrated_axis/@units": "eV" + }, + "energy_referencing":{ + "level":"None", + "reference_peak":"None", + "binding_energy":"None", + "offset":"None", + "calibrated_axis":"None" + }, + "transmission_correction":{ + "transmission_function":{ + "@axes":"None", + "@signal":"None", + "kinetic_energy":"None", + "kinetic_energy/@units":"None", + "relative_intensity":"None" + } + } + }, + "/ENTRY[entry]/SAMPLE[sample]":{ + "name":"@eln", + "sample_id":"@eln", + "atom_types":"@eln", + "physical_form":"@eln", + "situation":"@eln", + "SUBSTANCE[substance]":{ + "name":"@eln", + "molecular_mass":"@eln", + "cas_number":"@eln", + "molecular_formula_hill":"@eln" + }, + "sample_history":{ + "sample_preparation":{ + "start_time":"@eln", + "end_time":"@eln", + "description":"@eln", + "method":"@eln" + }, + "PHYSICAL_PROCESS[sample_loading]":{ + "start_time":"@eln", + "end_time":"@eln", + "description":"@eln", + "method":"@eln" + } + }, + "temperature":{ + "temperature_sensor": "@link:/entry/instrument/manipulator/temperature_sensor", + "sample_heater":"@link:/entry/instrument/manipulator/sample_heater", + "cryostat":"None" + }, + "gas_pressure":{ + "pressure_gauge":"@link:/entry/instrument/pressure_gauge" + }, + "bias":{ + "potentiostat":"@link:/entry/instrument/manipulator/sample_bias_potentiostat", + "voltmeter":"@link:/entry/instrument/manipulator/sample_bias_voltmeter" + }, + "drain_current":{ + "amperemeter":"@link:/entry/instrument/manipulator/drain_current_amperemeter" + }, + "flood_gun_current":{ + "flood_gun":"@link:/entry/instrument/flood_gun" + } + }, + "/ENTRY[entry]/data":{ + "@signal":"data", + "@default":"data", + "@axes":["energy"], + "data":"@data:cycle", + "data/@units":"@xps_token:data/y_units", + "energy":"@data:energy", + "energy/@units":"eV", + "energy/@typex":"@xps_token:data/x_units", + "@energy_indices":"None", + "@energy_depends":"None" + } + } \ No newline at end of file diff --git a/pynxtools/dataconverter/readers/xps/config/config_txt_scienta.json b/pynxtools/dataconverter/readers/xps/config/config_txt_scienta.json index 9c6fc6be9..7d7a63b4c 100644 --- a/pynxtools/dataconverter/readers/xps/config/config_txt_scienta.json +++ b/pynxtools/dataconverter/readers/xps/config/config_txt_scienta.json @@ -1,93 +1,282 @@ -{ - "/ENTRY[entry]/DATA[data]/@signal": "", - "/ENTRY[entry]/DATA[data]/data": "@data:cycle", - "/ENTRY[entry]/DATA[data]/data/@units": "CPS", - "/ENTRY[entry]/DATA[data]/energy": "@data:energy", - "/ENTRY[entry]/DATA[data]/energy/@type": "@xps_token:data/energy_type", - "/ENTRY[entry]/DATA[data]/energy/@units": "eV", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/distance": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/distance/@units": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/incident_energy": "@xps_token:beam/excitation_energy", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/incident_energy/@units": "eV", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/incident_energy_spread": "", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/incident_energy_spread/@units": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/incident_polarization": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/incident_polarization/@units": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/contrast_aperture": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/field_aperture": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/mode": "@xps_token:collectioncolumn/lens_mode", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/projection": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/scheme": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/DATA[data]/@signal": "raw", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/DATA[data]/raw": "@detector_data:cycles/Cycle_", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/DATA[data]/raw/@units": "counts", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/amplifier_type": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/detector_type": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/count_time": "@xps_token:region/dwell_time", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/count_time/@units": "@xps_token:region/dwell_time/time", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/ENERGYDISPERSION[energydispersion]/energy_scan_mode": "@xps_token:energydispersion/acquisition_mode", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/ENERGYDISPERSION[energydispersion]/APERTURE[entrance_slit]/description": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/ENERGYDISPERSION[energydispersion]/APERTURE[entrance_slit]/shape": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/ENERGYDISPERSION[energydispersion]/APERTURE[entrance_slit]/size": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/ENERGYDISPERSION[energydispersion]/APERTURE[entrance_slit]/size/@units": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/ENERGYDISPERSION[energydispersion]/pass_energy": "@xps_token:energydispersion/pass_energy", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/ENERGYDISPERSION[energydispersion]/pass_energy/@units": "eV", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/ENERGYDISPERSION[energydispersion]/scheme": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/description": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/energy_resolution": "@xps_token:data/step_size", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/energy_resolution/@units": "eV", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/fast_axes": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/slow_axes": "energy", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/name": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/drain_current": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/drain_current/@units": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/sample_bias": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/sample_bias/@units": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/sample_temperature": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/sample_temperature/@units": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/POSITIONER[positioner_x]/value": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/POSITIONER[positioner_x]/value/@units": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/POSITIONER[positioner_y]/value": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/POSITIONER[positioner_y]/value/@units": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/POSITIONER[positioner_z]/value": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/POSITIONER[positioner_z]/value/@units": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/POSITIONER[positioner_phi]/value": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/POSITIONER[positioner_phi]/value/@units": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source]/name": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source]/probe": "photon", - "/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source]/type": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/name": "@xps_token:instrument/instrument_name", - "/ENTRY[entry]/INSTRUMENT[instrument]/energy_resolution": "@xps_token:data/step_size", - "/ENTRY[entry]/INSTRUMENT[instrument]/energy_resolution/@units": "eV", - "/ENTRY[entry]/PROCESS[process]/angular_calibration/applied": false, - "/ENTRY[entry]/PROCESS[process]/energy_calibration/applied": "@eln", - "/ENTRY[entry]/PROCESS[process]/energy_calibration/calibrated_axis": "@data:energy", - "/ENTRY[entry]/PROCESS[process]/energy_calibration/calibrated_axis/@units": "eV", - "/ENTRY[entry]/PROCESS[process]/momentum_calibration/applied": false, - "/ENTRY[entry]/PROCESS[process]/spatial_calibration/applied": false, - "/ENTRY[entry]/SAMPLE[sample]/bias": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/bias/@units": "V", - "/ENTRY[entry]/SAMPLE[sample]/chemical_formula": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/gas_pressure": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/gas_pressure/@units": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/name": "@xps_token:sample/sample_name", - "/ENTRY[entry]/SAMPLE[sample]/preparation_date": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/preparation_description": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/sample_history": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/situation": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/temperature": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/temperature/@units": "@eln", - "/ENTRY[entry]/USER[user]/address": "@eln", - "/ENTRY[entry]/USER[user]/affiliation": "@eln", - "/ENTRY[entry]/USER[user]/email": "@eln", - "/ENTRY[entry]/USER[user]/name": "@eln", - "/ENTRY[entry]/USER[user]/initials": "xps_token:user/user_initials", - "/ENTRY[entry]/USER[user]/orcid": "@eln", - "/ENTRY[entry]/method": "@eln", - "/ENTRY[entry]/sequence_file": "@xps_token:file_info/sequence_file", - "/ENTRY[entry]/data_file": "@xps_token:file_info/data_file", - "/ENTRY[entry]/definition": "@eln", - "/ENTRY[entry]/definition/@version": "@eln", - "/ENTRY[entry]/start_time": "@xps_token:time_stamp", - "/ENTRY[entry]/title": "@eln" -} \ No newline at end of file +{ + "/@default":"None", + "/ENTRY[entry]":{ + "@default":"data", + "definition":"@eln", + "definition/@version":"@eln", + "title":"@eln", + "start_time":"@xps_token:time_stamp", + "end_time":"@eln", + "method":"@xps_token:region/analysis_method", + "experiment_institution":"@eln", + "experiment_facility":"@eln", + "experiment_laboratory":"@eln", + "entry_identifier":"@eln", + "data_file": "@xps_token:file_info/data_file", + "sequence_file": "@xps_token:file_info/sequence_file" + }, + "/ENTRY[entry]/USER[user]":{ + "name":"@eln", + "affiliation":"@eln", + "address":"@eln", + "orcid":"@eln", + "email":"@eln", + "initials": "xps_token:user/user_initials" + }, + "/ENTRY[entry]/INSTRUMENT[instrument]":{ + "name": "@xps_token:instrument/instrument_name", + "device_information":{ + "vendor":"None", + "identifier":"None", + "model":"None" + }, + "energy_resolution":{ + "physical_quantity":"energy", + "type":"derived", + "resolution":"@xps_token:data/step_size", + "resolution/@units":"eV" + }, + "source_TYPE[source_probe]":{ + "type":"@", + "name": "@eln", + "probe":"photon", + "device_information":{ + "vendor":"@eln", + "identifier":"@eln", + "model":"@eln" + }, + "associated_beam":"@link:/entry/instrument/beam_probe" + }, + "beam_TYPE[beam_probe]":{ + "distance":"@eln", + "distance/@units":"@eln", + "incident_energy":"@xps_token:beam/excitation_energy", + "incident_energy/@units":"eV", + "incident_energy_spread":"None", + "incident_energy_spread/@units":"None", + "incident_polarization":"None", + "incident_polarization/@units":"None", + "extent":"None", + "associated_source":"@link:/entry/instrument/source_probe" + }, + "ELECTRONANALYSER[electronanalyser]":{ + "@default": "None", + "description":"@eln", + "name": "@eln", + "work_function":"@eln", + "work_function/@units":"@eln", + "fast_axes":"None", + "slow_axes":"energy", + "device_information":{ + "vendor":"None", + "model":"None", + "identifier":"None" + }, + "energy_resolution":{ + "physical_quantity":"energy", + "type":"@xps_token:data/step_size", + "resolution":"eV" + }, + "transmission_function":"None", + "COLLECTIONCOLUMN[collectioncolumn]":{ + "scheme":"@eln", + "lens_mode":"@xps_token:collectioncolumn/lens_mode", + "projection":"None", + "angular_acceptance":"None", + "spatial_acceptance":"None", + "field_aperture":"None", + "contrast_aperture":"None", + "iris":"None", + "device_information":{ + "vendor":"@eln", + "model":"@eln", + "identifier":"@eln" + } + }, + "ENERGYDISPERSION[energydispersion]":{ + "scheme":"@eln", + "pass_energy":"@xps_token:energydispersion/pass_energy", + "pass_energy/@units":"eV", + "energy_scan_mode":"@xps_token:energydispersion/acquisition_mode", + "entrance_slit":{ + "description":"@eln", + "shape":"@eln", + "size":"@eln", + "size/@units": "@eln" + }, + "exit_slit":"None", + "device_information":{ + "vendor":"@eln", + "model":"@eln", + "identifier":"@eln" + } + }, + "DETECTOR[detector]":{ + "@default":"raw_data", + "amplifier_type":"@eln", + "count_time": "@xps_token:region/dwell_time", + "count_time/@units": "@xps_token:region/dwell_time/time", + "detector_type":"@eln", + "device_information":{ + "vendor":"@eln", + "model":"@eln", + "identifier":"@eln" + }, + "raw_data":{ + "@signal":"None", + "@default":"raw", + "raw":"@detector_data:cycles/Cycle_", + "raw/@units":"counts" + } + } + }, + "MANIPULATOR[manipulator]":{ + "device_information":{ + "vendor":"@eln", + "model":"@eln", + "identifier":"@eln" + }, + "temperature_sensor":{ + "name":"@eln", + "measurement":"@eln", + "type":"@eln", + "attached_to":"@eln", + "value":"@eln" + }, + "sample_heater":{ + "name":"@eln", + "physical_quantity":"@eln", + "type":"@eln", + "heater_power":"@eln", + "PID[pid]/setpoint":"@eln" + }, + "cryostat":{ + "name":"None", + "physical_quantity":"None", + "type":"None", + "PID[pid]/setpoint":"None" + }, + "drain_current_amperemeter":{ + "name":"@eln", + "measurement":"@eln", + "type":"@eln", + "value":"@eln" + }, + "sample_bias_voltmeter":{ + "name":"@eln", + "measurement":"@eln", + "type":"@eln", + "value":"@eln" + }, + "sample_bias_potentiostat":{ + "name":"@eln", + "physical_quantity":"@eln", + "type":"@eln", + "PID[pid]/setpoint":"@eln" + }, + "POSITIONER[positioner_x]":{ + "value": "@eln", + "value/@units": "@eln" + }, + "POSITIONER[positioner_y]":{ + "value": "@eln", + "value/@units": "@eln" + }, + "POSITIONER[positioner_z]":{ + "value": "@eln", + "value/@units": "@eln" + }, + "POSITIONER[positioner_phi]":{ + "value": "@eln", + "value/@units": "@eln" + } + }, + "pressure_gauge":{ + "name":"@eln", + "measurement":"@eln", + "type":"@eln", + "value":"@eln", + "value_log/value":"@eln" + }, + "flood_gun":{ + "name":"@eln", + "physical_quantity":"@eln", + "type":"@eln", + "current":"@eln", + "current_log/value":"@eln" + } + }, + "/ENTRY[entry]/PROCESS[process]":{ + "energy_calibration":{ + "calibrated_axis":"@data:energy", + "calibrated_axis/@units": "eV" + }, + "energy_referencing":{ + "level":"None", + "reference_peak":"None", + "binding_energy":"None", + "offset":"None", + "calibrated_axis":"None" + }, + "transmission_correction":{ + "transmission_function":{ + "@axes":"None", + "@signal":"None", + "kinetic_energy":"None", + "kinetic_energy/@units":"None", + "relative_intensity":"None" + } + } + }, + "/ENTRY[entry]/SAMPLE[sample]":{ + "name":"@xps_token:sample/sample_name", + "sample_id":"@eln", + "atom_types":"@eln", + "physical_form":"@eln", + "situation":"@eln", + "SUBSTANCE[substance]":{ + "name":"@eln", + "molecular_mass":"@eln", + "cas_number":"@eln", + "molecular_formula_hill":"@eln" + }, + "sample_history":{ + "sample_preparation":{ + "start_time":"@eln", + "end_time":"@eln", + "description":"@eln", + "method":"@eln" + } + }, + "temperature":{ + "temperature_sensor": "@link:/entry/instrument/manipulator/temperature_sensor", + "sample_heater":"@link:/entry/instrument/manipulator/sample_heater", + "cryostat":"None" + }, + "gas_pressure":{ + "pressure_gauge":"@link:/entry/instrument/pressure_gauge" + }, + "bias":{ + "potentiostat":"@link:/entry/instrument/manipulator/sample_bias_potentiostat", + "voltmeter":"@link:/entry/instrument/manipulator/sample_bias_voltmeter" + }, + "drain_current":{ + "amperemeter":"@link:/entry/instrument/manipulator/drain_current_amperemeter" + }, + "flood_gun_current":{ + "flood_gun":"@link:/entry/instrument/flood_gun" + } + }, + "/ENTRY[entry]/data":{ + "@signal":"data", + "@default":"data", + "@axes":["energy"], + "data":"@data:cycle", + "data/@units":"counts_per_second", + "energy":"@data:energy", + "energy/@units":"eV", + "energy/@type":"@xps_token:data/energy_type", + "@energy_indices":"None", + "@energy_depends":"None" + } + } \ No newline at end of file diff --git a/pynxtools/dataconverter/readers/xps/config/config_txt_vamas_export.json b/pynxtools/dataconverter/readers/xps/config/config_txt_vamas_export.json index 9900402aa..6de354d50 100644 --- a/pynxtools/dataconverter/readers/xps/config/config_txt_vamas_export.json +++ b/pynxtools/dataconverter/readers/xps/config/config_txt_vamas_export.json @@ -1,81 +1,259 @@ { - "/ENTRY[entry]/DATA[data]/@signal": "", - "/ENTRY[entry]/DATA[data]/data": "@data:cycle", - "/ENTRY[entry]/DATA[data]/data/@units": "@xps_token:data/y_units", - "/ENTRY[entry]/DATA[data]/energy": "@data:energy", - "/ENTRY[entry]/DATA[data]/energy/@type": "@xps_token:data/x_units", - "/ENTRY[entry]/DATA[data]/energy/@units": "eV", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/distance": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/distance/@units": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/incident_energy": "@xps_token:beam/excitation_energy", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/incident_energy/@units": "@xps_token:beam/excitation_energy/units", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/incident_energy_spread": "", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/incident_energy_spread/@units": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/incident_polarization": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/incident_polarization/@units": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/contrast_aperture": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/field_aperture": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/mode": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/projection": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/scheme": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/DATA[data]/@signal": "raw", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/DATA[data]/raw": "@detector_data:cycles/Scan_", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/DATA[data]/raw/@units": "counts", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/amplifier_type": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/detector_type": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/count_time": "@xps_token:region/dwell_time", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/count_time/@units": "@xps_token:region/dwell_time/time", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/ENERGYDISPERSION[energydispersion]/energy_scan_mode": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/ENERGYDISPERSION[energydispersion]/entrance_slit": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/ENERGYDISPERSION[energydispersion]/exit_slit": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/ENERGYDISPERSION[energydispersion]/pass_energy": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/ENERGYDISPERSION[energydispersion]/pass_energy/@units": "eV", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/ENERGYDISPERSION[energydispersion]/scheme": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/description": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/energy_resolution": "@xps_token:data/step_size", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/energy_resolution/@units": "eV", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/fast_axes": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/slow_axes": "energy", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/name": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/drain_current": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/drain_current/@units": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/sample_bias": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/sample_bias/@units": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/sample_temperature": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/sample_temperature/@units": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source]/name": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source]/probe": "photon", - "/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source]/type": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/energy_resolution": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/energy_resolution/@units": "eV", - "/ENTRY[entry]/INSTRUMENT[instrument]/work_function/": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/work_function/@units": "eV", - "/ENTRY[entry]/PROCESS[process]/angular_calibration/applied": false, - "/ENTRY[entry]/PROCESS[process]/energy_calibration/applied": "@eln", - "/ENTRY[entry]/PROCESS[process]/energy_calibration/calibrated_axis": "@data:energy", - "/ENTRY[entry]/PROCESS[process]/energy_calibration/calibrated_axis/@units": "eV", - "/ENTRY[entry]/PROCESS[process]/momentum_calibration/applied": false, - "/ENTRY[entry]/PROCESS[process]/spatial_calibration/applied": false, - "/ENTRY[entry]/SAMPLE[sample]/bias": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/bias/@units": "V", - "/ENTRY[entry]/SAMPLE[sample]/chemical_formula": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/gas_pressure": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/gas_pressure/@units": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/name": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/preparation_date": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/preparation_description": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/sample_history": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/situation": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/temperature": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/temperature/@units": "@eln", - "/ENTRY[entry]/USER[user]/address": "@eln", - "/ENTRY[entry]/USER[user]/affiliation": "@eln", - "/ENTRY[entry]/USER[user]/email": "@eln", - "/ENTRY[entry]/USER[user]/name": "@eln", - "/ENTRY[entry]/USER[user]/orcid": "@eln", - "/ENTRY[entry]/method": "@eln", - "/ENTRY[entry]/definition": "@eln", - "/ENTRY[entry]/definition/@version": "@eln", - "/ENTRY[entry]/start_time": "@eln", - "/ENTRY[entry]/title": "@eln" -} \ No newline at end of file + "/@default":"entry", + "/ENTRY[entry]":{ + "@default":"data", + "definition":"@eln", + "definition/@version":"@eln", + "title":"@eln", + "start_time":"@eln", + "end_time":"@eln", + "experiment_institution":"@eln", + "experiment_facility":"@eln", + "experiment_laboratory":"@eln", + "entry_identifier":"@eln", + "duration":"@eln", + "duration/@units":"@eln", + "method":"@eln", + "program_name":"@eln" + }, + "/ENTRY[entry]/USER[user]":{ + "name":"@eln", + "affiliation":"@eln", + "address":"@eln", + "orcid":"@eln", + "email":"@eln" + }, + "/ENTRY[entry]/INSTRUMENT[instrument]":{ + "device_information":{ + "vendor":"@eln", + "identifier":"@eln", + "model":"@eln" + }, + "energy_resolution":{ + "physical_quantity":"energy", + "type":"@eln", + "resolution":"@xps_token:data/step_size", + "resolution/@units":"@eln" + }, + "source_TYPE[source_probe]":{ + "type":"@eln", + "name":"@eln", + "probe":"photon", + "device_information":{ + "vendor":"@eln", + "identifier":"@eln", + "model":"@eln" + }, + "associated_beam":"@link:/entry/instrument/beam_probe" + }, + "beam_TYPE[beam_probe]":{ + "distance":"@eln", + "distance/@units":"@eln", + "incident_energy":"@xps_token:beam/excitation_energy", + "incident_energy/@units":"@xps_token:beam/excitation_energy/units", + "incident_energy_spread":"None", + "incident_energy_spread/@units":"None", + "incident_polarization":"None", + "incident_polarization/@units":"None", + "extent":"None", + "associated_source":"@link:/entry/instrument/source_probe" + }, + "ELECTRONANALYSER[electronanalyser]":{ + "@default": "None", + "name":"@eln", + "description":"@eln", + "work_function":"@eln", + "work_function/@units":"@eln", + "fast_axes":"None", + "slow_axes":"energy", + "device_information":{ + "vendor":"@eln", + "model":"@eln", + "identifier":"@eln" + }, + "energy_resolution":{ + "physical_quantity":"energy", + "type":"@eln", + "resolution":"@xps_token:data/step_size", + "resolution/@units":"@eln" + }, + "transmission_function":"None", + "COLLECTIONCOLUMN[collectioncolumn]":{ + "scheme":"@eln", + "lens_mode":"@eln", + "projection":"None", + "angular_acceptance":"None", + "spatial_acceptance":"None", + "field_aperture":"None", + "contrast_aperture":"None", + "device_information":{ + "vendor":"@eln", + "model":"@eln", + "identifier":"@eln" + } + }, + "ENERGYDISPERSION[energydispersion]":{ + "scheme":"@eln", + "pass_energy":"@eln", + "pass_energy/@units":"@eln", + "energy_scan_mode":"@eln", + "entrance_slit":"@eln", + "exit_slit":"@eln", + "device_information":{ + "vendor":"@eln", + "model":"@eln", + "identifier":"@eln" + } + }, + "DETECTOR[detector]":{ + "@default":"raw_data", + "amplifier_type":"@eln", + "detector_type":"@eln", + "count_time":"@xps_token:detector/dwell_time", + "count_time/@units":"@xps_token:detector/dwell_time/units", + "device_information":{ + "vendor":"@eln", + "model":"@eln", + "identifier":"@eln" + }, + "raw_data":{ + "@signal":"raw", + "@default":"raw", + "raw":"@detector_data:cycles/Scan_", + "raw/@units":"counts" + } + } + }, + "MANIPULATOR[manipulator]":{ + "device_information":{ + "vendor":"@eln", + "model":"@eln", + "identifier":"@eln" + }, + "temperature_sensor":{ + "name":"@eln", + "measurement":"@eln", + "type":"@eln", + "attached_to":"@eln", + "value":"@eln" + }, + "sample_heater":{ + "name":"@eln", + "physical_quantity":"@eln", + "type":"@eln", + "heater_power":"@eln", + "PID[pid]/setpoint":"@eln" + }, + "cryostat":{ + "name":"None", + "physical_quantity":"None", + "type":"None", + "PID[pid]/setpoint":"None" + }, + "drain_current_amperemeter":{ + "name":"@eln", + "measurement":"@eln", + "type":"@eln", + "value":"@eln" + }, + "sample_bias_voltmeter":{ + "name":"@eln", + "measurement":"@eln", + "type":"@eln", + "value":"@eln" + }, + "sample_bias_potentiostat":{ + "name":"@eln", + "physical_quantity":"@eln", + "type":"@eln", + "PID[pid]/setpoint":"@eln" + } + }, + "pressure_gauge":{ + "name":"@eln", + "measurement":"@eln", + "type":"@eln", + "value":"@eln", + "value_log/value":"@eln" + }, + "flood_gun":{ + "name":"@eln", + "physical_quantity":"@eln", + "type":"@eln", + "current":"@eln", + "current_log/value":"@eln" + } + }, + "/ENTRY[entry]/PROCESS[process]":{ + "energy_calibration":{ + "calibrated_axis":"@data:energy", + "calibrated_axis/@units":"eV" + }, + "energy_referencing":{ + "level":"None", + "reference_peak":"None", + "binding_energy":"None", + "offset":"None", + "calibrated_axis":"None" + } + }, + "/ENTRY[entry]/SAMPLE[sample]":{ + "name":"@xps_token:parameters/Group", + "sample_id":"@eln", + "atom_types":"@eln", + "physical_form":"@eln", + "situation":"@eln", + "SUBSTANCE[substance]":{ + "name":"@eln", + "molecular_mass":"@eln", + "cas_number":"@eln", + "molecular_formula_hill":"@eln" + }, + "sample_history":{ + "sample_preparation":{ + "start_time":"@eln", + "end_time":"@eln", + "description":"@eln", + "method":"@eln" + }, + "PHYSICAL_PROCESS[sample_loading]":{ + "start_time":"@eln", + "end_time":"@eln", + "description":"@eln", + "method":"@eln" + } + }, + "temperature":{ + "temperature_sensor": "@link:/entry/instrument/manipulator/temperature_sensor", + "sample_heater":"@link:/entry/instrument/manipulator/sample_heater", + "cryostat":"None" + }, + "gas_pressure":{ + "pressure_gauge":"@link:/entry/instrument/pressure_gauge" + }, + "bias":{ + "potentiostat":"@link:/entry/instrument/manipulator/sample_bias_potentiostat", + "voltmeter":"@link:/entry/instrument/manipulator/sample_bias_voltmeter" + }, + "drain_current":{ + "amperemeter":"@link:/entry/instrument/manipulator/drain_current_amperemeter" + }, + "flood_gun_current":{ + "flood_gun":"@link:/entry/instrument/flood_gun" + } + }, + "/ENTRY[entry]/data":{ + "@signal":"data", + "@default":"data", + "@axes":["energy"], + "data":"@data:cycle", + "data/@units":"@xps_token:data/y_units", + "energy":"@link:/entry/process/energy_calibration/calibrated_axis", + "energy/@type":"@xps_token:data/x_units", + "energy/@units":"eV", + "@energy_indices":"None", + "@energy_depends":"None" + } + } + + \ No newline at end of file diff --git a/pynxtools/dataconverter/readers/xps/config/config_vms.json b/pynxtools/dataconverter/readers/xps/config/config_vms.json index 78dbe4ec9..fabe167d2 100644 --- a/pynxtools/dataconverter/readers/xps/config/config_vms.json +++ b/pynxtools/dataconverter/readers/xps/config/config_vms.json @@ -1,95 +1,289 @@ { - "/ENTRY[entry]/DATA[data]/@signal": "", - "/ENTRY[entry]/DATA[data]/data": "@data:cycle", - "/ENTRY[entry]/DATA[data]/data/@units": "@xps_token:data/y_units_1", - "/ENTRY[entry]/DATA[data]/energy": "@data:energy", - "/ENTRY[entry]/DATA[data]/energy/@type": "@xps_token:data/x_units_1", - "/ENTRY[entry]/DATA[data]/energy/@units": "eV", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/distance": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/distance/@units": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/incident_energy": "@xps_token:beam/excitation_energy", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/incident_energy/@units": "eV", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/incident_energy_spread": "", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/incident_energy_spread/@units": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/incident_polarization": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/incident_polarization/@units": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/contrast_aperture": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/field_aperture": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/mode": "@xps_token:collectioncolumn/lens_mode", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/projection": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/scheme": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/DATA[data]/@signal": "raw", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/DATA[data]/raw": "@detector_data:cycles/Cycle_", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/DATA[data]/raw/@units": "counts", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/amplifier_type": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/detector_type": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/count_time": "@xps_token:region/dwell_time", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/count_time/@units": "s", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/signal_mode": "@xps_token:detector/signal_mode", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/detector_voltage": "@xps_token:detector/detector_voltage", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/detector_voltage/@units": "V", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/ENERGYDISPERSION[energydispersion]/energy_scan_mode": "@xps_token:energydispersion/scan_mode", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/ENERGYDISPERSION[energydispersion]/entrance_slit": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/ENERGYDISPERSION[energydispersion]/exit_slit": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/ENERGYDISPERSION[energydispersion]/pass_energy": "@xps_token:energydispersion/pass_energy", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/ENERGYDISPERSION[energydispersion]/pass_energy/@units": "eV", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/ENERGYDISPERSION[energydispersion]/scheme": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/description": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/energy_resolution": "@xps_token:data/step_size", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/energy_resolution/@units": "eV", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/fast_axes": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/slow_axes": "energy", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/name": "@xps_token:analyser/analyser_name", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/analyzer_take_off_azimuth/": "@xps_token:analyser/analyzer_take_off_azimuth", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/analyzer_take_off_azimuth/@units": "degree", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/analyzer_take_off_polar/": "@xps_token:analyser/analyzer_take_off_polar", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/analyzer_take_off_polar/@units": "degree", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/analysis_width_x/": "@xps_token:analyser/analysis_width_x", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/analysis_width_x/@units": "mm", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/analysis_width_y/": "@xps_token:analyser/analysis_width_y", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/analysis_width_y/@units": "mm", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/target_bias/": "@xps_token:analyser/target_bias", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/target_bias/@units": "V", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/drain_current": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/drain_current/@units": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/sample_bias": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/sample_bias/@units": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/sample_temperature": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/sample_temperature/@units": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source]/name": "@xps_token:source/source_label", - "/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source]/probe": "photon", - "/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source]/source_analyzer_angle": "@xps_token:source/source_analyzer_angle", - "/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source]/source_analyzer_angle/@units": "degree", - "/ENTRY[entry]/INSTRUMENT[instrument]/energy_resolution": "@xps_token:data/step_size", - "/ENTRY[entry]/INSTRUMENT[instrument]/energy_resolution/@units": "eV", - "/ENTRY[entry]/INSTRUMENT[instrument]/work_function/": "@xps_token:instrument/work_function", - "/ENTRY[entry]/INSTRUMENT[instrument]/work_function/@units": "eV", - "/ENTRY[entry]/PROCESS[process]/angular_calibration/applied": false, - "/ENTRY[entry]/PROCESS[process]/energy_calibration/applied": "@eln", - "/ENTRY[entry]/PROCESS[process]/energy_calibration/calibrated_axis": "@data:energy", - "/ENTRY[entry]/PROCESS[process]/energy_calibration/calibrated_axis/@units": "eV", - "/ENTRY[entry]/PROCESS[process]/momentum_calibration/applied": false, - "/ENTRY[entry]/PROCESS[process]/spatial_calibration/applied": false, - "/ENTRY[entry]/SAMPLE[sample]/bias": "@xps_token:sample/target_bias", - "/ENTRY[entry]/SAMPLE[sample]/bias/@units": "V", - "/ENTRY[entry]/SAMPLE[sample]/chemical_formula": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/gas_pressure": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/gas_pressure/@units": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/name": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/preparation_date": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/preparation_description": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/sample_history": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/situation": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/temperature": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/temperature/@units": "@eln", - "/ENTRY[entry]/USER[user]/address": "@eln", - "/ENTRY[entry]/USER[user]/affiliation": "@eln", - "/ENTRY[entry]/USER[user]/email": "@eln", - "/ENTRY[entry]/USER[user]/name": "@eln", - "/ENTRY[entry]/USER[user]/orcid": "@eln", - "/ENTRY[entry]/method": "@xps_token:region/analysis_method", - "/ENTRY[entry]/definition": "@eln", - "/ENTRY[entry]/definition/@version": "@eln", - "/ENTRY[entry]/start_time": "@xps_token:region/time_stamp", - "/ENTRY[entry]/title": "@eln" -} \ No newline at end of file + "/@default":"entry", + "/ENTRY[entry]":{ + "@default":"data", + "definition":"@eln", + "definition/@version":"@eln", + "title":"@eln", + "start_time":"@xps_token:region/time_stamp", + "end_time":"@eln", + "experiment_institution":"@eln", + "experiment_facility":"@eln", + "experiment_laboratory":"@eln", + "entry_identifier":"@eln", + "duration":"None", + "duration/@units":"s", + "method":"@xps_token:region/analysis_method", + "program_name":"@eln" + }, + "/ENTRY[entry]/USER[user]":{ + "name":"@eln", + "affiliation":"@eln", + "address":"@eln", + "orcid":"@eln", + "email":"@eln" + }, + "/ENTRY[entry]/INSTRUMENT[instrument]":{ + "device_information":{ + "vendor":"@eln", + "identifier":"@eln", + "model":"@eln" + }, + "energy_resolution":{ + "physical_quantity":"energy", + "type":"derived", + "resolution":"@xps_token:data/step_size", + "resolution/@units":"eV" + }, + "source_TYPE[source_probe]":{ + "type":"@eln", + "name":"@xps_token:source/source_label", + "probe":"photon", + "device_information":{ + "vendor":"@eln", + "identifier":"@eln", + "model":"@eln" + }, + "associated_beam":"@link:/entry/instrument/beam_probe", + "source_analyzer_angle": "source_analyzer_angle", + "source_analyzer_angle/@units": "degree" + }, + "beam_TYPE[beam_probe]":{ + "distance":"@eln", + "distance/@units":"@eln", + "incident_energy":"@xps_token:beam/excitation_energy", + "incident_energy/@units":"eV", + "incident_energy_spread":"None", + "incident_energy_spread/@units":"None", + "incident_polarization":"None", + "incident_polarization/@units":"None", + "extent":"None", + "associated_source":"@link:/entry/instrument/source_probe" + }, + "ELECTRONANALYSER[electronanalyser]":{ + "@default": "detector0", + "name":"@xps_token:analyser/analyser_name", + "description":"@eln", + "work_function":"@xps_token:analyser/work_function", + "work_function/@units":"eV", + "fast_axes":"None", + "slow_axes":"energy", + "analyzer_take_off_azimuth": "@xps_token:analyser/analyzer_take_off_azimuth", + "analyzer_take_off_azimuth/@units": "degree", + "analyzer_take_off_polar/": "@xps_token:analyser/analyzer_take_off_polar", + "analyzer_take_off_polar/@units": "degree", + "analysis_width_x": "@xps_token:analyser/analysis_width_x", + "analysis_width_x/@units": "mm", + "analysis_width_y": "@xps_token:analyser/analysis_width_y", + "analysis_width_y/@units": "mm", + "target_bias": "@xps_token:analyser/target_bias", + "target_bias/@units": "V", + "device_information":{ + "vendor":"@eln", + "model":"@eln", + "identifier":"@eln" + }, + "energy_resolution":{ + "physical_quantity":"energy", + "type":"estimated", + "resolution":"@xps_token:data/step_size", + "resolution/@units":"eV" + }, + "transmission_function":{ + "@default":"relative_intensity", + "@signal":"relative_intensity", + "@axes":["kinetic_energy"], + "kinetic_energy":"@xps_token:transmission_function/kinetic_energy", + "kinetic_energy/@units":"@xps_token:transmission_function/kinetic_energy/@units", + "relative_intensity":"@xps_token:collectioncolumn/transmission_function/relative_intensity" + }, + "COLLECTIONCOLUMN[collectioncolumn]":{ + "scheme":"@eln", + "lens_mode":"@xps_token:collectioncolumn/lens_mode", + "projection":"None", + "angular_acceptance":"None", + "spatial_acceptance":"None", + "field_aperture":"None", + "contrast_aperture":"None", + "device_information":{ + "vendor":"@eln", + "model":"@eln", + "identifier":"@eln" + } + }, + "ENERGYDISPERSION[energydispersion]":{ + "scheme":"@eln", + "pass_energy":"@xps_token:energydispersion/pass_energy", + "pass_energy/@units":"@xps_token:energydispersion/pass_energy/@units", + "energy_scan_mode":"@xps_token:energydispersion/scan_mode", + "entrance_slit":"@eln", + "exit_slit":"@eln", + "device_information":{ + "vendor":"@eln", + "model":"@eln", + "identifier":"@eln" + }, + }, + "DETECTOR[detector]":{ + "@default":"raw_data", + "amplifier_type":"@eln", + "detector_type":"@eln", + "detector_voltage": "@xps_token:detector/detector_voltage", + "detector_voltage/@units": "V", + "count_time":"@xps_token:detector/dwell_time", + "count_time/@units":"s", + "acquisition_mode": "@xps_token:detector/signal_mode", + "device_information":{ + "vendor":"@eln", + "model":"@eln", + "identifier":"@eln" + }, + "raw_data":{ + "@signal":"raw", + "@default":"raw", + "raw":"@detector_data:cycles/Cycle_", + "raw/@units":"counts" + } + } + }, + "MANIPULATOR[manipulator]":{ + "device_information":{ + "vendor":"@eln", + "model":"@eln", + "identifier":"@eln" + }, + "temperature_sensor":{ + "name":"@eln", + "measurement":"@eln", + "type":"@eln", + "attached_to":"@eln", + "value":"@eln" + }, + "sample_heater":{ + "name":"@eln", + "physical_quantity":"@eln", + "type":"@eln", + "heater_power":"@eln", + "PID[pid]/setpoint":"@eln" + }, + "cryostat":{ + "name":"None", + "physical_quantity":"None", + "type":"None", + "PID[pid]/setpoint":"None" + }, + "drain_current_amperemeter":{ + "name":"@eln", + "measurement":"@eln", + "type":"@eln", + "value":"@eln" + }, + "sample_bias_voltmeter":{ + "name":"@eln", + "measurement":"@eln", + "type":"@eln", + "value":"@xps_token:sample/target_bias", + "value/@units": "V" + }, + "sample_bias_potentiostat":{ + "name":"@eln", + "physical_quantity":"@eln", + "type":"@eln", + "PID[pid]/setpoint":"@eln" + } + }, + "pressure_gauge":{ + "name":"@eln", + "measurement":"@eln", + "type":"@eln", + "value":"@eln", + "value_log/value":"@eln" + }, + "flood_gun":{ + "name":"@eln", + "physical_quantity":"@eln", + "type":"@eln", + "current":"@eln", + "current_log/value":"@eln" + } + }, + "/ENTRY[entry]/PROCESS[process]":{ + "energy_calibration":{ + "calibrated_axis":"@data:energy", + "calibrated_axis/@units":"eV", + }, + "energy_referencing":{ + "level":"None", + "reference_peak":"None", + "binding_energy":"None", + "offset":"None", + "calibrated_axis":"None" + }, + "transmission_correction":{ + "transmission_function":{ + "@axes":"None", + "@signal":"None", + "kinetic_energy":"None", + "kinetic_energy/@units":"None", + "relative_intensity":"None" + } + } + }, + "/ENTRY[entry]/SAMPLE[sample]":{ + "name":"@eln", + "sample_id":"@eln", + "atom_types":"@eln", + "physical_form":"@eln", + "situation":"@eln", + "SUBSTANCE[substance]":{ + "name":"@eln", + "molecular_mass":"@eln", + "cas_number":"@eln", + "molecular_formula_hill":"@eln" + }, + "sample_history":{ + "sample_preparation":{ + "start_time":"@eln", + "end_time":"@eln", + "description":"@eln", + "method":"@eln" + }, + "PHYSICAL_PROCESS[sample_loading]":{ + "start_time":"@eln", + "end_time":"@eln", + "description":"@eln", + "method":"@eln" + } + }, + "temperature":{ + "temperature_sensor": "@link:/entry/instrument/manipulator/temperature_sensor", + "sample_heater":"@link:/entry/instrument/manipulator/sample_heater", + "cryostat":"None" + }, + "gas_pressure":{ + "pressure_gauge":"@link:/entry/instrument/pressure_gauge" + }, + "bias":{ + "potentiostat":"@link:/entry/instrument/manipulator/sample_bias_potentiostat", + "voltmeter":"@link:/entry/instrument/manipulator/sample_bias_voltmeter" + }, + "drain_current":{ + "amperemeter":"@link:/entry/instrument/manipulator/drain_current_amperemeter" + }, + "flood_gun_current":{ + "flood_gun":"@link:/entry/instrument/flood_gun" + } + }, + "/ENTRY[entry]/data":{ + "@signal":"data", + "@default":"data", + "@axes":["energy"], + "data":"@data:cycle", + "data/@units":"@xps_token:data/y_units_1", + "energy": "@data:energy", + "energy/@type":"@xps_token:data/x_units_1", + "energy/@units":"eV", + "@energy_indices":"None", + "@energy_depends":"None" + } + } \ No newline at end of file diff --git a/pynxtools/dataconverter/readers/xps/config/config_xml_specs.json b/pynxtools/dataconverter/readers/xps/config/config_xml_specs.json index 9bee088c6..1bc5df069 100644 --- a/pynxtools/dataconverter/readers/xps/config/config_xml_specs.json +++ b/pynxtools/dataconverter/readers/xps/config/config_xml_specs.json @@ -1,73 +1,249 @@ { - "/ENTRY[entry]/DATA[data]/@signal": "data", - "/ENTRY[entry]/DATA[data]/data": "@data:cycles/Cycle_", - "/ENTRY[entry]/DATA[data]/data/@units": "counts", - "/ENTRY[entry]/DATA[data]/binding_energy": "counts", - "/ENTRY[entry]/DATA[data]/binding_energy/@units": "eV", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/distance": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/distance/@units": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/incident_energy": "@xps_token:region/excitation_energy", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/incident_energy/@units": "eV", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/incident_energy_spread": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/incident_energy_spread/@units": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/incident_polarization": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/incident_polarization/@units": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/contrast_aperture": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/field_aperture": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/mode": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/projection": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/scheme": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/DATA[data]/@signal": "raw", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/DATA[data]/raw": "@detector_data:cycles/Cycle_", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/DATA[data]/raw/@units": "counts", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/amplifier_type": "channeltron", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/ENERGYDISPERSION[energydispersion]/energy_scan_mode": "@xps_token:region/scan_mode/name", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/ENERGYDISPERSION[energydispersion]/entrance_slit": "@xps_token:region/analyzer_slit", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/ENERGYDISPERSION[energydispersion]/exit_slit": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/ENERGYDISPERSION[energydispersion]/pass_energy": "@xps_token:region/pass_energy", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/ENERGYDISPERSION[energydispersion]/pass_energy/@units": "eV", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/ENERGYDISPERSION[energydispersion]/scheme": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/description": "@xps_token:analyzer_info/name", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/energy_resolution": "@xps_token:region/scan_delta", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/energy_resolution/@units": "eV", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/fast_axes": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/slow_axes": "energy", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/drain_current": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/drain_current/@units": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/sample_bias": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/sample_bias/@units": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/sample_temperature": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/sample_temperature/@units": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source]/name": "@xps_token:source_info/name", - "/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source]/probe": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source]/type": "@eln", - "/ENTRY[entry]/INSTRUMENT[instrument]/energy_resolution": "@xps_token:region/scan_delta", - "/ENTRY[entry]/INSTRUMENT[instrument]/energy_resolution/@units": "eV", - "/ENTRY[entry]/PROCESS[process]/angular_calibration/applied": false, - "/ENTRY[entry]/PROCESS[process]/energy_calibration/applied": true, - "/ENTRY[entry]/PROCESS[process]/energy_calibration/calibrated_axis": "@data:energy", - "/ENTRY[entry]/PROCESS[process]/energy_calibration/calibrated_axis/@units": "eV", - "/ENTRY[entry]/PROCESS[process]/momentum_calibration/applied": false, - "/ENTRY[entry]/PROCESS[process]/spatial_calibration/applied": false, - "/ENTRY[entry]/SAMPLE[sample]/bias": "None", - "/ENTRY[entry]/SAMPLE[sample]/bias/@units": "None", - "/ENTRY[entry]/SAMPLE[sample]/chemical_formula": "None", - "/ENTRY[entry]/SAMPLE[sample]/gas_pressure": "None", - "/ENTRY[entry]/SAMPLE[sample]/gas_pressure/@units": "None", - "/ENTRY[entry]/SAMPLE[sample]/name": "@xps_token:parameters/Group", - "/ENTRY[entry]/SAMPLE[sample]/preparation_date": "None", - "/ENTRY[entry]/SAMPLE[sample]/preparation_description": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/sample_history": "None", - "/ENTRY[entry]/SAMPLE[sample]/situation": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/temperature": "@eln", - "/ENTRY[entry]/SAMPLE[sample]/temperature/@units": "@eln", - "/ENTRY[entry]/USER[user]/address": "None", - "/ENTRY[entry]/USER[user]/affiliation": "None", - "/ENTRY[entry]/USER[user]/email": "@eln", - "/ENTRY[entry]/USER[user]/name": "@eln", - "/ENTRY[entry]/USER[user]/orcid": "None", - "/ENTRY[entry]/definition": "@eln", - "/ENTRY[entry]/definition/@version": "@eln", - "/ENTRY[entry]/start_time": "@eln", - "/ENTRY[entry]/title": "@eln" -} + "/@default":"entry", + "/ENTRY[entry]":{ + "@default":"data", + "definition":"@eln", + "definition/@version":"@eln", + "title":"@eln", + "start_time":"@eln", + "end_time":"@eln", + "experiment_institution":"@eln", + "experiment_facility":"@eln", + "experiment_laboratory":"@eln", + "entry_identifier":"@eln", + "method":"@xps_token:region/analysis_method", + "program_name":"@eln" + }, + "/ENTRY[entry]/USER[user]":{ + "name":"@eln", + "affiliation":"@eln", + "address":"@eln", + "orcid":"@eln", + "email":"@eln" + }, + "/ENTRY[entry]/INSTRUMENT[instrument]":{ + "device_information":{ + "vendor":"@eln", + "identifier":"@eln", + "model":"@eln" + }, + "energy_resolution":{ + "physical_quantity":"energy", + "type":"@eln", + "resolution":"@xps_token:region/scan_delta", + "resolution/@units":"eV" + }, + "source_TYPE[source_probe]":{ + "type":"@eln", + "name":"@xps_token:source_info/name", + "probe":"@eln", + "device_information":{ + "vendor":"@eln", + "identifier":"@eln", + "model":"@eln" + }, + "associated_beam":"@link:/entry/instrument/beam_probe" + }, + "beam_TYPE[beam_probe]":{ + "distance":"@eln", + "distance/@units":"@eln", + "incident_energy":"@xps_token:beam/excitation_energy", + "incident_energy/@units":"eV", + "incident_energy_spread":"None", + "incident_energy_spread/@units":"None", + "incident_polarization":"None", + "incident_polarization/@units":"None", + "extent":"None", + "associated_source":"@link:/entry/instrument/source_probe" + }, + "ELECTRONANALYSER[electronanalyser]":{ + "@default": "None", + "name":"@xps_token:analyzer_info/name", + "description":"@eln", + "work_function":"@eln", + "work_function/@units":"@eln", + "fast_axes":"None", + "slow_axes":"energy", + "device_information":{ + "vendor":"@eln", + "model":"@eln", + "identifier":"@eln" + }, + "energy_resolution":{ + "physical_quantity":"energy", + "type":"estimated", + "resolution":"@xps_token:region/scan_delta", + "resolution/@units":"eV" + }, + "transmission_function":"None", + "COLLECTIONCOLUMN[collectioncolumn]":{ + "scheme":"@eln", + "lens_mode":"@xps_token:collectioncolumn/lens_mode", + "projection":"None", + "angular_acceptance":"None", + "spatial_acceptance":"None", + "field_aperture":"None", + "contrast_aperture":"None", + "device_information":{ + "vendor":"@eln", + "model":"@eln", + "identifier":"@eln" + } + }, + "ENERGYDISPERSION[energydispersion]":{ + "scheme":"@eln", + "pass_energy":"@xps_token:region/pass_energy", + "pass_energy/@units":"eV", + "energy_scan_mode":"@xps_token:region/scan_mode/name", + "entrance_slit/description":"@xps_token:region/analyzer_slit", + "exit_slit/description":"None", + "device_information":{ + "vendor":"@eln", + "model":"@eln", + "identifier":"@eln" + }, + "diameter":"@eln", + "diameter/@units":"@eln" + }, + "DETECTOR[detector]":{ + "@default":"raw_data", + "amplifier_type":"@eln", + "detector_type":"@eln", + "device_information":{ + "vendor":"@eln", + "model":"@eln", + "identifier":"@eln" + }, + "raw_data":{ + "@signal":"raw", + "@default":"raw", + "raw":"@detector_data:cycles/Cycle_", + "raw/@units":"counts" + } + } + }, + "MANIPULATOR[manipulator]":{ + "device_information":{ + "vendor":"@eln", + "model":"@eln", + "identifier":"@eln" + }, + "temperature_sensor":{ + "name":"@eln", + "measurement":"@eln", + "type":"@eln", + "attached_to":"@eln", + "value":"@eln" + }, + "sample_heater":{ + "name":"@eln", + "physical_quantity":"@eln", + "type":"@eln", + "heater_power":"@eln", + "PID[pid]/setpoint":"@eln" + }, + "cryostat":{ + "name":"None", + "physical_quantity":"None", + "type":"None", + "PID[pid]/setpoint":"None" + }, + "drain_current_amperemeter":{ + "name":"@eln", + "measurement":"@eln", + "type":"@eln", + "value":"@eln" + }, + "sample_bias_voltmeter":{ + "name":"@eln", + "measurement":"@eln", + "type":"@eln", + "value":"@eln" + }, + "sample_bias_potentiostat":{ + "name":"@eln", + "physical_quantity":"@eln", + "type":"@eln", + "PID[pid]/setpoint":"@eln" + } + }, + "pressure_gauge":{ + "name":"@eln", + "measurement":"@eln", + "type":"@eln", + "value":"@eln", + "value_log/value":"@eln" + }, + "flood_gun":{ + "name":"@eln", + "physical_quantity":"@eln", + "type":"@eln", + "current":"@eln", + "current_log/value":"@eln" + } + }, + "/ENTRY[entry]/PROCESS[process]":{ + "energy_calibration":{ + "calibrated_axis":"@data:energy", + "calibrated_axis/@units":"eV" + }, + "energy_referencing":{ + "level":"None", + "reference_peak":"None", + "binding_energy":"None", + "offset":"None", + "calibrated_axis":"None" + } + }, + "/ENTRY[entry]/SAMPLE[sample]":{ + "name":"@xps_token:parameters/Group", + "sample_id":"@eln", + "atom_types":"@eln", + "physical_form":"@eln", + "situation":"@eln", + "SUBSTANCE[substance]":{ + "name":"@eln", + "molecular_mass":"@eln", + "cas_number":"@eln", + "molecular_formula_hill":"@eln" + }, + "sample_history":{ + "sample_preparation":{ + "start_time":"@eln", + "end_time":"@eln", + "description":"@eln", + "method":"@eln" + } + }, + "temperature":{ + "temperature_sensor": "@link:/entry/instrument/manipulator/temperature_sensor", + "sample_heater":"@link:/entry/instrument/manipulator/sample_heater", + "cryostat":"None" + }, + "gas_pressure":{ + "pressure_gauge":"@link:/entry/instrument/pressure_gauge" + }, + "bias":{ + "potentiostat":"@link:/entry/instrument/manipulator/sample_bias_potentiostat", + "voltmeter":"@link:/entry/instrument/manipulator/sample_bias_voltmeter" + }, + "drain_current":{ + "amperemeter":"@link:/entry/instrument/manipulator/drain_current_amperemeter" + }, + "flood_gun_current":{ + "flood_gun":"@link:/entry/instrument/flood_gun" + } + }, + "/ENTRY[entry]/data":{ + "@signal":"data", + "@default":"data", + "@axes":["energy"], + "data":"@data:cycle", + "data/@units":"counts", + "energy":"@link:/entry/process/energy_calibration/calibrated_axis", + "energy/@type":"kinetic", + "energy/@units":"eV", + "@energy_indices":"None", + "@energy_depends":"None" + } + } \ No newline at end of file diff --git a/pynxtools/dataconverter/readers/xps/config/template.json b/pynxtools/dataconverter/readers/xps/config/template.json index c35a10a1f..478b4a999 100644 --- a/pynxtools/dataconverter/readers/xps/config/template.json +++ b/pynxtools/dataconverter/readers/xps/config/template.json @@ -1,81 +1,251 @@ { - "/ENTRY[entry]/DATA[data]/@signal": "None", - "/ENTRY[entry]/DATA[data]/data": "None", - "/ENTRY[entry]/DATA[data]/data/@units": "None", - "/ENTRY[entry]/DATA[data]/energy": "None", - "/ENTRY[entry]/DATA[data]/energy/@type": "None", - "/ENTRY[entry]/DATA[data]/energy/@units": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/distance": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/distance/@units": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/incident_energy": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/incident_energy/@units": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/incident_energy_spread": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/incident_energy_spread/@units": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/incident_polarization": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/BEAM[beam]/incident_polarization/@units": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/contrast_aperture": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/field_aperture": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/mode": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/projection": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]/scheme": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/DATA[data]/@signal": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/DATA[data]/raw": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/DATA[data]/raw/@units": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/amplifier_type": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/detector_type": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/count_time": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]/count_time/@units": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/ENERGYDISPERSION[energydispersion]/energy_scan_mode": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/ENERGYDISPERSION[energydispersion]/entrance_slit": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/ENERGYDISPERSION[energydispersion]/exit_slit": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/ENERGYDISPERSION[energydispersion]/pass_energy": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/ENERGYDISPERSION[energydispersion]/pass_energy/@units": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/ENERGYDISPERSION[energydispersion]/scheme": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/description": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/energy_resolution": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/energy_resolution/@units": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/fast_axes": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/slow_axes": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/name": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/drain_current": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/drain_current/@units": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/sample_bias": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/sample_bias/@units": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/sample_temperature": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/sample_temperature/@units": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source]/name": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source]/probe": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source]/type": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/energy_resolution": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/energy_resolution/@units": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/work_function/": "None", - "/ENTRY[entry]/INSTRUMENT[instrument]/work_function/@units": "None", - "/ENTRY[entry]/PROCESS[process]/angular_calibration/applied": "None", - "/ENTRY[entry]/PROCESS[process]/energy_calibration/applied": "None", - "/ENTRY[entry]/PROCESS[process]/energy_calibration/calibrated_axis": "None", - "/ENTRY[entry]/PROCESS[process]/energy_calibration/calibrated_axis/@units": "None", - "/ENTRY[entry]/PROCESS[process]/momentum_calibration/applied": "None", - "/ENTRY[entry]/PROCESS[process]/spatial_calibration/applied": "None", - "/ENTRY[entry]/SAMPLE[sample]/bias": "None", - "/ENTRY[entry]/SAMPLE[sample]/bias/@units": "None", - "/ENTRY[entry]/SAMPLE[sample]/chemical_formula": "None", - "/ENTRY[entry]/SAMPLE[sample]/gas_pressure": "None", - "/ENTRY[entry]/SAMPLE[sample]/gas_pressure/@units": "None", - "/ENTRY[entry]/SAMPLE[sample]/name": "None", - "/ENTRY[entry]/SAMPLE[sample]/preparation_date": "None", - "/ENTRY[entry]/SAMPLE[sample]/preparation_description": "None", - "/ENTRY[entry]/SAMPLE[sample]/sample_history": "None", - "/ENTRY[entry]/SAMPLE[sample]/situation": "None", - "/ENTRY[entry]/SAMPLE[sample]/temperature": "None", - "/ENTRY[entry]/SAMPLE[sample]/temperature/@units": "None", - "/ENTRY[entry]/USER[user]/address": "None", - "/ENTRY[entry]/USER[user]/affiliation": "None", - "/ENTRY[entry]/USER[user]/email": "None", - "/ENTRY[entry]/USER[user]/name": "None", - "/ENTRY[entry]/USER[user]/orcid": "None", - "/ENTRY[entry]/method": "None", - "/ENTRY[entry]/definition": "None", - "/ENTRY[entry]/definition/@version": "None", - "/ENTRY[entry]/start_time": "None", - "/ENTRY[entry]/title": "None" -} \ No newline at end of file + "/@default":"None", + "/ENTRY[entry]":{ + "@default":"data", + "definition":"None", + "definition/@version":"None", + "title":"None", + "start_time":"None", + "end_time":"None", + "method":"None" + }, + "/ENTRY[entry]/USER[user]":{ + "name":"None", + "affiliation":"None" + }, + "/ENTRY[entry]/INSTRUMENT[instrument]":{ + "device_information":{ + "vendor":"None", + "identifier":"None", + "model":"None" + }, + "energy_resolution":{ + "physical_quantity":"energy", + "type":"None", + "resolution":"None", + "resolution/@units":"None" + }, + "source_TYPE[source_probe]":{ + "type":"None", + "type_other":"None", + "name":"None", + "probe":"None", + "device_information":{ + "vendor":"None", + "identifier":"None", + "model":"None" + }, + "associated_beam":"None" + }, + "beam_TYPE[beam_probe]":{ + "distance":"None", + "distance/@units":"None", + "incident_energy":"None", + "incident_energy/@units":"None", + "incident_energy_spread":"None", + "incident_energy_spread/@units":"None", + "incident_polarization":"None", + "incident_polarization/@units":"None", + "extent":"None", + "associated_source":"None" + }, + "ELECTRONANALYSER[electronanalyser]":{ + "@default": "None", + "description":"None", + "work_function":"None", + "work_function/@units":"None", + "fast_axes":"None", + "slow_axes":"None", + "device_information":{ + "vendor":"None", + "model":"None", + "identifier":"None" + }, + "energy_resolution":{ + "physical_quantity":"energy", + "type":"None", + "resolution":"None" + }, + "transmission_function":"None", + "COLLECTIONCOLUMN[collectioncolumn]":{ + "scheme":"None", + "lens_mode":"None", + "projection":"None", + "angular_acceptance":"None", + "spatial_acceptance":"None", + "field_aperture":"None", + "contrast_aperture":"None", + "iris":"None", + "device_information":{ + "vendor":"None", + "model":"None", + "identifier":"None" + } + }, + "ENERGYDISPERSION[energydispersion]":{ + "scheme":"None", + "pass_energy":"None", + "pass_energy/@units":"None", + "energy_scan_mode":"None", + "entrance_slit":"None", + "exit_slit":"None", + "device_information":{ + "vendor":"None", + "model":"None", + "identifier":"None" + } + }, + "DETECTOR[detector]":{ + "@default":"raw_data", + "amplifier_type":"None", + "detector_type":"None", + "device_information":{ + "vendor":"None", + "model":"None", + "identifier":"None" + }, + "raw_data":{ + "@signal":"None", + "@default":"raw", + "raw":"None" + } + } + }, + "MANIPULATOR[manipulator]":{ + "device_information":{ + "vendor":"None", + "model":"None", + "identifier":"None" + }, + "temperature_sensor":{ + "name":"None", + "measurement":"None", + "type":"None", + "value":"None" + }, + "sample_heater":{ + "name":"None", + "physical_quantity":"None", + "type":"None", + "heater_power":"None", + "PID[pid]/setpoint":"None" + }, + "cryostat":{ + "name":"None", + "physical_quantity":"None", + "type":"None", + "PID[pid]/setpoint":"None" + }, + "drain_current_amperemeter":{ + "name":"None", + "measurement":"None", + "type":"None", + "value":"None" + }, + "sample_bias_voltmeter":{ + "name":"@eln", + "measurement":"@eln", + "type":"@eln", + "value":"@eln" + }, + "sample_bias_potentiostat":{ + "name":"None", + "physical_quantity":"None", + "type":"None", + "PID[pid]/setpoint":"None" + } + }, + "pressure_gauge":{ + "name":"None", + "measurement":"None", + "type":"None", + "value":"None", + "value_log/value":"None" + }, + "flood_gun":{ + "name":"None", + "physical_quantity":"None", + "type":"None", + "current":"None", + "current/@units":"None", + "current_log/value":"None", + "current_log/value/@units":"None" + } + }, + "/ENTRY[entry]/PROCESS[process]":{ + "angular_calibration":{ + "calibrated_axis":"None" + }, + "energy_calibration":{ + "calibrated_axis":"None" + }, + "energy_referencing":{ + "level":"None", + "reference_peak":"None", + "binding_energy":"None", + "offset":"None", + "calibrated_axis":"None" + }, + "momentum_calibration":{ + "calibrated_axis":"None" + }, + "spatial_calibration":{ + "calibrated_axis":"None" + }, + "transmission_correction":{ + "transmission_function":{ + "@axes":"None", + "@signal":"None", + "kinetic_energy":"None", + "kinetic_energy/@units":"None", + "relative_intensity":"None" + } + } + }, + "/ENTRY[entry]/SAMPLE[sample]":{ + "name":"None", + "atom_types":"@eln", + "physical_form":"None", + "situation":"None", + "SUBSTANCE[substance]":{ + "molecular_formula_hill":"None" + }, + "sample_history":{ + "sample_preparation":{ + "start_time":"None", + "end_time":"None", + "method":"None" + } + }, + "temperature":{ + "temperature_sensor": "None", + "sample_heater":"None", + "cryostat":"None" + }, + "gas_pressure":{ + "pressure_gauge":"None" + }, + "bias":{ + "potentiostat":"None", + "voltmeter":"None" + }, + "drain_current":{ + "amperemeter":"None" + }, + "flood_gun_current":{ + "flood_gun":"@None" + } + }, + "/ENTRY[entry]/data":{ + "@signal":"data", + "@default":"data", + "@axes":["energy"], + "data":"None", + "data/@units":"None", + "energy":"None", + "energy/@type":"None", + "energy/@units":"None", + "@energy_indices":"None", + "@energy_depends":"None" + } + } \ No newline at end of file diff --git a/pynxtools/dataconverter/readers/xps/file_parser.py b/pynxtools/dataconverter/readers/xps/file_parser.py index cc40323a2..0b302e113 100644 --- a/pynxtools/dataconverter/readers/xps/file_parser.py +++ b/pynxtools/dataconverter/readers/xps/file_parser.py @@ -57,11 +57,11 @@ class XpsDataFileParser: } __file_err_msg__ = ( - "Need a xps data file with the following extension: " f"{__prmt_file_ext__}" + "Need an XPS data file with the following extension: " f"{__prmt_file_ext__}" ) __vndr_err_msg__ = ( - "Need a xps data file from the following vendors: " f"{__vendors__}" + "Need an XPSdata file from the following vendors: " f"{__vendors__}" ) def __init__(self, file_paths: List) -> None: diff --git a/pynxtools/dataconverter/readers/xps/reader.py b/pynxtools/dataconverter/readers/xps/reader.py index 513b3f80a..79b36e5fa 100644 --- a/pynxtools/dataconverter/readers/xps/reader.py +++ b/pynxtools/dataconverter/readers/xps/reader.py @@ -2,6 +2,9 @@ A generic reader for loading XPS (X-ray Photoelectron Spectroscopy) data file into mpes nxdl (NeXus Definition Language) template. """ +import datetime +import sys + # Copyright The NOMAD Authors. # # This file is part of NOMAD. See https://nomad-lab.eu for further info. @@ -19,19 +22,21 @@ # limitations under the License. # from pathlib import Path -from typing import Any, Dict, Set, List -from typing import Tuple -import sys -import json +from typing import Any, Dict, List, Set, Tuple -import yaml import numpy as np +import yaml +from pynxtools.dataconverter.helpers import extract_atom_types from pynxtools.dataconverter.readers.base.reader import BaseReader +from pynxtools.dataconverter.readers.utils import ( + FlattenSettings, + flatten_and_replace, + parse_flatten_json, +) from pynxtools.dataconverter.readers.xps.file_parser import XpsDataFileParser -from pynxtools.dataconverter.readers.utils import flatten_and_replace, FlattenSettings +from pynxtools.dataconverter.readers.xps.reader_utils import construct_entry_name from pynxtools.dataconverter.template import Template -from pynxtools.dataconverter.helpers import extract_atom_types np.set_printoptions(threshold=sys.maxsize) @@ -39,6 +44,9 @@ XPS_DATA_TOKEN = "@data:" XPS_DETECTOR_TOKEN = "@detector_data:" ELN_TOKEN = "@eln" +LINK_TOKEN = "link" +TOKEN_SET = {XPS_TOKEN, XPS_DATA_TOKEN, XPS_DETECTOR_TOKEN, ELN_TOKEN} + # Track entries for using for eln data ENTRY_SET: Set[str] = set() DETECTOR_SET: Set[str] = set() @@ -48,41 +56,25 @@ CONVERT_DICT = { "unit": "@units", "version": "@version", - "User": "USER[user]", - "Instrument": "INSTRUMENT[instrument]", - "Source": "SOURCE[source]", - "Beam": "BEAM[beam]", - "Analyser": "ELECTRONANALYSER[electronanalyser]", - "Collectioncolumn": "COLLECTIONCOLUMN[collectioncolumn]", - "Energydispersion": "ENERGYDISPERSION[energydispersion]", - "Detector": "DETECTOR[detector]", - "Manipulator": "MANIPULATOR[manipulator]", - "Process": "PROCESS[process]", - "Sample": "SAMPLE[sample]", - "Data": "DATA[data]", + "user": "USER[user]", + "instrument": "INSTRUMENT[instrument]", + "source_probe": "source_TYPE[source_probe]", + "beam_probe": "beam_TYPE[beam_probe]", + "analyser": "ELECTRONANALYSER[electronanalyser]", + "collectioncolumn": "COLLECTIONCOLUMN[collectioncolumn]", + "energydispersion": "ENERGYDISPERSION[energydispersion]", + "detector": "DETECTOR[detector]", + "manipulator": "MANIPULATOR[manipulator]", + "pid": "PID[pid]", + "process": "PROCESS[process]", + "sample": "SAMPLE[sample]", + "substance": "SUBSTANCE[substance]", + # "Data": "DATA[data]", } REPLACE_NESTED: Dict[str, str] = {} -def construct_entry_name(key): - """Construct entry name from vendor, sample_name and region name""" - - components = key.split("/") - try: - # entry: vendor__sample__name_of_scan_rerion - entry_name = ( - f"{components[2]}" - f"__" - f'{components[3].split("_", 1)[1]}' - f"__" - f'{components[5].split("_", 1)[1]}' - ) - except IndexError: - entry_name = "" - return entry_name - - def find_entry_and_value(xps_data_dict, key_part, dt_typ): """Construct the entry name and pick up the corresponding data for that for that entry. @@ -91,7 +83,7 @@ def find_entry_and_value(xps_data_dict, key_part, dt_typ): entries_values = {} if dt_typ == XPS_TOKEN: for key, val in xps_data_dict.items(): - if key_part in key: + if key.endswith(key_part): entry = construct_entry_name(key) entries_values[entry] = val @@ -102,204 +94,246 @@ def find_entry_and_value(xps_data_dict, key_part, dt_typ): return entries_values +def get_entries_and_detectors(config_dict, xps_data_dict): + """Get all entries in the xps_data_dict""" + for key, value in config_dict.items(): + for token in [XPS_DATA_TOKEN, XPS_DETECTOR_TOKEN, XPS_TOKEN]: + try: + key_part = value.split(token)[-1] + entries_values = find_entry_and_value( + xps_data_dict, key_part, dt_typ=token + ) + + for entry, data in entries_values.items(): + if entry: + ENTRY_SET.add(entry) + if token == XPS_DETECTOR_TOKEN: + chan_count = "_chan" + # Iteration over scan + for data_var in data.data_vars: + if chan_count in data_var: + detector_num = data_var.split("_chan_")[-1] + detector_nm = f"detector{detector_num}" + DETECTOR_SET.add(detector_nm) + except AttributeError: + continue + + # pylint: disable=too-many-locals # pylint: disable=too-many-statements -def fill_data_group(key, entries_values, config_dict, template, entry_set): - """Fill out fileds and attributes for NXdata""" +def fill_data_group(key, key_part, entries_values, config_dict, template): + """Fill out fields and attributes for NXdata""" survey_count_ = 0 count = 0 for entry, xr_data in entries_values.items(): - entry_set.add(entry) - modified_key = key.replace("entry", entry) - modified_key = modified_key.replace("[data]/data", "[data]") root = key[0] - modifid_entry = key[0:13] - modifid_entry = modifid_entry.replace("entry", entry) - - template[f"{modifid_entry}/@default"] = "data" # Set first Survey as default for .nxs file if "Survey" in entry and survey_count_ == 0: - survey_count_ = survey_count_ + 1 + survey_count_ += 1 template[f"{root}@default"] = entry # If no Survey set any scan for default if survey_count_ == 0 and count == 0: - count = count + 1 + count += 1 template[f"{root}@default"] = entry - binding_energy_coord = None - chan_count = "_chan" - for data_var in xr_data.data_vars: - scan = data_var - # Collecting only accumulated counts - # indivisual channeltron counts goes to detector data section - if chan_count not in scan: - key_indv_scn_dt = f"{modified_key}/{scan}" - - key_indv_scn_dt_unit = f"{key_indv_scn_dt}/@units" - - coord_nm = list(xr_data[data_var].coords)[0] - binding_energy_coord = np.array(xr_data[data_var][coord_nm]) - template[key_indv_scn_dt] = xr_data[data_var].data - template[key_indv_scn_dt_unit] = config_dict[f"{key}/@units"] - - key_data = f"{modified_key}/data" - key_data_unit = f"{key_data}/@units" - - key_signal = f"{modified_key}/@signal" - - be_nm = "BE" - be_index = 0 - key_be = f"{modified_key}/{be_nm}" - key_be_unit = f"{key_be}/@units" - key_be_axes = f"{modified_key}/@axes" - key_be_ind = f"{modified_key}/@{be_nm}_indices" - - # setting up AXISNAME - axisname = "AXISNAME[axisname]" - long_name = "Binding Energy" - key_ax_mn = f"{modified_key}/{axisname}" - key_ax_ln_nm = f"{modified_key}/{axisname}/@long_name" - - key_nxclass = f"{modified_key}/@NX_class" - - template[key_signal] = "data" - template[key_data] = np.mean( - [ - xr_data[x_arr].data - for x_arr in xr_data.data_vars - if "_chan" not in x_arr - ], - axis=0, - ) - - template[f"{key_data}_errors"] = np.std( - [ - xr_data[x_arr].data - for x_arr in xr_data.data_vars - if "_chan" not in x_arr - ], - axis=0, - ) - - template[key_data_unit] = config_dict[f"{key}/@units"] - template[key_be_unit] = "eV" - template[key_be] = binding_energy_coord - template[key_be_axes] = be_nm - template[key_be_ind] = be_index - template[key_nxclass] = "NXdata" - template[key_ax_ln_nm] = long_name - template[key_ax_mn] = be_index - - -def fill_detector_group(key, entries_values, config_dict, template, entry_set): + data_field_key = key.replace("entry", entry) + data_group_key = data_field_key.rsplit("/data", 1)[0] + + if key_part == "energy": + energy_field_key = f"{data_group_key}/energy" + energy = np.array(xr_data.coords["energy"].values) + print(energy) + template[energy_field_key] = energy + + else: + # Define energy axis and energy_indices + template[f"{data_group_key}/energy/@long_name"] = "energy" + template[f"{data_group_key}/@energy_indices"] = 0 + + units = "counts_per_second" + + chan_count = "_chan" + scan_count = "_scan" + for data_var in xr_data.data_vars: + cycle_scan = data_var + # Collecting only accumulated counts + # indivisual channeltron counts goes to detector data section + if chan_count not in cycle_scan and scan_count in cycle_scan: + indv_scan_key = f"{data_group_key}/{cycle_scan}" + indv_scan_key_unit = f"{indv_scan_key}/@units" + template[indv_scan_key] = xr_data[data_var].data + template[indv_scan_key_unit] = units + + template[data_field_key] = np.mean( + [ + xr_data[x_arr].data + for x_arr in xr_data.data_vars + if (chan_count not in x_arr and scan_count in x_arr) + ], + axis=0, + ) + + template[f"{data_field_key}_errors"] = np.std( + [ + xr_data[x_arr].data + for x_arr in xr_data.data_vars + if (chan_count not in x_arr and scan_count in x_arr) + ], + axis=0, + ) + + template[f"{data_field_key}/@long_name"] = "XPS intensity" + + +def fill_detector_group(key, entries_values, config_dict, xps_data_dict, template): """Fill out fileds and attributes for NXdetector/NXdata""" for entry, xr_data in entries_values.items(): - entry_set.add(entry) - chan_count = "_chan" + # unit_key = config_dict[f"{key}/@units"] + # units = find_entry_and_value(xps_data_dict, unit_key, XPS_TOKEN) + units = "counts_per_second" + # Iteration over scan - for data_var in xr_data.data_vars: + data_vars = [ + data_var for data_var in xr_data.data_vars if chan_count in data_var + ] + + detector_scans = {detector: [] for detector in DETECTOR_SET} + + for data_var in data_vars: if chan_count in data_var: - detector_num = data_var.split("_chan")[-1] + detector_num = data_var.split("_chan_")[-1] detector_nm = f"detector{detector_num}" - DETECTOR_SET.add(detector_nm) - scan_num = data_var.split("_scan")[-1].split("_chan")[0] - scan_nm = f"scan_{scan_num}" + detector_scans[detector_nm] += [xr_data[data_var].data] + cycle_scan_num = data_var.split(chan_count)[0] modified_key = key.replace("entry", entry) modified_key = modified_key.replace("[detector]", f"[{detector_nm}]") - modified_key = modified_key.replace("[data]", f"[{scan_nm}]") - modified_key_unit = modified_key + "/@units" + cycle_scan_key = modified_key.replace( + "raw_data/raw", f"raw_data/{cycle_scan_num}" + ) + template[cycle_scan_key] = xr_data[data_var].data + template[f"{cycle_scan_key}/@units"] = units - template[modified_key] = xr_data[data_var].data - key_indv_chan_sginal = modified_key.replace("/raw", "/@signal") - template[key_indv_chan_sginal] = "raw" - template[modified_key_unit] = config_dict[f"{key}/@units"] + # Add multi-dimensional `raw`array for each detector + for detector_nm, value in detector_scans.items(): + modified_key = key.replace("entry", entry) + modified_key = modified_key.replace("[detector]", f"[{detector_nm}]") + template[modified_key] = np.array(value) -def fill_template_with_xps_data(config_dict, xps_data_dict, template, entry_set): +def fill_template_with_value(key, value, template): + """ + Fill NeXus template with a key-value pair. + + Parameters + ---------- + key : str + DESCRIPTION. + value : + Any value coming from the XPS, config, or ELN file. + template : Template + A NeXus template. + + """ + if value is None or str(value) == "None": + return + + # Do for all entry names + for entry in ENTRY_SET: + atom_types: List = [] + if "chemical_formula" in key: + atom_types = list(extract_atom_types(value)) + + if isinstance(value, datetime.datetime): + value = value.isoformat() + + elif isinstance(value, dict) and LINK_TOKEN in value: + link_text = value[LINK_TOKEN] + link_text = link_text.replace("entry", f"{entry}") + value = {LINK_TOKEN: link_text} + + modified_key = key.replace("[entry]", f"[{entry}]") + + # Do for all detectors + if "[detector]" in key: + for detector in DETECTOR_SET: + detr_key = modified_key.replace("[detector]", f"[{detector}]") + template[detr_key] = value + + if isinstance(value, dict) and LINK_TOKEN in value: + link_text = value[LINK_TOKEN] + if "/detector/" in link_text: + # Only replace if generic detector is given in + # link. + link_text = link_text.replace("detector", f"{detector}") + value = {LINK_TOKEN: link_text} + + template[detr_key] = value + else: + template[modified_key] = value + + if atom_types: + modified_key = modified_key.replace("chemical_formula", "atom_types") + template[modified_key] = ", ".join(atom_types) + + +def fill_template_with_xps_data(config_dict, xps_data_dict, template): """Collect the xps data from xps_data_dict and store them into template. We use searching_keys for separating the data from xps_data_dict. """ - for key, value in config_dict.items(): - if XPS_DATA_TOKEN in str(value): - key_part = value.split(XPS_DATA_TOKEN)[-1] - entries_values = find_entry_and_value( - xps_data_dict, key_part, dt_typ=XPS_DATA_TOKEN - ) - - fill_data_group(key, entries_values, config_dict, template, entry_set) + for key, config_value in config_dict.items(): + if isinstance(config_value, str) and any( + token in config_value for token in TOKEN_SET + ): + if XPS_DATA_TOKEN in str(config_value): + key_part = config_value.split(XPS_DATA_TOKEN)[-1] + entries_values = find_entry_and_value( + xps_data_dict, key_part, dt_typ=XPS_DATA_TOKEN + ) + fill_data_group(key, key_part, entries_values, config_dict, template) + + elif XPS_DETECTOR_TOKEN in str(config_value): + key_part = config_value.split(XPS_DATA_TOKEN)[-1] + entries_values = find_entry_and_value( + xps_data_dict, key_part, dt_typ=XPS_DETECTOR_TOKEN + ) + + fill_detector_group( + key, entries_values, config_dict, xps_data_dict, template + ) + + elif XPS_TOKEN in str(config_value): + key_part = config_value.split(XPS_TOKEN)[-1] + entries_values = find_entry_and_value( + xps_data_dict, key_part, dt_typ=XPS_TOKEN + ) + for entry, ent_value in entries_values.items(): + modified_key = key.replace("[entry]", f"[{entry}]") + fill_template_with_value(modified_key, ent_value, template) - if XPS_DETECTOR_TOKEN in str(value): - key_part = value.split(XPS_DATA_TOKEN)[-1] - entries_values = find_entry_and_value( - xps_data_dict, key_part, dt_typ=XPS_DETECTOR_TOKEN - ) + else: + fill_template_with_value(key, config_value, template) - fill_detector_group(key, entries_values, config_dict, template, entry_set) - elif XPS_TOKEN in str(value): - token = value.split(XPS_TOKEN)[-1] - entries_values = find_entry_and_value( - xps_data_dict, token, dt_typ=XPS_TOKEN - ) - for entry, ent_value in entries_values.items(): - entry_set.add(entry) - modified_key = key.replace("[entry]", f"[{entry}]") - template[modified_key] = ent_value - try: - template[f"{modified_key}/@units"] = config_dict[f"{key}/@units"] - except KeyError: - pass - - -# pylint: disable=too-many-branches -def fill_template_with_eln_data(eln_data_dict, config_dict, template, entry_set): +def fill_template_with_eln_data(eln_data_dict, config_dict, template): """Fill the template from provided eln data""" - - def fill_atom_types(key): - atom_types: List = [] - field_value = eln_data_dict[key] - - if "chemical_formula" in key: - atom_types = list(extract_atom_types(field_value)) - - if field_value is None: - return - - for entry in entry_set: - modified_key = key.replace("[entry]", f"[{entry}]") - template[modified_key] = field_value - if atom_types: - modified_key = modified_key.replace("chemical_formula", "atom_types") - template[modified_key] = ", ".join(atom_types) - - def fill_from_value(key): - field_value = eln_data_dict[key] - if not field_value: - return - # Do for all entry name - for entry in entry_set: - modified_key = key.replace("[entry]", f"[{entry}]") - # Do for all detector - if "[detector]" in key: - for detector in DETECTOR_SET: - detr_key = modified_key.replace("[detector]", f"[{detector}]") - template[detr_key] = field_value - else: - template[modified_key] = field_value - - for key, val in config_dict.items(): - if ELN_TOKEN in str(val): - fill_atom_types(key) - elif key in list(eln_data_dict.keys()): - fill_from_value(key) + for key, config_value in config_dict.items(): + if ELN_TOKEN in str(config_value): + try: + field_value = eln_data_dict[key] + fill_template_with_value(key, field_value, template) + except KeyError: + pass + elif key in eln_data_dict: + field_value = eln_data_dict[key] + fill_template_with_value(key, field_value, template) def concatenate_values(value1, value2): @@ -382,12 +416,15 @@ def read( if "config" in file: config_file = Path(file) - with open(config_file, encoding="utf-8", mode="r") as cfile: - config_dict = json.load(cfile) + config_dict = parse_flatten_json(config_file) + + get_entries_and_detectors(config_dict, xps_data_dict) + fill_template_with_xps_data(config_dict, xps_data_dict, template) - fill_template_with_xps_data(config_dict, xps_data_dict, template, ENTRY_SET) if eln_data_dict: - fill_template_with_eln_data(eln_data_dict, config_dict, template, ENTRY_SET) + # Filling in ELN metadata and overwriting the common + # paths by giving preference to the ELN metadata + fill_template_with_eln_data(eln_data_dict, config_dict, template) else: raise ValueError( "Eln file must be submited with some required fields and attributes." diff --git a/pynxtools/dataconverter/readers/xps/sle/sle_specs.py b/pynxtools/dataconverter/readers/xps/sle/sle_specs.py index 16f12d6a1..664c0ff88 100644 --- a/pynxtools/dataconverter/readers/xps/sle/sle_specs.py +++ b/pynxtools/dataconverter/readers/xps/sle/sle_specs.py @@ -63,6 +63,22 @@ def __init__(self): self.sql_connection = None + self.units = { + "analyser/work_function": "eV", + "beam/excitation_energy": "eV", + "collectioncolumn/iris_diameter": "mm", + "data/step_size": "eV", + "detector/detector_voltage": "V", + "detector/dwell_time": "s", + "detector/raw_data/raw": "counts_per_second ", + "instrument/polar_angle": "degree ", + "instrument/azimuth_angle": "degree", + "energydispersion/pass_energy": "eV", + "region/start_energy": "eV", + "source/emission_current": "A", + "source/source_voltage": "V", + "transmission_function/kinetic_energy": "eV", + } super().__init__() def _select_parser(self): @@ -107,9 +123,6 @@ def construct_data(self): key_map = { "user": [], "instrument": [ - "workfunction", - "bias_voltage_ions [V]", - "bias_voltage_electrons [V]", "polar_angle", "azimuth_angle", ], @@ -120,7 +133,11 @@ def construct_data(self): "emission_current", ], "beam": ["excitation_energy"], - "analyser": [], + "analyser": [ + "voltage_range", + "voltage_range/@units", + "work_function", + ], "collectioncolumn": [ "lens1_voltage [nU]", "lens2_voltage [nU]", @@ -128,35 +145,44 @@ def construct_data(self): "pre_deflector_x_current [nU]", "pre_deflector_y_current [nU]", "focus_displacement_current [nU]", - "transmission_function/data", - "transmission_function/file", + "iris_diameter", "lens_mode", + "transmission_function/relative_intensity", + "transmission_function/file", ], "energydispersion": [ - "scan_mode", + "energy_scan_mode", "entrance_slit", "exit_slit", - "iris_diameter", "pass_energy", ], "detector": [ - "calibration_file/dir", - "calibration_file", + "bias_voltage_electrons [V]", + "bias_voltage_ions [V]", "detector_voltage [V]", - "detector_voltage_range", + "dwell_time", ], "manipulator": [], - "calibration": [ - "transmission_function/data", - "transmission_function/file", + "process/energy_calibration": [ "calibration_file/dir", - "calibration_file", + "calibration_file/path", + "energy/@units", + ], + "process/transmission_correction": [ + "transmission_function/kinetic_energy", + "transmission_function/relative_intensity", + "transmission_function/file", + ], + "data": [ + "energy/@type", + "energy/@units", + "intensity/@units", + "n_values", + "step_size", ], - "data": ["x_units", "y_units", "n_values", "step_size", "dwell_time"], "region": [ "analysis_method", "start_energy", - "dwell_time", "spectrum_comment", "time_stamp", "total_scans", @@ -187,23 +213,23 @@ def _update_xps_dict_with_spectrum(self, spectrum, key_map): "energydispersion": f"{analyser_parent}/energydispersion", "detector": f"{analyser_parent}/detector", "manipulator": f"{instrument_parent}/manipulator", - "calibration": f"{instrument_parent}/calibration", + "process/energy_calibration": f"{region_parent}/process/energy_calibration", + "process/transmission_correction": f"{region_parent}/process/transmission_correction", "sample": f"{region_parent}/sample", "data": f"{region_parent}/data", - "region": f"{region_parent}", + "region": f"{region_parent}/region", } for grouping, spectrum_keys in key_map.items(): root = path_map[str(grouping)] for spectrum_key in spectrum_keys: - try: - units = re.search(r"\[([A-Za-z0-9_]+)\]", spectrum_key).group(1) - mpes_key = spectrum_key.rsplit(" ", 1)[0] + mpes_key = spectrum_key.rsplit(" ", 1)[0] + self._xps_dict[f"{root}/{mpes_key}"] = spectrum[spectrum_key] + + unit_key = f"{grouping}/{spectrum_key}" + units = self._get_units_for_key(unit_key) + if units: self._xps_dict[f"{root}/{mpes_key}/@units"] = units - self._xps_dict[f"{root}/{mpes_key}"] = spectrum[spectrum_key] - except AttributeError: - mpes_key = spectrum_key - self._xps_dict[f"{root}/{mpes_key}"] = spectrum[spectrum_key] self._xps_dict[f'{path_map["analyser"]}/name'] = spectrum["devices"][0] self._xps_dict[f'{path_map["source"]}/name'] = spectrum["devices"][1] @@ -214,6 +240,9 @@ def _update_xps_dict_with_spectrum(self, spectrum, key_map): detector_data_key_child = construct_detector_data_key(spectrum) energy = np.array(spectrum["data"]["x"]) + # Add energy axis to energy_calibration + calib_energy_key = f'{path_map["process/energy_calibration"]}/energy' + self._xps_dict[calib_energy_key] = energy # If multiple spectra exist to entry, only create a new # xr.Dataset if the entry occurs for the first time. @@ -263,6 +292,36 @@ def _update_xps_dict_with_spectrum(self, spectrum, key_map): data=cps, coords={"energy": energy} ) + # Add unit for detector data + detector_data_unit_key = f"{path_map['detector']}/raw_data/raw/@units" + self._xps_dict[detector_data_unit_key] = self._get_units_for_key( + "detector/raw_data/raw" + ) + + def _get_units_for_key(self, unit_key): + """ + Get correct units for a given key. + + Parameters + ---------- + unit_key : str + Key of type :, e.g. + detector/detector_voltage + + Returns + ------- + str + Unit for that unit_key. + + """ + try: + return re.search(r"\[([A-Za-z0-9_]+)\]", unit_key).group(1) + except AttributeError: + try: + return self.units[unit_key] + except KeyError: + return "" + class SleProdigyParser(ABC): """ @@ -282,9 +341,9 @@ def __init__(self): "ElectronEnergy": "start_energy", "SpectrumID": "spectrum_id", "EpassOrRR": "pass_energy", - "EnergyType": "x_units", + "EnergyType": "energy/@type", "Samples": "n_values", - "Wf": "workfunction", + "Wf": "work_function", "Step": "step", "Ubias": "electron_bias", "DwellTime": "dwell_time", @@ -293,8 +352,8 @@ def __init__(self): "Timestamp": "time_stamp", "Entrance": "entrance_slit", "Exit": "exit_slit", - "ScanMode": "scan_mode", - "VoltageRange": "detector_voltage_range", + "ScanMode": "energy_scan_mode", + "VoltageRange": "voltage_range", } spectrometer_setting_map = { @@ -322,9 +381,9 @@ def __init__(self): } self.sql_metadata_map = { - "EnergyType": "x_units", + "EnergyType": "energy/@type", "EpassOrRR": "pass_energy", - "Wf": "workfunction", + "Wf": "work_function", "Timestamp": "time_stamp", "Samples": "n_values", "ElectronEnergy": "start_energy", @@ -339,8 +398,10 @@ def __init__(self): ] self.value_map = { - "x_units": self._change_energy_type, + "energy/@type": self._change_energy_type, + "excitation_energy": self._convert_excitation_energy, "time_stamp": self._convert_date_time, + "energy_scan_mode": self._convert_energy_scan_mode, } self.keys_to_drop = [ @@ -351,6 +412,21 @@ def __init__(self): self.measurement_types = ["XPS", "UPS", "ElectronSpectroscopy"] + self.measurement_types_map = { + "XPS": "X-ray photoelectron spectroscopy (XPS)", + "UPS": "ultraviolet photoelectron spectroscopy (UPS)", + "ElectronSpectroscopy": "electron spectroscopy for chemical analysis (ESCA)", + "NAPXPS": "near ambient pressure X-ray photoelectron spectroscopy (NAPXPS)", + "ARXPS": "angle-resolved X-ray photoelectron spectroscopy (ARXPS)", + } + + self.energy_scan_mode_map = { + "FixedAnalyzerTransmission": "fixed_analyser_transmission", + "FixedRetardationRatio": "fixed_retardation_ratio", + "FixedEnergies": "fixed_energy", + "Snapshot": "snapshot", + } + def initiate_file_connection(self, filepath): """Set the filename of the file to be opened.""" sql_connection = filepath @@ -464,7 +540,9 @@ def _append_scan_data(self): scan["cps_calib"] = copy.copy(scan["cps_ch_0"]) # Add transmission function - scan["transmission_function/data"] = np.array(transmission_data) + scan["transmission_function/relative_intensity"] = np.array( + transmission_data + ) # add metadata including scan, loop no and datetime scan_metadata = self._get_scan_metadata(raw_ids[scan_no]) @@ -554,7 +632,7 @@ def _separate_channels(self, data, n_channels): # mcd_head = int(raw_data["mcd_head"]) # mcd_tail = int(raw_data["mcd_tail"]) # excitation_energy = raw_data["excitation_energy"] - # scan_mode = raw_data["scan_mode"] + # energy_scan_mode = raw_data["energy_scan_mode"] # kinetic_energy = raw_data["kinetic_energy"] # scan_delta = raw_data["scan_delta"] # pass_energy = raw_data["pass_energy"] @@ -617,7 +695,7 @@ def _separate_channels(self, data, n_channels): # # "scan" in individual CountsSeq # scan_counts = raw_data["scans"][scan_nm] # - # if scan_mode == "FixedAnalyzerTransmission": + # if energy_scan_mode == "fixed_analyser_transmission": # for row in np.arange(mcd_num): # # count_on_row = scan_counts[row::mcd_num] @@ -700,7 +778,7 @@ def _separate_channels(self, data, n_channels): # # "scan" in individual CountsSeq # scan_counts = raw_data["scans"][scan_nm] # - # if scan_mode == "FixedAnalyzerTransmission": + # if energy_scan_mode == "fixed_analyser_transmission": # for row in np.arange(mcd_num): # # count_on_row = scan_counts[row::mcd_num] @@ -997,7 +1075,7 @@ def _get_spectrum_metadata_from_sql(self): cur.execute(query) results = ET.fromstring(cur.fetchall()[0][0]) for i in results.iter("AnalyzerSpectrumParameters"): - spectrum["workfunction"] = i.attrib["Workfunction"] + spectrum["work_function"] = i.attrib["Workfunction"] spectrum["step_size"] = float(i.attrib["ScanDelta"]) def _get_scan_metadata(self, raw_id): @@ -1151,12 +1229,12 @@ def _get_energy_data(self, spectrum): List of uniformly separated energy values. """ - if spectrum["x_units"] == "binding energy": + if spectrum["energy/@type"] == "binding": start = spectrum["start_energy"] step = spectrum["step_size"] points = spectrum["n_values"] energy = [start - i * step for i in range(points)] - elif spectrum["x_units"] == "kinetic energy": + elif spectrum["energy/@type"] == "kinetic": start = spectrum["start_energy"] step = spectrum["step_size"] points = spectrum["n_values"] @@ -1209,16 +1287,6 @@ def _close_con(self): """ self.con.close() - def _convert_date_time(self, timestamp): - """ - Convert the native time format to the one we decide to use. - Returns datetime string in the format '%Y-%b-%d %H:%M:%S.%f'. - - """ - date_time = datetime.strptime(timestamp, "%Y-%b-%d %H:%M:%S.%f") - date_time = datetime.strftime(date_time, "%Y-%m-%d %H:%M:%S.%f") - return date_time - def _re_map_keys(self, dictionary, key_map): """ Map the keys returned from the SQL table to the preferred keys for @@ -1251,17 +1319,46 @@ def _drop_unused_keys(self, dictionary, keys_to_drop): if key in dictionary.keys(): dictionary.pop(key) - def _change_energy_type(self, energy): + def _change_energy_type(self, energy_type): """ Change the strings for energy type to the preferred format. """ - if energy == "Binding": - return "binding energy" - if energy == "Kinetic": - return "kinetic energy" + if energy_type == "Binding": + return "binding" + elif energy_type == "Kinetic": + return "kinetic" return None + def _convert_excitation_energy(self, excitation_energy): + """ + Convert the excitation_energy to a float. + + """ + return float(excitation_energy) + + def _convert_date_time(self, timestamp): + """ + Convert the native time format to the one we decide to use. + Returns datetime string in the format '%Y-%b-%d %H:%M:%S.%f'. + + """ + date_time = datetime.strptime(timestamp, "%Y-%b-%d %H:%M:%S.%f") + date_time = datetime.strftime(date_time, "%Y-%m-%d %H:%M:%S.%f") + return date_time + + def _convert_energy_scan_mode(self, energy_scan_mode): + """ + Convert the native names for the energy scan modes to the ones + used in NXmpes. + + """ + try: + energy_scan_mode = self.energy_scan_mode_map[energy_scan_mode] + except KeyError: + pass + return energy_scan_mode + def _re_map_values(self, dictionary): """ Map the values returned from the SQL table to the preferred format. @@ -1389,14 +1486,25 @@ def _convert_to_common_format(self): for channel_key in channels: spec.pop(channel_key) - spec["y_units"] = "Counts per Second" + spec["energy/@units"] = "eV" + spec["intensity/@units"] = "counts_per_second" + + # Add energy axis for TF data. + if spec["energy/@type"] == "binding": + tf_energy = np.array( + [spec["excitation_energy"] - x for x in spec["data"]["x"]] + ) + elif spec["energy/@type"] == "kinetic": + tf_energy = spec["data"]["x"] + + spec["transmission_function/kinetic_energy"] = tf_energy def _remove_fixed_energies(self): """ Remove spectra measured with the scan mode FixedEnergies. """ self.spectra = [ - spec for spec in self.spectra if spec["scan_mode"] != "FixedEnergies" + spec for spec in self.spectra if spec["energy_scan_mode"] != "fixed_energy" ] def _remove_syntax(self): @@ -1413,7 +1521,7 @@ def _remove_snapshot(self): Remove spectra required in Snapshot mode. """ self.spectra = [ - spec for spec in self.spectra if "Snapshot" not in spec["scan_mode"] + spec for spec in self.spectra if "snapshot" not in spec["energy_scan_mode"] ] def get_sle_version(self): @@ -1459,7 +1567,12 @@ def _flatten_xml(self, xml): for measurement_type in self.measurement_types: for group in xml.iter(measurement_type): data = {} - data["analysis_method"] = measurement_type + try: + data["analysis_method"] = self.measurement_types_map[ + measurement_type + ] + except KeyError: + data["analysis_method"] = measurement_type data["devices"] = [] for device in group.iter("DeviceCommand"): @@ -1526,15 +1639,23 @@ def _extract_comm_settings(self, comm_settings): common_spectrum_settings = {} for setting in comm_settings.iter(): if setting.tag == "ScanMode": - common_spectrum_settings[setting.tag] = setting.attrib["Name"] + energy_scan_mode = self.energy_scan_mode_map[setting.attrib["Name"]] + common_spectrum_settings[setting.tag] = energy_scan_mode elif setting.tag == "SlitInfo": for key, val in setting.attrib.items(): common_spectrum_settings[key] = val elif setting.tag == "Lens": - common_spectrum_settings.update(setting.attrib) + voltage_range = setting.attrib["VoltageRange"] + split_text = re.split(r"([A-Z])", voltage_range, 1) + val = split_text[0] + unit = "".join(split_text[1:]) + common_spectrum_settings["voltage_range"] = float(val) + common_spectrum_settings["voltage_range/@units"] = unit elif setting.tag == "EnergyChannelCalibration": common_spectrum_settings["calibration_file/dir"] = setting.attrib["Dir"] - common_spectrum_settings["calibration_file"] = setting.attrib["File"] + common_spectrum_settings["calibration_file/path"] = setting.attrib[ + "File" + ] elif setting.tag == "Transmission": common_spectrum_settings["transmission_function/file"] = setting.attrib[ "File" @@ -1629,7 +1750,12 @@ def _flatten_xml(self, xml): for measurement_type in self.measurement_types: for group in xml.iter(measurement_type): data = {} - data["analysis_method"] = measurement_type + try: + data["analysis_method"] = self.measurement_types_map[ + measurement_type + ] + except KeyError: + data["analysis_method"] = measurement_type data["devices"] = [] data["device_group_id"] = group.attrib["ID"] @@ -1695,15 +1821,24 @@ def _extract_comm_settings(self, comm_settings): common_spectrum_settings = {} for setting in comm_settings.iter(): if setting.tag == "ScanMode": - common_spectrum_settings[setting.tag] = setting.attrib["Name"] + energy_scan_mode = self.energy_scan_mode_map[setting.attrib["Name"]] + common_spectrum_settings[setting.tag] = energy_scan_mode elif setting.tag == "SlitInfo": for key, val in setting.attrib.items(): common_spectrum_settings[key] = val elif setting.tag == "Lens": - common_spectrum_settings.update(setting.attrib) + voltage_range = setting.attrib["VoltageRange"] + voltage_range = "400V" + split_text = re.split(r"([A-Z])", voltage_range, 1) + val = split_text[0] + unit = "".join(split_text[1:]) + common_spectrum_settings["voltage_range"] = float(val) + common_spectrum_settings["voltage_range/@units"] = unit elif setting.tag == "EnergyChannelCalibration": common_spectrum_settings["calibration_file/dir"] = setting.attrib["Dir"] - common_spectrum_settings["calibration_file"] = setting.attrib["File"] + common_spectrum_settings["calibration_file/path"] = setting.attrib[ + "File" + ] elif setting.tag == "Transmission": common_spectrum_settings["transmission_function/file"] = setting.attrib[ "File" diff --git a/pynxtools/dataconverter/readers/xps/vms/vamas.py b/pynxtools/dataconverter/readers/xps/vms/vamas.py index 8a9ceb59b..8af1dd027 100644 --- a/pynxtools/dataconverter/readers/xps/vms/vamas.py +++ b/pynxtools/dataconverter/readers/xps/vms/vamas.py @@ -94,9 +94,7 @@ def construct_data(self): key_map = { "user": [], - "instrument": [ - "work_function", - ], + "instrument": [], "source": [ "source_label", "source_analyzer_angle", @@ -108,13 +106,17 @@ def construct_data(self): "analysis_width_x", "analysis_width_y", "target_bias", + "work_function", ], "collectioncolumn": [], "energydispersion": [ "scan_mode", "pass_energy", ], - "detector": ["signal_mode"], + "detector": [ + "signal_mode", + "dwell_time", + ], "manipulator": [], "sample": [], "calibration": [], @@ -128,12 +130,10 @@ def construct_data(self): "n_values", "start_energy", "step_size", - "dwell_time", ], "region": [ "analysis_method", "spectrum_type", - "dwell_time", "comments", "spectrum_id", "time_stamp", diff --git a/pynxtools/dataconverter/readers/xps/xml/xml_specs.py b/pynxtools/dataconverter/readers/xps/xml/xml_specs.py index 7e9d07ed7..f519bcadb 100644 --- a/pynxtools/dataconverter/readers/xps/xml/xml_specs.py +++ b/pynxtools/dataconverter/readers/xps/xml/xml_specs.py @@ -31,23 +31,6 @@ ) -def _construct_entry_name_xml(key): - """Construction entry name.""" - key_parts = key.split("/") - try: - # entry example : vendor__sample__name_of_scan_region - entry_name = ( - f"{key_parts[2]}" - f"__" - f'{key_parts[3].split("_", 1)[1]}' - f"__" - f'{key_parts[5].split("_", 1)[1]}' - ) - except IndexError: - entry_name = "" - return entry_name - - class XmlMapperSpecs(XPSMapper): """ Class for restructuring xml data file from @@ -180,13 +163,14 @@ def construct_data(self): f"{scan_nm}_chan_{row}" ] = xr.DataArray( data=channel_counts[row + 1, :], - coords={"BE": binding_energy}, + coords={"energy": binding_energy}, ) # Storing callibrated and after accumulated each scan counts if row == mcd_num - 1: self._xps_dict["data"][entry][scan_nm] = xr.DataArray( - data=channel_counts[0, :], coords={"BE": binding_energy} + data=channel_counts[0, :], + coords={"energy": binding_energy}, ) else: for row in np.arange(mcd_num): @@ -203,13 +187,14 @@ def construct_data(self): f"{scan_nm}_chan{row}" ] = xr.DataArray( data=channel_counts[row + 1, :], - coords={"BE": binding_energy}, + coords={"energy": binding_energy}, ) # Storing callibrated and after accumulated each scan counts if row == mcd_num - 1: self._xps_dict["data"][entry][scan_nm] = xr.DataArray( - data=channel_counts[0, :], coords={"BE": binding_energy} + data=channel_counts[0, :], + coords={"energy": binding_energy}, ) @@ -699,6 +684,7 @@ def collect_raw_data_to_construct_data(self): self.entry_to_data[entry]["raw_data"]["excitation_energy"] = val elif "region/scan_mode/name" in key: + val = self._convert_energy_scan_mode(val) self.entry_to_data[entry]["raw_data"]["scan_mode"] = val elif "region/kinetic_energy" in key: @@ -748,3 +734,22 @@ def collect_raw_data_to_construct_data(self): scan_name = f"cycle{cycle_num}_scan{scan_num}" self.entry_to_data[entry]["raw_data"]["scans"][scan_name] = val + + def _convert_energy_scan_mode(self, energy_scan_mode): + """ + Convert the native names for the energy scan modes to the ones + used in NXmpes. + + """ + energy_scan_mode_map = { + "FixedAnalyzerTransmission": "fixed_analyser_transmission", + "FixedRetardationRatio": "fixed_retardation_ratio", + "FixedEnergies": "fixed_energy", + "Snapshot": "snapshot", + } + + try: + energy_scan_mode = energy_scan_mode_map[energy_scan_mode] + except KeyError: + pass + return energy_scan_mode diff --git a/pynxtools/definitions b/pynxtools/definitions index 9e5722e35..d2fdad4fc 160000 --- a/pynxtools/definitions +++ b/pynxtools/definitions @@ -1 +1 @@ -Subproject commit 9e5722e3524571fe659e1a82d3ff7b5ac73c9061 +Subproject commit d2fdad4fca14048ef7c73067927f67eb978c6826 diff --git a/tests/data/dataconverter/readers/xps/eln_data.yaml b/tests/data/dataconverter/readers/xps/eln_data.yaml index 58e81f99e..5abaeca11 100644 --- a/tests/data/dataconverter/readers/xps/eln_data.yaml +++ b/tests/data/dataconverter/readers/xps/eln_data.yaml @@ -1,51 +1,146 @@ -Instrument: - Analyser: - Collectioncolumn: - scheme: "Angular dispersive" - mode: "Unknown" - description: "hemispherical" - name: null - Energydispersion: - entrance_slit: "Unknown" - scheme: "hemispherical" - energy_scan_mode: "fixed" - pass_energy: - unit: null - Detector: - amplifier_type: "channeltron" - detector_type: "Multi-anode" - Beam: +definition: + value: NXmpes + version: 1.0 +title: XPS Experiment +start_time: 2022-04-08T11:47:02.0200Z +end_time: 2022-04-08T12:32:06.0200Z +experiment_institution: BESSY II +program_name: SpecsLab 2 +user: + name: Lukas Pielsticker + email: lukas.pielsticker@cec.mpg.de +instrument: + device_information: + vendor: SPECS GmbH + model: XPS setup + identifier: null + energy_resolution: + type: calibrated + resolution: + value: 0.2 + unit: eV + source_probe: + type: Synchrotron X-ray Source + probe: x-ray + device_information: + vendor: null + model: null + identifier: null + beam_probe: distance: - unit: "mm" value: 0.0 - energy_resolution: - unit: null - value: null - Source: - type: "Synchrotron X-ray Source" - probe: "x-ray" -Sample: - name: "PBTTT" - chemical_formula: "(C42H62S4)n" - preparation_description: "From third party" - temperature: - unit: "K" - value: 298.0 - situation: "vacuum" - gas_pressure: - unit: "Pa" - value: 101325.0 - density: null - description: "A polymer material called PBTTT with chemical name poly[2,5-bis(3-dodecylthiophen-2-yl)thieno[3,2-b]thiophene]." -title: "XPS Experiment" -start_time: "2022-04-08T11:47:02.0200Z" -definition: - value: "NXmpes" - version: "1.0" -User: - name: "Ahmed Mansour" - email: "amansour@physik.hu-berlin.de" -Data: - BE: - unit: null - + unit: mm + analyser: + description: hemispherical + name: PHOIBOS 150 + device_information: + vendor: SPECS GmbH + model: PHOIBOS 150 + identifier: null + collectioncolumn: + scheme: angular dispersive + device_information: + vendor: null + model: null + identifier: null + energydispersion: + scheme: hemispherical + entrance_slit: unknown + energy_scan_mode: fixed_analyser_transmission + diameter: + unit: mm + value: 150 + device_information: + vendor: null + model: null + identifier: null + detector: + amplifier_type: channeltron + detector_type: Multi-anode + manipulator: + device_information: + vendor: SPECS GmbH + model: 5-axis manipulator + identifier: null + temperature_sensor: + name: type K thermocouple + measurement: temperature + attached_to: sample + type: type K thermocouple + value: + value: 298.0 + unit: K + sample_heater: + name: Coherent Compact Evolution IR Diode LASER (DILAS) + physical_quantity: temperature + type: IR diode laser + heater_power: + value: 0.0 + unit: W + pid: + setpoint: + value: 298.0 + unit: K + cryostat: + name: null + physical_quantity: null + type: null + pid: + setpoint: null + drain_current_amperemeter: + name: Amperemeter 1.0 + measurement: current + type: wire + value: + value: 0.0 + unit: A + sample_bias_voltmeter: + name: XPS sample voltmeter + measurement: voltage + attached_to: sample + type: oscilloscope + value: + value: 0.0 + unit: V + sample_bias_potentiostat: + name: XPS sample potentiostat + physical_quantity: voltage + type: potentiostat + pid: + setpoint: + value: 0.0 + unit: V + pressure_gauge: + name: Atmion + measurement: pressure + type: hot-filament ionization gauge + value: + value: 0.000000001 + unit: mbar + value_log: + value: + value: null + unit: null + flood_gun: + name: FG 22/35 + physical_quantity: current + type: low energy electron source + current: + value: 0.0 + unit: A + current_log: + value: + value: null + unit: null +sample: + description: A polymer material called PBTTT with chemical name poly[2,5-bis(3-dodecylthiophen-2-yl)thieno[3,2-b]thiophene]. + substance: + molecular_formula_hill: (C42H62S4)n + situation: vacuum + sample_history: + sample_preparation: + start_time: 2022-04-08T11:02:38.0200Z + end_time: 2022-04-08T11:06:42.200Z + description: From third party + method: null + \ No newline at end of file diff --git a/tests/dataconverter/test_readers.py b/tests/dataconverter/test_readers.py index a777e5182..2dfed9947 100644 --- a/tests/dataconverter/test_readers.py +++ b/tests/dataconverter/test_readers.py @@ -59,7 +59,6 @@ def get_all_readers() -> List[ParameterSet]: "EmOmReader", "EmSpctrscpyReader", "EmNionReader", - "XPSReader", ): readers.append( pytest.param(