##// END OF EJS Templates
En esta version se ha implementado la clase para ploteo de espectros, a este grafico aun le falta agregar el perfil de potencia para cada canal.
Daniel Valdez -
r196:1878b9614cd2
parent child
Show More
@@ -13,13 +13,16 class Figure:
13 self.width = width
13 self.width = width
14 self.height = height
14 self.height = height
15 self.nplots = nplots
15 self.nplots = nplots
16 mpldriver.init(idfigure, wintitle, width, height)
16 self.fig = mpldriver.init(idfigure, wintitle, width, height)
17
17
18 self.axesList = []
18 self.axesList = []
19
19
20 def setTitle(self, title):
20 def setTitle(self, title):
21 mpldriver.setTitle(self.idfigure, title)
21 mpldriver.setTitle(self.idfigure, title)
22
22
23 def setWinTitle(self,title):
24 mpldriver.setWinTitle(fig=self.fig, title=title)
25
23 def setTextFromAxes(self, title):
26 def setTextFromAxes(self, title):
24 mpldriver.setTextFromAxes(self.idfigure, self.axesList[0].ax, title)
27 mpldriver.setTextFromAxes(self.idfigure, self.axesList[0].ax, title)
25
28
@@ -10,7 +10,11 def init(idfigure, wintitle, width, height):
10 fig.canvas.manager.set_window_title(wintitle)
10 fig.canvas.manager.set_window_title(wintitle)
11 fig.canvas.manager.resize(width,height)
11 fig.canvas.manager.resize(width,height)
12 matplotlib.pyplot.ion()
12 matplotlib.pyplot.ion()
13
13 return fig
14
15 def setWinTitle(fig, title):
16 fig.canvas.manager.set_window_title(title)
17
14 def setTextFromAxes(idfigure, ax, title):
18 def setTextFromAxes(idfigure, ax, title):
15 fig = matplotlib.pyplot.figure(idfigure)
19 fig = matplotlib.pyplot.figure(idfigure)
16 ax.annotate(title, xy=(.1, .99),
20 ax.annotate(title, xy=(.1, .99),
@@ -56,7 +60,7 def pcolor(ax, x, y, z, xmin, xmax, ymin, ymax, zmin, zmax, xlabel, ylabel, titl
56 ax.set_ylabel(ylabel)
60 ax.set_ylabel(ylabel)
57 ax.set_title(title)
61 ax.set_title(title)
58
62
59 imesh=ax.pcolormesh(x,y,z,vmin=zmin,vmax=zmax)
63 imesh=ax.pcolormesh(x,y,z.T,vmin=zmin,vmax=zmax)
60 matplotlib.pyplot.colorbar(imesh, cax=ax_cb)
64 matplotlib.pyplot.colorbar(imesh, cax=ax_cb)
61 ax_cb.yaxis.tick_right()
65 ax_cb.yaxis.tick_right()
62 for tl in ax_cb.get_yticklabels():
66 for tl in ax_cb.get_yticklabels():
@@ -65,8 +69,9 def pcolor(ax, x, y, z, xmin, xmax, ymin, ymax, zmin, zmax, xlabel, ylabel, titl
65 matplotlib.pyplot.tight_layout()
69 matplotlib.pyplot.tight_layout()
66 return imesh
70 return imesh
67 else:
71 else:
68 tmp = z[0:-1,0:-1]
72 z = z.T
69 mesh.set_array(tmp.ravel())
73 z = z[0:-1,0:-1]
74 mesh.set_array(z.ravel())
70
75
71 return mesh
76 return mesh
72
77
@@ -24,7 +24,6 class SpectraPlot(Figure):
24 for y in range(nrow):
24 for y in range(nrow):
25 for x in range(ncol):
25 for x in range(ncol):
26 if counter < self.nplots:
26 if counter < self.nplots:
27 # plt.subplot2grid((nrow, ncol), (y, x), colspan=colspan, rowspan=rowspan)
28 self.makeAxes(nrow, ncol, y, x, colspan, rowspan)
27 self.makeAxes(nrow, ncol, y, x, colspan, rowspan)
29 counter += 1
28 counter += 1
30
29
@@ -84,6 +83,13 class SpectraPlot(Figure):
84
83
85 self.__isConfig = True
84 self.__isConfig = True
86
85
86 thisDatetime = datetime.datetime.fromtimestamp(dataOut.utctime)
87 dateTime = "%s"%(thisDatetime.strftime("%d-%b-%Y %H:%M:%S"))
88 date = "%s"%(thisDatetime.strftime("%d-%b-%Y"))
89 title = "Spectra: " + dateTime
90
91 self.setWinTitle(title)
92
87 ylabel = "Range[Km]"
93 ylabel = "Range[Km]"
88
94
89 xlabel = "m/s"
95 xlabel = "m/s"
@@ -92,7 +98,7 class SpectraPlot(Figure):
92 title = "Channel %d"%i
98 title = "Channel %d"%i
93 axes = self.axesList[i]
99 axes = self.axesList[i]
94 z2 = z[i,:,:]
100 z2 = z[i,:,:]
95 axes.pcolor(x, y, z, self.xmin, self.xmax, self.ymin, self.ymax, self.zmin, self.zmax, xlabel, ylabel, title)
101 axes.pcolor(x, y, z2, self.xmin, self.xmax, self.ymin, self.ymax, self.zmin, self.zmax, xlabel, ylabel, title)
96
102
97
103
98 self.draw()
104 self.draw()
@@ -160,11 +166,9 class Scope(Figure):
160 thisDatetime = datetime.datetime.fromtimestamp(dataOut.utctime)
166 thisDatetime = datetime.datetime.fromtimestamp(dataOut.utctime)
161 dateTime = "%s"%(thisDatetime.strftime("%d-%b-%Y %H:%M:%S"))
167 dateTime = "%s"%(thisDatetime.strftime("%d-%b-%Y %H:%M:%S"))
162 date = "%s"%(thisDatetime.strftime("%d-%b-%Y"))
168 date = "%s"%(thisDatetime.strftime("%d-%b-%Y"))
163 figuretitle = "Scope: " + dateTime
169 title = "Scope: " + dateTime
164
165 self.setTitle(title=figuretitle)
166
170
167 # self.setTextFromAxes(title=figuretitle)
171 self.setWinTitle(title)
168
172
169 ylabel = "Intensity"
173 ylabel = "Intensity"
170
174
@@ -64,7 +64,7 class Test():
64 def run(self):
64 def run(self):
65
65
66 while(True):
66 while(True):
67 self.objR.run(path="/Users/dsuarez/Remote/Meteors",
67 self.objR.run(path="/Users/dsuarez/Remote/EW_DRIFTS2",
68 startDate=datetime.date(2012,1,1),
68 startDate=datetime.date(2012,1,1),
69 endDate=datetime.date(2012,12,30),
69 endDate=datetime.date(2012,12,30),
70 startTime=datetime.time(0,0,0),
70 startTime=datetime.time(0,0,0),
General Comments 0
You need to be logged in to leave comments. Login now