@@ -211,7 +211,7 class BaseGraph: | |||
|
211 | 211 | self.ylabel = ylabel |
|
212 | 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 | 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 | 237 | def colorbarPlot(self, xmin=0., xmax=1., ymin=0., ymax=1.): |
@@ -457,7 +458,7 class ColorPlot(): | |||
|
457 | 458 | self.__showColorbar = False |
|
458 | 459 | self.__showPowerProfile = True |
|
459 | 460 | |
|
460 |
self.__szchar = 0. |
|
|
461 | self.__szchar = 0.65 | |
|
461 | 462 | self.__xrange = None |
|
462 | 463 | self.__yrange = None |
|
463 | 464 | self.__zrange = None |
@@ -486,7 +487,7 class ColorPlot(): | |||
|
486 | 487 | |
|
487 | 488 | cmapObj = BaseGraph() |
|
488 | 489 | cmapObj.setName(key) |
|
489 | cmapObj.setOpt("bc","bcmt") | |
|
490 | cmapObj.setOpt("bc","bcmtv") | |
|
490 | 491 | cmapObj.setup(title="dBs", |
|
491 | 492 | xlabel="", |
|
492 | 493 | ylabel="", |
@@ -534,10 +535,10 class ColorPlot(): | |||
|
534 | 535 | def setScreenPos(self, width='small'): |
|
535 | 536 | |
|
536 | 537 | if width == 'small': |
|
537 |
xi = 0.13; yi = 0.12; xw = 0.86; yw = 0.70; xcmapw = 0.0 |
|
|
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 | 540 | if width == 'medium': |
|
540 |
xi = 0.07; yi = 0.10; xw = 0.90; yw = 0.60; xcmapw = 0.0 |
|
|
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 | 543 | if self.__showColorbar: |
|
543 | 544 | xw -= xcmapw + deltaxcmap |
@@ -594,12 +595,18 class ColorPlot(): | |||
|
594 | 595 | if zmin == None: zmin = numpy.nanmin(data) |
|
595 | 596 | if zmax == None: zmax = numpy.nanmax(data) |
|
596 | 597 | |
|
598 | plplot.plschr(0.0, self.__szchar) | |
|
599 | ||
|
597 | 600 | self.m_BaseGraph.plotBox(xmin, xmax, ymin, ymax) |
|
598 | 601 | self.m_BaseGraph.basicPcolorPlot(data, x, y, xmin, xmax, ymin, ymax, zmin, zmax) |
|
599 | 602 | |
|
600 | 603 | if self.__showColorbar: |
|
604 | ||
|
605 | ||
|
601 | 606 | key = "colorbar" |
|
602 | 607 | cmapObj = self.graphObjDict[key] |
|
608 | ||
|
609 | plplot.plschr(0.0, self.__szchar-0.05) | |
|
603 | 610 | cmapObj.plotBox(0., 1., zmin, zmax) |
|
604 | 611 | cmapObj.colorbarPlot(0., 1., zmin, zmax) |
|
605 | 612 | |
@@ -613,9 +620,13 class ColorPlot(): | |||
|
613 | 620 | powObj = self.graphObjDict[key] |
|
614 | 621 | |
|
615 | 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 | 626 | plplot.pllsty(1) |
|
627 | plplot.plschr(0.0, self.__szchar) | |
|
618 | 628 | powObj.plotBox(zmin, zmax, ymin, ymax, xopt='bc', yopt='bc') |
|
629 | ||
|
619 | 630 | plplot.plcol0(9) |
|
620 | 631 | powObj.basicXYPlot(power, heis) |
|
621 | 632 | plplot.plcol0(1) |
@@ -7,6 +7,7 Created on Feb 7, 2012 | |||
|
7 | 7 | |
|
8 | 8 | import os, sys |
|
9 | 9 | import numpy |
|
10 | import datetime | |
|
10 | 11 | import plplot |
|
11 | 12 | |
|
12 | 13 | path = os.path.split(os.getcwd())[0] |
@@ -102,7 +103,10 class Spectrum(): | |||
|
102 | 103 | plplot.pladv(0) |
|
103 | 104 | plplot.plssub(nx, nx) |
|
104 | 105 | |
|
105 |
self.__ |
|
|
106 | self.__nx = nx | |
|
107 | self.__ny = nx | |
|
108 | self.__isPlotIni = True | |
|
109 | ||
|
106 | 110 | |
|
107 | 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 | 128 | x = numpy.arange(nX) |
|
125 | 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 | 134 | if xmin == None: xmin = x[0] |
|
128 | 135 | if xmax == None: xmax = x[-1] |
|
129 | 136 | if ymin == None: ymin = y[0] |
@@ -132,6 +139,8 class Spectrum(): | |||
|
132 | 139 | if zmax == None: zmax = numpy.nanmax(abs(data)) |
|
133 | 140 | |
|
134 | 141 | plplot.plbop() |
|
142 | ||
|
143 | plplot.plssub(self.__nx, self.__ny) | |
|
135 | 144 | for i in range(self.nGraphs): |
|
136 | 145 | self.graphObjList[i].iniSubpage() |
|
137 | 146 | self.graphObjList[i].plotData(data[i,:,:], |
@@ -143,8 +152,11 class Spectrum(): | |||
|
143 | 152 | ymax=ymax, |
|
144 | 153 | zmin=zmin, |
|
145 | 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 | 160 | plplot.plflush() |
|
149 | 161 | plplot.pleop() |
|
150 | 162 |
General Comments 0
You need to be logged in to leave comments.
Login now