Skip to content
Snippets Groups Projects
Commit 9e5db36d authored by Jakobsen, Mads Bregenholt's avatar Jakobsen, Mads Bregenholt
Browse files

testing plotting with new code for gain stage data

parent 78c3b5d6
No related branches found
No related tags found
No related merge requests found
Pipeline #167513 passed
...@@ -39,6 +39,7 @@ from onlinemid.utils.karabo import hash_from_dict ...@@ -39,6 +39,7 @@ from onlinemid.utils.karabo import hash_from_dict
from onlinemid.utils.agipd import generate_test_data from onlinemid.utils.agipd import generate_test_data
from onlinemid.utils.karabo import Periodic_Output from onlinemid.utils.karabo import Periodic_Output
from onlinemid.dataplotters.agipd_module import AgipdModulePlotter from onlinemid.dataplotters.agipd_module import AgipdModulePlotter
from onlinemid.dataplotters.gain_stage import GainStagePlotter
from onlinemid.utils.image_plotting import DataToPlotToHash from onlinemid.utils.image_plotting import DataToPlotToHash
...@@ -369,8 +370,9 @@ class OnlineMIDProcessor(TrainMatcher.TrainMatcher): ...@@ -369,8 +370,9 @@ class OnlineMIDProcessor(TrainMatcher.TrainMatcher):
plot_hash = self.onlineImagePlotter.add_to_hash(plot_hash, 'data.current_det_image', AgipdModulePlotter, train_id, detector_data_list[0][1][0]) plot_hash = self.onlineImagePlotter.add_to_hash(plot_hash, 'data.current_det_image', AgipdModulePlotter, train_id, detector_data_list[0][1][0])
#if numPixelPerGainStage is not None: if numPixelPerGainStage is not None:
# plot_hash = self.onlineImagePlotter.add_to_hash(plot_hash, 'my_added_key_pixel_per_gain_stage', PixelperGainStagePlotter(), numPixelPerGainStage) plot_hash = self.onlineImagePlotter.add_to_hash(plot_hash, 'data.accumulating_lit_bunch', GainStagePlotter, train_id, numPixelPerGainStage)
......
from .dataplotters.agipd_module import AgipdModulePlotter from .dataplotters.agipd_module import AgipdModulePlotter
from .dataplotters.gain_stage import GainStagePlotter
from .utils.image_plotting import DataToPlotToHash from .utils.image_plotting import DataToPlotToHash
#from .utils.image_plotting import OnlineImagePlotter #from .utils.image_plotting import OnlineImagePlotter
......
...@@ -28,12 +28,12 @@ class GainStagePlotter(): ...@@ -28,12 +28,12 @@ class GainStagePlotter():
plt.switch_backend("agg") plt.switch_backend("agg")
fig = plt.figure(figsize=(15,10)) fig = plt.figure(figsize=(15,10))
plt.imshow(data, interpolation=None) plt.plot(data)
plt.title(f"this is my plot")
plt.xlabel('kbar')
plt.ylabel('Pk')
plt.title(f"this is my plot for tid {tid}")
plt.xlabel('mem cell')
plt.ylabel('number in gain stage')
plt.legend('low', 'med', 'high')
canvas = FigureCanvasAgg(fig) canvas = FigureCanvasAgg(fig)
canvas.draw() canvas.draw()
image_buffer = np.frombuffer(canvas.buffer_rgba(), dtype=np.uint8).reshape( image_buffer = np.frombuffer(canvas.buffer_rgba(), dtype=np.uint8).reshape(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment