diff --git a/dap/accumulator.py b/dap/accumulator.py index 96d16c2..81bd6f7 100644 --- a/dap/accumulator.py +++ b/dap/accumulator.py @@ -8,6 +8,13 @@ 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() @@ -61,17 +68,10 @@ def accumulate(accumulator_addr, bsread_port): continue timestamp = tuple(results["timestamp"]) - - to_copy = ( - "frame", - "is_good_frame", - "number_of_spots", - "saturated_pixels" - ) - - data = {f"{detector}:{k}": results[k] for k in to_copy} + data = {f"{detector}:{k}": results[k] for k in ENTRIES_TO_SEND} sorter.add(pulse_id, (timestamp, data)) + ready = sorter.flush_ready() for pulse_id, (timestamp, data) in ready: sender.send(pulse_id=pulse_id, timestamp=timestamp, data=data)