Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- BoardID: 31
- Channel: 1
- Event Number: 3123
- Pattern: 0x0000
- 2627.000000
- 2627.000000
- 2626.009033
- 2629.000000
- .
- .
- .(up to 1024 data)
- BoardID: 31
- Channel: 1
- Event Number: 3124
- Pattern: 0x0000
- 2627.000000
- 2627.000000
- 2628.949707
- 2626.099365
- .
- .
- ....(up to 1024 data)
- .
- ..1000 number of events
- with open("data.txt") as f:
- for i in range(1000): #I have 1000 number of events
- all_lines = f.readlines()
- def plot_event(start = 4, all_lines= 'all_lines'):
- lines = all_lines[start : 1029 - 4 + start]
- return (plot_event(4*i, all_lines))
- x = np.array(range(1,1025)) #for all the events x has same range
- y2 = float(lines.split()[0])
- y2_=list(y2)
- y22 = [((j / 4096)-0.5) for j in y2_]
- fig = plt.figure()
- ax = fig.add_subplot(111)
- ax.set_xlabel('Time (ns)')
- ax.set_ylabel('counts')
- ax.plot(x,y22, 'k-', color= 'b', label='data')
- fig=plt.gcf()
- plt.show()
- plt.draw()
Add Comment
Please, Sign In to add comment