4 from libCatKernel
import *
11 proc.__init__(self,cat,obj,panel,path)
13 self.
s1=self.getControl(
"s1")
14 self.
s2=self.getControl(
"s2")
15 self.
s3=self.getControl(
"s3")
16 self.
s4=self.getControl(
"s4")
18 self.panel.Bind(wx.EVT_BUTTON, self.
onApply, id=xrc.XRCID(
"Apply"))
21 v1 = float(self.
s1.GetValue())
22 v2 = float(self.
s2.GetValue())
23 v3 = float(self.
s3.GetValue())
24 v4 = float(self.
s4.GetValue())
25 self.obj.setSigma(v1,v2,v3,v4)
33 self.
s1.SetValue(str(v1))
34 self.
s2.SetValue(str(v2))
35 self.
s3.SetValue(str(v3))
36 self.
s4.SetValue(str(v4))
40 def Edit (cat, obj, panel, path):
41 return TestUSB(cat, obj, panel, path)
46 fig = plt.figure(figsize=(10,10))
47 fig.suptitle(
"Run "+str(run), fontsize=14, fontweight=
'bold')
49 ax = fig.add_subplot(2,1,vplot)
55 ax1 = fig.add_subplot(2,1,1)
56 lines, = ax1.plot([],[],
'bo')
58 ax1.set_autoscaley_on(
True)
62 lines.set_xdata(obj.data(0))
63 lines.set_ydata(obj.data(1))
68 ax2 = fig.add_subplot(2,1,2)
69 lines, = ax2.plot([],[],
'bo')
71 ax2.set_autoscaley_on(
True)
75 lines.set_xdata(obj.data(2))
76 lines.set_ydata(obj.data(3))
83 fig.canvas.flush_events()
89 def Plot(cat, obj, parent, id):
90 from mpl_toolkits.mplot3d
import Axes3D
91 from matplotlib
import cm
92 import matplotlib
as mpl
93 import matplotlib.pyplot
as plt
98 fig.suptitle(
'TestSuite - Plot capabilities', fontsize=14, fontweight=
'bold')
101 p1=fig.add_subplot(2,3,1)
102 p1.plot(obj.data(0),
'bo', obj.data().vector(1),
'k')
103 p1.set_title(
r'$\sigma_0='+str(obj.sigma(0))+
'$')
106 p2=fig.add_subplot(2,3,2)
107 p2.plot(obj.data(1),
'r--')
108 p2.set_title(
r'$\sigma_1='+str(obj.sigma(1))+
'$')
112 n, bins, h=plt.hist(obj.data().vector(0), 10)
113 plt.title(obj.data().
title(0))
118 plt.hist(obj.data().vector(1), 20)
119 plt.title(obj.data().
name(1)+
" : "+obj.data().
title(1))
123 p5=fig.add_subplot(2,3,5)
124 h1=
h1d(p5, obj.hist1d(0), facecolor=
'red',linestyle=
'dashed')
146 p7=fig.add_subplot(2,3,6)
149 p7.plot(h7.xbins(),h7.bins(),
'ro',color=
'red')
def updatePlots(figs, obj)
def h1d(fig, histo, alpha=0.5, facecolor='green', edgecolor='yellow', linestyle='dashed')
def createPlots(cat, obj, run)
def Plot(cat, obj, parent, id)
def Edit(cat, obj, panel, path)
def __init__(self, cat, obj, panel, path)