send everything, but sort out the problem cases

This commit is contained in:
2025-10-17 19:52:49 +02:00
parent 3424258ac6
commit a6c68aa5b7

View File

@@ -8,13 +8,6 @@ from zmqsocks import ZMQSocketsAccumulator, make_address
OUTPUT_DIR = "/gpfs/photonics/swissfel/buffer/dap/data"
ENTRIES_TO_SEND = (
"frame",
"is_good_frame",
"number_of_spots",
"saturated_pixels"
)
def main():
parser = argparse.ArgumentParser()
@@ -68,7 +61,14 @@ def accumulate(accumulator_addr, bsread_port):
continue
timestamp = tuple(results["timestamp"])
data = {f"{detector}:{k}": results[k] for k in ENTRIES_TO_SEND}
data = {}
for k, v in results.items():
if isinstance(v, bool):
v = int(v)
elif isinstance(v, list) and not v:
v = None
data[f"{detector}:{k}"] = v
sorter.add(pulse_id, (timestamp, data))