diff --git a/src/pynxtools_xps/scienta/scienta_reader.py b/src/pynxtools_xps/scienta/scienta_reader.py index 9dcbd2c8..9f96f0ae 100644 --- a/src/pynxtools_xps/scienta/scienta_reader.py +++ b/src/pynxtools_xps/scienta/scienta_reader.py @@ -111,7 +111,12 @@ def _update_xps_dict_with_spectrum(self, spectrum: Dict[str, Any]): """ entry_parts = [] - for part in ["spectrum_type", "region_name", "acquisition/spectrum/name"]: + for part in [ + "spectrum_type", + "region_name", + "acquisition/spectrum/name", + "title", + ]: val = spectrum.get(part, None) if val: entry_parts += [val] @@ -120,6 +125,9 @@ def _update_xps_dict_with_spectrum(self, spectrum: Dict[str, Any]): entry_parent = f"/ENTRY[{entry}]" for key, value in spectrum.items(): + if key.startswith("entry"): + entry_parent = f"/ENTRY[entry]" + key = key.replace("entry/", "", 1) mpes_key = f"{entry_parent}/{key}" self._xps_dict[mpes_key] = value @@ -189,9 +197,9 @@ def _fill_with_data_hdf5(self, spectrum: Dict[str, Any], entry: str): ] for key in data_keys: - value = spectrum[f"acquisition/spectrum/{key}"] - - self._xps_dict["data"][entry][key] = value + value = spectrum.get(f"acquisition/spectrum/{key}") + if value is not None: + self._xps_dict["data"][entry][key] = value class ScientaTxtParser: