diff --git a/schainpy/graphics/figure.py b/schainpy/graphics/figure.py index 504a538..986186b 100644 --- a/schainpy/graphics/figure.py +++ b/schainpy/graphics/figure.py @@ -13,13 +13,16 @@ class Figure: self.width = width self.height = height self.nplots = nplots - mpldriver.init(idfigure, wintitle, width, height) + self.fig = mpldriver.init(idfigure, wintitle, width, height) self.axesList = [] def setTitle(self, title): mpldriver.setTitle(self.idfigure, title) + def setWinTitle(self,title): + mpldriver.setWinTitle(fig=self.fig, title=title) + def setTextFromAxes(self, title): mpldriver.setTextFromAxes(self.idfigure, self.axesList[0].ax, title) diff --git a/schainpy/graphics/mpldriver.py b/schainpy/graphics/mpldriver.py index 5a217aa..0da5624 100644 --- a/schainpy/graphics/mpldriver.py +++ b/schainpy/graphics/mpldriver.py @@ -10,7 +10,11 @@ def init(idfigure, wintitle, width, height): fig.canvas.manager.set_window_title(wintitle) fig.canvas.manager.resize(width,height) matplotlib.pyplot.ion() - + return fig + +def setWinTitle(fig, title): + fig.canvas.manager.set_window_title(title) + def setTextFromAxes(idfigure, ax, title): fig = matplotlib.pyplot.figure(idfigure) 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 ax.set_ylabel(ylabel) ax.set_title(title) - imesh=ax.pcolormesh(x,y,z,vmin=zmin,vmax=zmax) + imesh=ax.pcolormesh(x,y,z.T,vmin=zmin,vmax=zmax) matplotlib.pyplot.colorbar(imesh, cax=ax_cb) ax_cb.yaxis.tick_right() 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 matplotlib.pyplot.tight_layout() return imesh else: - tmp = z[0:-1,0:-1] - mesh.set_array(tmp.ravel()) + z = z.T + z = z[0:-1,0:-1] + mesh.set_array(z.ravel()) return mesh diff --git a/schainpy/model/jroplot.py b/schainpy/model/jroplot.py index 5c64ff1..ac9f3cb 100644 --- a/schainpy/model/jroplot.py +++ b/schainpy/model/jroplot.py @@ -24,7 +24,6 @@ class SpectraPlot(Figure): for y in range(nrow): for x in range(ncol): if counter < self.nplots: -# plt.subplot2grid((nrow, ncol), (y, x), colspan=colspan, rowspan=rowspan) self.makeAxes(nrow, ncol, y, x, colspan, rowspan) counter += 1 @@ -84,6 +83,13 @@ class SpectraPlot(Figure): self.__isConfig = True + thisDatetime = datetime.datetime.fromtimestamp(dataOut.utctime) + dateTime = "%s"%(thisDatetime.strftime("%d-%b-%Y %H:%M:%S")) + date = "%s"%(thisDatetime.strftime("%d-%b-%Y")) + title = "Spectra: " + dateTime + + self.setWinTitle(title) + ylabel = "Range[Km]" xlabel = "m/s" @@ -92,7 +98,7 @@ class SpectraPlot(Figure): title = "Channel %d"%i axes = self.axesList[i] z2 = z[i,:,:] - axes.pcolor(x, y, z, self.xmin, self.xmax, self.ymin, self.ymax, self.zmin, self.zmax, xlabel, ylabel, title) + axes.pcolor(x, y, z2, self.xmin, self.xmax, self.ymin, self.ymax, self.zmin, self.zmax, xlabel, ylabel, title) self.draw() @@ -160,11 +166,9 @@ class Scope(Figure): thisDatetime = datetime.datetime.fromtimestamp(dataOut.utctime) dateTime = "%s"%(thisDatetime.strftime("%d-%b-%Y %H:%M:%S")) date = "%s"%(thisDatetime.strftime("%d-%b-%Y")) - figuretitle = "Scope: " + dateTime - - self.setTitle(title=figuretitle) + title = "Scope: " + dateTime -# self.setTextFromAxes(title=figuretitle) + self.setWinTitle(title) ylabel = "Intensity" diff --git a/schainpy/test4NewSignalChain.py b/schainpy/test4NewSignalChain.py index ad2c73a..0edb256 100644 --- a/schainpy/test4NewSignalChain.py +++ b/schainpy/test4NewSignalChain.py @@ -64,7 +64,7 @@ class Test(): def run(self): while(True): - self.objR.run(path="/Users/dsuarez/Remote/Meteors", + self.objR.run(path="/Users/dsuarez/Remote/EW_DRIFTS2", startDate=datetime.date(2012,1,1), endDate=datetime.date(2012,12,30), startTime=datetime.time(0,0,0),