DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
plot_trigprim_output_data.py
Go to the documentation of this file.
1from matplotlib import pyplot as plt
2import numpy as np
3import argparse
4
5parser = argparse.ArgumentParser(description="Trigger Primitives plotter")
6parser.add_argument('-f' '--file', dest='file', help='Trigger Primitives')
7args = parser.parse_args()
8file = args.file
9
10data = np.genfromtxt(file, delimiter=' ')
11data = data.transpose()
12fig = plt.subplot(111)
13legend_properties = {'weight': 'bold'}
14
15start_TPs=0
16n=100 # Number of TPs to plot
17t0 = data[0][:10]
18startTime = data[0][start_TPs:n]
19#time_shift = startTime[0]
20time_shift = t0[0]
21channel = data[3][start_TPs:n]
22adc_sum = data[4][start_TPs:n]
23startTime -= time_shift
24startTime *= 16e-9
25
26label="Input TPs - Event Display"
27fig.set_xlabel("Relative Time (s)")
28fig.set_ylabel("Channel ID")
29#fig.set_ylim([120, 128])
30
31#fig.set_title(title, fontweight='bold')
32scatter = fig.scatter(startTime, channel, s=5, label=label, c=adc_sum, vmax=np.max(adc_sum)/20)
33fig.legend(prop=legend_properties)
34
35
36# Add color bar
37colorbar = plt.colorbar(scatter)
38colorbar.set_label('ADC Sum')
39
40plt.show()
41plt.savefig("output_trigger_primitives.png")