Skip to content

Commit

Permalink
read analyser voltage range in XPS SLE reader
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaspie committed Jan 22, 2024
1 parent 0d87135 commit 9c1290a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@
"@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",
Expand Down
22 changes: 18 additions & 4 deletions pynxtools/dataconverter/readers/xps/sle/sle_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ def construct_data(self):
],
"beam": ["excitation_energy"],
"analyser": [
"voltage_range",
"voltage_range/@units",
"work_function",
],
"collectioncolumn": [
Expand All @@ -147,7 +149,6 @@ def construct_data(self):
"lens_mode",
"transmission_function/relative_intensity",
"transmission_function/file",
"voltage_range",
],
"energydispersion": [
"energy_scan_mode",
Expand Down Expand Up @@ -1639,11 +1640,17 @@ def _extract_comm_settings(self, comm_settings):
for setting in comm_settings.iter():
if setting.tag == "ScanMode":
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/path"] = setting.attrib[
Expand Down Expand Up @@ -1814,12 +1821,19 @@ 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/path"] = setting.attrib[
Expand Down

0 comments on commit 9c1290a

Please sign in to comment.