From 0e8f663fdf26c015a7b408460e8011322097bd52 Mon Sep 17 00:00:00 2001 From: Sven Augustin Date: Wed, 15 Oct 2025 12:53:50 +0200 Subject: [PATCH] names --- dap/accumulator.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dap/accumulator.py b/dap/accumulator.py index 689d715..756e6a0 100644 --- a/dap/accumulator.py +++ b/dap/accumulator.py @@ -23,14 +23,14 @@ def main(): def accumulate(accumulator_host, accumulator_port): zmq_socks = ZMQSocketsAccumulator(accumulator_host, accumulator_port) - run_name_before = None - output_dap = FileHandler() + previous_run_name = None + output = FileHandler() n_frames_received = 0 while True: if not zmq_socks.has_data(): - output_dap.flush() # may be too intensive + output.flush() # may be too intensive continue results = zmq_socks.get_data() @@ -40,10 +40,10 @@ def accumulate(accumulator_host, accumulator_port): pulse_id = results.get("pulse_id", 0) run_name = str(pulse_id // 10000 * 10000) - if run_name != run_name_before: - run_name_before = run_name - fname_output = f"{OUTPUT_DIR_NAME}/{detector}/{run_name}.dap" - output_dap.switch(fname_output) + if run_name != previous_run_name: + previous_run_name = run_name + fname = f"{OUTPUT_DIR_NAME}/{detector}/{run_name}.dap" + output.switch(fname) res_is_good_frame = results.get("is_good_frame", -1) res_is_hit_frame = results.get("is_hit_frame", False) @@ -51,7 +51,7 @@ def accumulate(accumulator_host, accumulator_port): res_laser_on = results.get("laser_on", False) res_roi_intensities = results.get("roi_intensities", []) - print(pulse_id, res_is_good_frame, res_is_hit_frame, res_number_of_spots, res_laser_on, *res_roi_intensities, file=output_dap.file) + print(pulse_id, res_is_good_frame, res_is_hit_frame, res_number_of_spots, res_laser_on, *res_roi_intensities, file=output.file)