Skip to content
Snippets Groups Projects

[Jungfrau][Correct][Dark] New Settings and gain mode enums to read the jungfrau correct parameters.

Merged Karim Ahmed requested to merge feat/new_jungfrau_software_changes into master
1 file
+ 10
10
Compare changes
  • Side-by-side
  • Inline
+ 10
10
@@ -38,7 +38,8 @@ class JungfrauCtrl():
"""
self.run_dc = run_dc
self.ctrl_src = ctrl_src
self.settings_value, self.settings_enum = _get_settings(run_dc, ctrl_src)
self.settings_value, self.settings_enum = _get_settings(
run_dc, ctrl_src)
def get_memory_cells(self) -> Tuple[int, int]:
n_storage_cells = int(self.run_dc.get_run_value(
@@ -70,9 +71,10 @@ class JungfrauCtrl():
else:
gain_setting = 0
if self.settings_value != str(self.settings_enum.DYNAMIC_GAIN):
print("WARNING: Setting gain_setting to 0,"
"assuming that this is an old run. "
f"`settings.value` = {self.settings_value}.\n")
print(
"WARNING: Setting gain_setting to 0,"
"assuming that this is an old run. "
f"`settings.value` = {self.settings_value}.\n")
return gain_setting
def _get_gain_mode_settings(self) -> int:
@@ -80,9 +82,8 @@ class JungfrauCtrl():
is fixgain1 or fixgain2.
"""
if self.settings_value in [
str(self.settings_enum.FIX_GAIN_1),
str(self.settings_enum.FIX_GAIN_2),
]:
str(self.settings_enum.FIX_GAIN_1),
str(self.settings_enum.FIX_GAIN_2)]:
return 1
else:
return 0
@@ -97,9 +98,8 @@ class JungfrauCtrl():
"""
gain_mode = self.run_dc.get_run_value(self.ctrl_src, "gainMode")
if gain_mode in [
str(JungfrauGainModes.FIX_GAIN_1),
str(JungfrauGainModes.FIX_GAIN_2)
]:
str(JungfrauGainModes.FIX_GAIN_1),
str(JungfrauGainModes.FIX_GAIN_2)]:
return 1, gain_mode
else:
return 0, gain_mode
Loading