@@ -13,13 +13,16 class Figure: | |||
|
13 | 13 | self.width = width |
|
14 | 14 | self.height = height |
|
15 | 15 | self.nplots = nplots |
|
16 | mpldriver.init(idfigure, wintitle, width, height) | |
|
16 | self.fig = mpldriver.init(idfigure, wintitle, width, height) | |
|
17 | 17 | |
|
18 | 18 | self.axesList = [] |
|
19 | 19 | |
|
20 | 20 | def setTitle(self, title): |
|
21 | 21 | mpldriver.setTitle(self.idfigure, title) |
|
22 | 22 | |
|
23 | def setWinTitle(self,title): | |
|
24 | mpldriver.setWinTitle(fig=self.fig, title=title) | |
|
25 | ||
|
23 | 26 | def setTextFromAxes(self, title): |
|
24 | 27 | mpldriver.setTextFromAxes(self.idfigure, self.axesList[0].ax, title) |
|
25 | 28 |
@@ -10,6 +10,10 def init(idfigure, wintitle, width, height): | |||
|
10 | 10 | fig.canvas.manager.set_window_title(wintitle) |
|
11 | 11 | fig.canvas.manager.resize(width,height) |
|
12 | 12 | matplotlib.pyplot.ion() |
|
13 | return fig | |
|
14 | ||
|
15 | def setWinTitle(fig, title): | |
|
16 | fig.canvas.manager.set_window_title(title) | |
|
13 | 17 | |
|
14 | 18 | def setTextFromAxes(idfigure, ax, title): |
|
15 | 19 | fig = matplotlib.pyplot.figure(idfigure) |
@@ -56,7 +60,7 def pcolor(ax, x, y, z, xmin, xmax, ymin, ymax, zmin, zmax, xlabel, ylabel, titl | |||
|
56 | 60 | ax.set_ylabel(ylabel) |
|
57 | 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 | 64 | matplotlib.pyplot.colorbar(imesh, cax=ax_cb) |
|
61 | 65 | ax_cb.yaxis.tick_right() |
|
62 | 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 | 69 | matplotlib.pyplot.tight_layout() |
|
66 | 70 | return imesh |
|
67 | 71 | else: |
|
68 | tmp = z[0:-1,0:-1] | |
|
69 | mesh.set_array(tmp.ravel()) | |
|
72 | z = z.T | |
|
73 | z = z[0:-1,0:-1] | |
|
74 | mesh.set_array(z.ravel()) | |
|
70 | 75 | |
|
71 | 76 | return mesh |
|
72 | 77 |
@@ -24,7 +24,6 class SpectraPlot(Figure): | |||
|
24 | 24 | for y in range(nrow): |
|
25 | 25 | for x in range(ncol): |
|
26 | 26 | if counter < self.nplots: |
|
27 | # plt.subplot2grid((nrow, ncol), (y, x), colspan=colspan, rowspan=rowspan) | |
|
28 | 27 | self.makeAxes(nrow, ncol, y, x, colspan, rowspan) |
|
29 | 28 | counter += 1 |
|
30 | 29 | |
@@ -84,6 +83,13 class SpectraPlot(Figure): | |||
|
84 | 83 | |
|
85 | 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 | 93 | ylabel = "Range[Km]" |
|
88 | 94 | |
|
89 | 95 | xlabel = "m/s" |
@@ -92,7 +98,7 class SpectraPlot(Figure): | |||
|
92 | 98 | title = "Channel %d"%i |
|
93 | 99 | axes = self.axesList[i] |
|
94 | 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 | 104 | self.draw() |
@@ -160,11 +166,9 class Scope(Figure): | |||
|
160 | 166 | thisDatetime = datetime.datetime.fromtimestamp(dataOut.utctime) |
|
161 | 167 | dateTime = "%s"%(thisDatetime.strftime("%d-%b-%Y %H:%M:%S")) |
|
162 | 168 | date = "%s"%(thisDatetime.strftime("%d-%b-%Y")) |
|
163 |
|
|
|
164 | ||
|
165 | self.setTitle(title=figuretitle) | |
|
169 | title = "Scope: " + dateTime | |
|
166 | 170 | |
|
167 |
|
|
|
171 | self.setWinTitle(title) | |
|
168 | 172 | |
|
169 | 173 | ylabel = "Intensity" |
|
170 | 174 |
@@ -64,7 +64,7 class Test(): | |||
|
64 | 64 | def run(self): |
|
65 | 65 | |
|
66 | 66 | while(True): |
|
67 |
self.objR.run(path="/Users/dsuarez/Remote/ |
|
|
67 | self.objR.run(path="/Users/dsuarez/Remote/EW_DRIFTS2", | |
|
68 | 68 | startDate=datetime.date(2012,1,1), |
|
69 | 69 | endDate=datetime.date(2012,12,30), |
|
70 | 70 | startTime=datetime.time(0,0,0), |
General Comments 0
You need to be logged in to leave comments.
Login now