This commit is contained in:
2024-08-08 16:30:06 +02:00
parent 93f0702c41
commit bfaa80c9d0
2 changed files with 8 additions and 8 deletions

View File

@ -1,22 +1,22 @@
import numpy as np
def calc_force_send(results, data, pixel_mask_pf, image, n_aggregated_images, data_summed):
def calc_force_send(results, data, pixel_mask_pf, image, data_summed, n_aggregated_images):
force_send_visualisation = False
if data.dtype == np.uint16:
return data, force_send_visualisation, n_aggregated_images, data_summed
return data, force_send_visualisation, data_summed, n_aggregated_images
apply_threshold = results.get("apply_threshold", False)
apply_aggregation = results.get("apply_aggregation", False)
apply_threshold = results.get("apply_threshold", False)
if not apply_aggregation:
data_summed = None
n_aggregated_images = 1
if not apply_threshold and not apply_aggregation:
if not apply_aggregation and not apply_threshold:
data = image
return data, force_send_visualisation, n_aggregated_images, data_summed
return data, force_send_visualisation, data_summed, n_aggregated_images
if apply_threshold and all(k in results for k in ("threshold_min", "threshold_max")):
threshold_min = float(results["threshold_min"])
@ -42,7 +42,7 @@ def calc_force_send(results, data, pixel_mask_pf, image, n_aggregated_images, da
if pixel_mask_pf is not None:
data[~pixel_mask_pf] = np.nan
return data, force_send_visualisation, n_aggregated_images, data_summed
return data, force_send_visualisation, data_summed, n_aggregated_images

View File

@ -44,8 +44,8 @@ def work(backend_address, accumulator_host, accumulator_port, visualisation_host
zmq_socks = ZMQSockets(backend_address, accumulator_host, accumulator_port, visualisation_host, visualisation_port)
n_aggregated_images = 1
data_summed = None
n_aggregated_images = 1
while True:
@ -118,7 +118,7 @@ def work(backend_address, accumulator_host, accumulator_port, visualisation_host
calc_peakfinder_analysis(results, pfdata, pixel_mask_pf)
# ???
data, force_send_visualisation, n_aggregated_images, data_summed = calc_force_send(results, data, pixel_mask_pf, image, n_aggregated_images, data_summed)
data, force_send_visualisation, data_summed, n_aggregated_images = calc_force_send(results, data, pixel_mask_pf, image, data_summed, n_aggregated_images)
results["type"] = str(data.dtype)
results["shape"] = data.shape