mirror of
https://github.com/bec-project/ophyd_devices.git
synced 2026-11-27 11:38:02 +01:00
w
This commit is contained in:
1 parent
638656b439
commit
3ebc1baebb
1 file changed
+8
-12
@@ -335,29 +335,25 @@ class ADROIProcessing(ROIProcessing):
|
||||
return
|
||||
if not self.scan_server_scan_info:
|
||||
return
|
||||
async_update = {
|
||||
"type": "add",
|
||||
"max_shape": [
|
||||
self.scan_server_scan_info.frames_per_trigger
|
||||
* len(self.scan_server_scan_info.positions)
|
||||
],
|
||||
}
|
||||
|
||||
n_points = int(
|
||||
len(self.scan_server_scan_info.positions)
|
||||
* self.scan_server_scan_info.frames_per_trigger
|
||||
)
|
||||
if self.average_frames_per_trigger.get() is True:
|
||||
n_points = int(len(self.scan_server_scan_info.positions))
|
||||
if isinstance(value, (list, np.ndarray)):
|
||||
value = value / len(value) # Average over the number of frames per trigger
|
||||
value = float(value) # Ensure the value is a float for list and np.ndarray types
|
||||
async_update["max_shape"] = [
|
||||
len(self.scan_server_scan_info.positions)
|
||||
] # Only one value per position
|
||||
|
||||
if output_kind == "scalar":
|
||||
async_update = {"type": "add", "max_shape": [n_points]}
|
||||
self.result_scalar.put(
|
||||
{result_name: {"value": value, "timestamp": timestamp or time.time()}},
|
||||
async_update=async_update,
|
||||
)
|
||||
else:
|
||||
shape_0 = async_update["max_shape"][0]
|
||||
async_update["max_shape"] = [shape_0, None] # Allow the second dimension to be variable
|
||||
async_update = {"type": "add", "max_shape": [n_points, None]}
|
||||
self.result_waveform.put(
|
||||
{result_name: {"value": value, "timestamp": timestamp or time.time()}},
|
||||
async_update=async_update,
|
||||
|
||||
Reference in new issue
Block a user