Skip to content

Commit

Permalink
remove duplications in data model
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaspie committed Mar 26, 2024
1 parent a4984df commit 62003a0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
8 changes: 2 additions & 6 deletions pynxtools_xps/scienta/scienta_txt.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,12 +509,8 @@ def _re_map_values(self, input_key: str, value: str):

for k in keys:
if k in input_key:
if not isinstance(value_map[k], list):
map_methods = [value_map[k]]
else:
map_methods = value_map[k]
for method in map_methods:
value = method(value)
map_method = value_map[k]
value = map_method(value) # type: ignore[operator]
return value


Expand Down
9 changes: 5 additions & 4 deletions pynxtools_xps/scienta/scienta_txt_data_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,26 +35,27 @@ class ScientaHeader(XpsDataclass):
class ScientaRegion(XpsDataclass):
region_id: int = 0
region_name: str = ""
energy_type: str = ""
dim_energy_type: str = ""
energy_type: str = "binding" # energy_scale
energy_size: int = 0
energy_units: int = 0
energy_axis: np.ndarray = field(default_factory=lambda: np.zeros(0))
lens_mode: str = ""
pass_energy: float = 0.0
pass_energy_units: str = "eV"
no_of_scans: int = 0
excitation_energy: float = 0.0
excitation_energy_units: str = "eV"
energy_type: str = "binding" # energy_scale
acquisition_mode: str = ""
energy_units: str = "kinetic" # ???
# energy_units: str = "kinetic" # ???
center_energy: float = 0.0
center_energy_units: str = "eV"
start_energy: float = 0.0
start_energy_units: str = "eV"
stop_energy: float = 0.0
stop_energy_units: str = "eV"
step_size: float = 0.0
stop_energy_units: str = "eV"
step_size_units: str = "eV"
dwell_time: float = 0.0
dwell_time_units: str = "eV"
detector_first_x_channel: int = 0
Expand Down

0 comments on commit 62003a0

Please sign in to comment.