##// END OF EJS Templates
Grafico de espectros actualizado
Miguel Valdez -
r27:fb9ede38dd50
parent child
Show More
@@ -211,7 +211,7 class BaseGraph:
211 self.ylabel = ylabel
211 self.ylabel = ylabel
212 self.__colormap = colormap
212 self.__colormap = colormap
213
213
214 def plotBox(self, xmin, xmax, ymin, ymax, xopt=None, yopt=None):
214 def plotBox(self, xmin, xmax, ymin, ymax, xopt=None, yopt=None, nolabels=False):
215 """
215 """
216
216
217 """
217 """
@@ -230,7 +230,8 class BaseGraph:
230
230
231 plplot.plbox(xopt, 0.0, 0, yopt, 0.0, 0)
231 plplot.plbox(xopt, 0.0, 0, yopt, 0.0, 0)
232
232
233 plplot.pllab(self.xlabel, self.ylabel, self.title)
233 if not(nolabels):
234 plplot.pllab(self.xlabel, self.ylabel, self.title)
234
235
235
236
236 def colorbarPlot(self, xmin=0., xmax=1., ymin=0., ymax=1.):
237 def colorbarPlot(self, xmin=0., xmax=1., ymin=0., ymax=1.):
@@ -457,7 +458,7 class ColorPlot():
457 self.__showColorbar = False
458 self.__showColorbar = False
458 self.__showPowerProfile = True
459 self.__showPowerProfile = True
459
460
460 self.__szchar = 0.7
461 self.__szchar = 0.65
461 self.__xrange = None
462 self.__xrange = None
462 self.__yrange = None
463 self.__yrange = None
463 self.__zrange = None
464 self.__zrange = None
@@ -486,7 +487,7 class ColorPlot():
486
487
487 cmapObj = BaseGraph()
488 cmapObj = BaseGraph()
488 cmapObj.setName(key)
489 cmapObj.setName(key)
489 cmapObj.setOpt("bc","bcmt")
490 cmapObj.setOpt("bc","bcmtv")
490 cmapObj.setup(title="dBs",
491 cmapObj.setup(title="dBs",
491 xlabel="",
492 xlabel="",
492 ylabel="",
493 ylabel="",
@@ -534,10 +535,10 class ColorPlot():
534 def setScreenPos(self, width='small'):
535 def setScreenPos(self, width='small'):
535
536
536 if width == 'small':
537 if width == 'small':
537 xi = 0.13; yi = 0.12; xw = 0.86; yw = 0.70; xcmapw = 0.05; xpoww = 0.26; deltaxcmap = 0.02; deltaxpow = 0.05
538 xi = 0.13; yi = 0.12; xw = 0.86; yw = 0.70; xcmapw = 0.04; xpoww = 0.25; deltaxcmap = 0.02; deltaxpow = 0.06
538
539
539 if width == 'medium':
540 if width == 'medium':
540 xi = 0.07; yi = 0.10; xw = 0.90; yw = 0.60; xcmapw = 0.05; xpoww = 0.24; deltaxcmap = 0.02; deltaxpow = 0.06
541 xi = 0.07; yi = 0.10; xw = 0.90; yw = 0.60; xcmapw = 0.04; xpoww = 0.24; deltaxcmap = 0.02; deltaxpow = 0.06
541
542
542 if self.__showColorbar:
543 if self.__showColorbar:
543 xw -= xcmapw + deltaxcmap
544 xw -= xcmapw + deltaxcmap
@@ -594,12 +595,18 class ColorPlot():
594 if zmin == None: zmin = numpy.nanmin(data)
595 if zmin == None: zmin = numpy.nanmin(data)
595 if zmax == None: zmax = numpy.nanmax(data)
596 if zmax == None: zmax = numpy.nanmax(data)
596
597
598 plplot.plschr(0.0, self.__szchar)
599
597 self.m_BaseGraph.plotBox(xmin, xmax, ymin, ymax)
600 self.m_BaseGraph.plotBox(xmin, xmax, ymin, ymax)
598 self.m_BaseGraph.basicPcolorPlot(data, x, y, xmin, xmax, ymin, ymax, zmin, zmax)
601 self.m_BaseGraph.basicPcolorPlot(data, x, y, xmin, xmax, ymin, ymax, zmin, zmax)
599
602
600 if self.__showColorbar:
603 if self.__showColorbar:
604
605
601 key = "colorbar"
606 key = "colorbar"
602 cmapObj = self.graphObjDict[key]
607 cmapObj = self.graphObjDict[key]
608
609 plplot.plschr(0.0, self.__szchar-0.05)
603 cmapObj.plotBox(0., 1., zmin, zmax)
610 cmapObj.plotBox(0., 1., zmin, zmax)
604 cmapObj.colorbarPlot(0., 1., zmin, zmax)
611 cmapObj.colorbarPlot(0., 1., zmin, zmax)
605
612
@@ -613,9 +620,13 class ColorPlot():
613 powObj = self.graphObjDict[key]
620 powObj = self.graphObjDict[key]
614
621
615 plplot.pllsty(2)
622 plplot.pllsty(2)
616 powObj.plotBox(zmin, zmax, ymin, ymax)
623 plplot.plschr(0.0, self.__szchar-0.05)
624 powObj.plotBox(zmin, zmax, ymin, ymax, nolabels=True)
625
617 plplot.pllsty(1)
626 plplot.pllsty(1)
627 plplot.plschr(0.0, self.__szchar)
618 powObj.plotBox(zmin, zmax, ymin, ymax, xopt='bc', yopt='bc')
628 powObj.plotBox(zmin, zmax, ymin, ymax, xopt='bc', yopt='bc')
629
619 plplot.plcol0(9)
630 plplot.plcol0(9)
620 powObj.basicXYPlot(power, heis)
631 powObj.basicXYPlot(power, heis)
621 plplot.plcol0(1)
632 plplot.plcol0(1)
@@ -7,6 +7,7 Created on Feb 7, 2012
7
7
8 import os, sys
8 import os, sys
9 import numpy
9 import numpy
10 import datetime
10 import plplot
11 import plplot
11
12
12 path = os.path.split(os.getcwd())[0]
13 path = os.path.split(os.getcwd())[0]
@@ -102,7 +103,10 class Spectrum():
102 plplot.pladv(0)
103 plplot.pladv(0)
103 plplot.plssub(nx, nx)
104 plplot.plssub(nx, nx)
104
105
105 self.__isPlotIni = True
106 self.__nx = nx
107 self.__ny = nx
108 self.__isPlotIni = True
109
106
110
107 def plotData(self, xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None, titleList=None, xlabelList=None, ylabelList=None, showColorbar=False, showPowerProfile=True, XAxisAsTime=False):
111 def plotData(self, xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None, titleList=None, xlabelList=None, ylabelList=None, showColorbar=False, showPowerProfile=True, XAxisAsTime=False):
108
112
@@ -124,6 +128,9 class Spectrum():
124 x = numpy.arange(nX)
128 x = numpy.arange(nX)
125 y = self.m_Spectra.heights
129 y = self.m_Spectra.heights
126
130
131 thisDatetime = datetime.datetime.fromtimestamp(self.m_Spectra.m_BasicHeader.utc)
132 txtDate = "Self Spectra - Date: %s" %(thisDatetime.strftime("%d-%b-%Y %H:%M:%S"))
133
127 if xmin == None: xmin = x[0]
134 if xmin == None: xmin = x[0]
128 if xmax == None: xmax = x[-1]
135 if xmax == None: xmax = x[-1]
129 if ymin == None: ymin = y[0]
136 if ymin == None: ymin = y[0]
@@ -132,6 +139,8 class Spectrum():
132 if zmax == None: zmax = numpy.nanmax(abs(data))
139 if zmax == None: zmax = numpy.nanmax(abs(data))
133
140
134 plplot.plbop()
141 plplot.plbop()
142
143 plplot.plssub(self.__nx, self.__ny)
135 for i in range(self.nGraphs):
144 for i in range(self.nGraphs):
136 self.graphObjList[i].iniSubpage()
145 self.graphObjList[i].iniSubpage()
137 self.graphObjList[i].plotData(data[i,:,:],
146 self.graphObjList[i].plotData(data[i,:,:],
@@ -143,8 +152,11 class Spectrum():
143 ymax=ymax,
152 ymax=ymax,
144 zmin=zmin,
153 zmin=zmin,
145 zmax=zmax)
154 zmax=zmax)
146
147
155
156 plplot.plssub(1,0)
157 plplot.pladv(0)
158 plplot.plvpor(0., 1., 0., 1.)
159 plplot.plmtex("t",-1., 0.5, 0.5, txtDate)
148 plplot.plflush()
160 plplot.plflush()
149 plplot.pleop()
161 plplot.pleop()
150
162
General Comments 0
You need to be logged in to leave comments. Login now