From 5ec0206932d07f3e751d6f8060269f230de510b0 Mon Sep 17 00:00:00 2001 From: Mads Jakobsen <mads.jakobsen@xfel.eu> Date: Thu, 13 Mar 2025 14:38:38 +0100 Subject: [PATCH] fixing typo, adding sleep function to test --- .../src/onlinemid_karabo/processor.py | 2 +- .../src/onlinemid/dataplotters/agipd_module.py | 2 ++ python_package/src/onlinemid/utils/image_plotting.py | 10 +++++----- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/karabo_devices/shared_mem_processor/src/onlinemid_karabo/processor.py b/karabo_devices/shared_mem_processor/src/onlinemid_karabo/processor.py index 598be39..4a65597 100644 --- a/karabo_devices/shared_mem_processor/src/onlinemid_karabo/processor.py +++ b/karabo_devices/shared_mem_processor/src/onlinemid_karabo/processor.py @@ -378,7 +378,7 @@ class OnlineMIDProcessor(TrainMatcher.TrainMatcher): plot_hash = Hash() - plot_hash = self.onlineImagePlotter.add_to_hash(plot_hash, 'agipd_data_plot', train_id, detector_data_list[0][1][0]) + plot_hash = self.onlineImagePlotter.add_to_hash(plot_hash, 'first_bunch', train_id, detector_data_list[0][1][0]) plot_hash = self.onlineImagePlotter.add_to_hash(plot_hash, 'gain_stage', train_id, numPixelPerGainStage) diff --git a/python_package/src/onlinemid/dataplotters/agipd_module.py b/python_package/src/onlinemid/dataplotters/agipd_module.py index f699c0f..ca5cd2c 100644 --- a/python_package/src/onlinemid/dataplotters/agipd_module.py +++ b/python_package/src/onlinemid/dataplotters/agipd_module.py @@ -27,6 +27,8 @@ class AgipdModulePlotter(): @staticmethod def make_plot(data): + import time + time.sleep(2) plt.switch_backend("agg") fig = plt.figure(figsize=(15,10)) diff --git a/python_package/src/onlinemid/utils/image_plotting.py b/python_package/src/onlinemid/utils/image_plotting.py index e9df14a..286bbdd 100644 --- a/python_package/src/onlinemid/utils/image_plotting.py +++ b/python_package/src/onlinemid/utils/image_plotting.py @@ -135,15 +135,15 @@ class DataToPlotToHash(): STRING_ELEMENT(res) .key(f"{basenode}.update_interval") - .displayedName('update interval') - .description('update interval') + .displayedName('Update interval') + .description('Update interval of the plot') .assignmentOptional() .defaultValue("") .commit(), ) - + schema_update = Schema() ( OUTPUT_CHANNEL(schema_update) @@ -166,9 +166,9 @@ class DataToPlotToHash(): if current_img is not None: hash[f'{hash_key}.plot'] = ImageData(current_img) - + now = time.time() - hash[f'{hash_key}.update_interval'] = f'Update Interval {(now - self.hash_keys_and_plotter[hash_key]['time_to_make_plot']):.1f}s' + hash[f'{hash_key}.update_interval'] = f'{(now - self.hash_keys_and_plotter[hash_key]['time_to_make_plot']):.1f}s' self.hash_keys_and_plotter[hash_key]['time_to_make_plot'] = now return hash -- GitLab