Skip to content
Snippets Groups Projects
Commit f8321fe9 authored by Karim Ahmed's avatar Karim Ahmed
Browse files

Merge branch 'fix/get_run_value_AGIPDCtrl' into 'master'

[AGIPD] as_single_value instead of get_run_value

See merge request detectors/pycalibration!652
parents d09e3f59 87ba0340
No related branches found
No related tags found
1 merge request!652[AGIPD] as_single_value instead of get_run_value
......@@ -27,6 +27,7 @@ from cal_tools.enums import AgipdGainMode, BadPixels, SnowResolution
from cal_tools.h5_copy_except import h5_copy_except_paths
from cal_tools.tools import get_from_db
class AgipdCtrl:
def __init__(
self,
......@@ -88,7 +89,6 @@ class AgipdCtrl:
# float.
# It is desired to loose precision here because the usage is
# about bucketing the rate for managing meta-data.
return round(float(self.run_dc[rep_rate_src].as_single_value()), 1)
train_pulses = np.squeeze(
......@@ -129,11 +129,12 @@ class AgipdCtrl:
return
if "gain.value" in self.run_dc.keys_for_source(self.ctrl_src):
return self.run_dc[self.ctrl_src, "gain.value"].as_single_value()
return int(
self.run_dc[self.ctrl_src, "gain"].as_single_value())
setupr = self.run_dc[self.ctrl_src, "setupr.value"].as_single_value()
setupr = self.run_dc[self.ctrl_src, "setupr"].as_single_value()
pattern_type_idx = self.run_dc[
self.ctrl_src, "patternTypeIndex.value"].as_single_value()
self.ctrl_src, "patternTypeIndex"].as_single_value()
if (setupr == 0 and pattern_type_idx < 4) or (
setupr == 32 and pattern_type_idx == 4):
......@@ -162,9 +163,8 @@ class AgipdCtrl:
"gainModeIndex.value" in self.run_dc.keys_for_source(
self.ctrl_src)
):
return AgipdGainMode(int(
self.run_dc.get_run_value(
self.ctrl_src, "gainModeIndex.value")))
return AgipdGainMode(int(self.run_dc[
self.ctrl_src, "gainModeIndex"].as_single_value()))
return AgipdGainMode.ADAPTIVE_GAIN
......@@ -210,7 +210,7 @@ class AgipdCtrl:
# As HED_DET_AGIPD500K2G has a hardware issue that leads
# to storing arbitrary voltage values in the CONTROL source
# array. e.g. /gpfs/exfel/exp/HED/202230/p900248/raw
return int(self.run_dc.get_run_value(*voltage_src))
return self.run_dc.get_run_value(*voltage_src)
else:
# TODO: Validate if removing this and
# and using NB value for old RAW data.
......@@ -237,8 +237,8 @@ class AgipdCtrl:
'integrationTime.value' in self.run_dc.keys_for_source(
self.ctrl_src)
):
return int(self.run_dc.get_run_value(
self.ctrl_src, 'integrationTime.value'))
return int(self.run_dc[
self.ctrl_src, 'integrationTime'].as_single_value())
return 12
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment