diff --git a/dap/accumulator.py b/dap/accumulator.py index 904fa24..435e805 100644 --- a/dap/accumulator.py +++ b/dap/accumulator.py @@ -3,7 +3,7 @@ import argparse from bsread.sender import Sender, PUB from utils import FileHandler, Sorter -from zmqsocks import ZMQSocketsAccumulator, make_address +from zmqsocks import ZMQSocketsAccumulator, make_address, make_bsread_timestamp OUTPUT_DIR = "/gpfs/photonics/swissfel/buffer/dap/data" @@ -62,6 +62,7 @@ def accumulate(accumulator_addr, bsread_port): to_copy = ( "pulse_id", + "timestamp", "frame", "is_good_frame", "number_of_spots", @@ -73,7 +74,9 @@ def accumulate(accumulator_addr, bsread_port): sorter.add(pulse_id, data) ready = sorter.flush_ready() for pulse_id, data in ready: - sender.send(pulse_id=pulse_id, data=data) #TODO: is there a timestamp in the input? + timestamp = results["timestamp"] + timestamp = make_bsread_timestamp(timestamp, pulse_id) + sender.send(pulse_id=pulse_id, data=data, timestamp=timestamp)