schainPlotTypes.py
699 lines
| 19.3 KiB
| text/x-python
|
PythonLexer
|
r139 | import numpy | ||
|
r138 | import datetime | ||
import time | ||||
|
r133 | from schainPlot import * | ||
|
r141 | |||
|
r156 | class CrossSpc(Figure): | ||
overplot = 0 | ||||
xw = 900 | ||||
yw = 650 | ||||
showprofile = False | ||||
signalA = None | ||||
signalB = None | ||||
coherence = None | ||||
phase = None | ||||
def __init__(self, idfigure, nframes, wintitle, driver, colormap, colorbar, showprofile): | ||||
Figure.__init__(self,idfigure, nframes, wintitle, self.xw, self.yw, self.overplot, driver, colormap, colorbar) | ||||
self.showprofile = showprofile | ||||
self.signalA = None | ||||
self.signalB = None | ||||
self.coherence = None | ||||
self.phase = None | ||||
def getSubplots(self): | ||||
nrows = self.nframes | ||||
ncolumns = 1 | ||||
return nrows, ncolumns | ||||
def setParms(self, data, x, y, xmin, xmax, ymin, ymax, minvalue, maxvalue, *args): | ||||
if xmin == None: xmin = numpy.min(x) | ||||
if xmax == None: xmax = numpy.max(x) | ||||
if ymin == None: ymin = numpy.min(y) | ||||
if ymax == None: ymax = numpy.max(y) | ||||
if minvalue == None: minvalue = 20. | ||||
if maxvalue == None: maxvalue = 90. | ||||
self.signalA = self.data[0] | ||||
self.signalB = self.data[1] | ||||
self.coherence = self.data[2] | ||||
self.phase = self.data[3] | ||||
self.xmin = xmin | ||||
self.xmax = xmax | ||||
self.minrange = ymin | ||||
self.maxrange = ymax | ||||
self.ymin = ymin | ||||
self.ymax = ymax | ||||
self.minvalue = minvalue | ||||
self.maxvalue = maxvalue | ||||
def changeXRange(self, *args): | ||||
pass | ||||
def createFrames(self): | ||||
self.frameObjList = [] | ||||
for frame in range(self.nframes): | ||||
frameObj = CrossSpcFrame(self.drvObj,frame + 1, self.colorbar, self.showprofile) | ||||
self.frameObjList.append(frameObj) | ||||
class CrossSpcFrame(Frame): | ||||
|
r158 | xi = None | ||
xw = None | ||||
yi = None | ||||
yw = None | ||||
alpha = None | ||||
|
r156 | def __init__(self): | ||
self.drvObj = drvObj | ||||
self.idframe = idframe | ||||
self.nplots = 4 | ||||
if showprofile: | ||||
self.nplots += 4 | ||||
self.colorbar = colorbar | ||||
self.showprofile = showprofile | ||||
|
r158 | self.xi = 0. | ||
self.xw = 0. | ||||
self.yi = 0. | ||||
self.yw = 0. | ||||
self.alpha = 1. | ||||
|
r156 | self.createPlots() | ||
def createPlots(self): | ||||
plotObjList = [] | ||||
idplot = 0 | ||||
counter_plot = 0 | ||||
for i in range(self.nplots): | ||||
xi, yi, xw, yw = self.getScreenPos(idplot) | ||||
plotObj = SpcPlot(self.drvObj, self.idframe, idplot, xi, yi, xw, yw, self.colorbar) | ||||
plotObjList.append(plotObj) | ||||
if self.showprofile: | ||||
|
r158 | xi, yi, xw, yw = self.getScreenPosGraph1(idplot) | ||
|
r156 | type = "pwbox" | ||
title = "" | ||||
xlabel = "dB" | ||||
ylabel = "" | ||||
idplot += 1 | ||||
plotObj = Plot1D(self.drvObj, self.idframe, idplot, xi, yi, xw, yw, type, title, xlabel, ylabel) | ||||
plotObjList.append(plotObj) | ||||
idplot += 1 | ||||
self.plotObjList = plotObjList | ||||
|
r158 | # def getScreenPos(self,idplot): | ||
# pass | ||||
|
r156 | |||
|
r158 | def getScreenPos(self, diplot): | ||
xi = self.xi | ||||
xw = self.xw | ||||
|
r156 | |||
if self.showprofile: | ||||
|
r158 | width = 0.55 | ||
xw += width | ||||
self.xi = 0.15 + idplot*self.alpha | ||||
if self.showprofile: | ||||
width = 0.55 | ||||
self.xw += width | ||||
|
r156 | |||
else: | ||||
|
r158 | width = 0.65 | ||
self.xw += width | ||||
|
r156 | |||
if self.colorbar: | ||||
|
r158 | self.xw = self.xw - 0.06 | ||
self.alpha = self.xw | ||||
|
r156 | |||
yi = 0.20; yw = 0.75 | ||||
return xi, yi, xw, yw | ||||
def getScreenPosGraph1(self): | ||||
if self.colorbar: | ||||
|
r158 | xi = self.xw + 0.08 | ||
|
r156 | else: | ||
|
r158 | xi = self.xw + 0.05 | ||
xw = xi + 0.2 | ||||
self.alpha = xw | ||||
if self.colorbar: | ||||
self.xi = 0.65 + 0.08 | ||||
else: | ||||
self.xi = 0.75 + 0.05 | ||||
|
r156 | |||
xw = xi + 0.2 | ||||
yi = 0.2; yw = 0.75 | ||||
return xi, yi, xw, yw | ||||
def plot(self,x, y, data): | ||||
plotObj = self.plotObjList[0] | ||||
plotObj.plot(x,y,data) | ||||
if self.showprofile: | ||||
plotObj = self.plotObjList[1] | ||||
avg_data = numpy.average(data, axis=0) | ||||
plotObj.plot(avg_data,y) | ||||
|
r141 | class SpcFigure(Figure): | ||
overplot = 0 | ||||
|
r156 | xw = 900 | ||
|
r141 | yw = 650 | ||
showprofile = False | ||||
def __init__(self, idfigure, nframes, wintitle, driver, colormap, colorbar, showprofile): | ||||
Figure.__init__(self,idfigure, nframes, wintitle, self.xw, self.yw, self.overplot, driver, colormap, colorbar) | ||||
self.showprofile = showprofile | ||||
def getSubplots(self): | ||||
ncolumns = int(numpy.sqrt(self.nframes)+0.9) | ||||
nrows = int(self.nframes*1./ncolumns + 0.9) | ||||
return nrows, ncolumns | ||||
def setParms(self, data, x, y, xmin, xmax, ymin, ymax, minvalue, maxvalue, *args): | ||||
if xmin == None: xmin = numpy.min(x) | ||||
if xmax == None: xmax = numpy.max(x) | ||||
if ymin == None: ymin = numpy.min(y) | ||||
if ymax == None: ymax = numpy.max(y) | ||||
if minvalue == None: minvalue = 20. | ||||
if maxvalue == None: maxvalue = 90. | ||||
self.xmin = xmin | ||||
self.xmax = xmax | ||||
self.minrange = ymin | ||||
self.maxrange = ymax | ||||
self.ymin = ymin | ||||
self.ymax = ymax | ||||
self.minvalue = minvalue | ||||
self.maxvalue = maxvalue | ||||
def changeXRange(self, *args): | ||||
pass | ||||
def createFrames(self): | ||||
|
r154 | |||
self.frameObjList = [] | ||||
|
r141 | for frame in range(self.nframes): | ||
frameObj = SpcFrame(self.drvObj,frame + 1, self.colorbar, self.showprofile) | ||||
self.frameObjList.append(frameObj) | ||||
class SpcFrame(Frame): | ||||
def __init__(self,drvObj,idframe,colorbar,showprofile): | ||||
self.drvObj = drvObj | ||||
self.idframe = idframe | ||||
self.nplots = 1 | ||||
if showprofile: | ||||
self.nplots += 1 | ||||
self.colorbar = colorbar | ||||
self.showprofile = showprofile | ||||
self.createPlots() | ||||
def createPlots(self): | ||||
plotObjList = [] | ||||
idplot = 0 | ||||
xi, yi, xw, yw = self.getScreenPos(idplot) | ||||
plotObj = SpcPlot(self.drvObj, self.idframe, idplot, xi, yi, xw, yw, self.colorbar) | ||||
plotObjList.append(plotObj) | ||||
if self.showprofile: | ||||
idplot = 1 | ||||
xi, yi, xw, yw = self.getScreenPos(idplot) | ||||
type = "pwbox" | ||||
title = "" | ||||
xlabel = "dB" | ||||
ylabel = "" | ||||
|
r158 | szchar = 0.70 | ||
plotObj = Plot1D(self.drvObj, self.idframe, idplot, xi, yi, xw, yw, type, title, xlabel, ylabel, szchar) | ||||
|
r141 | plotObjList.append(plotObj) | ||
self.plotObjList = plotObjList | ||||
def getScreenPosMainPlot(self): | ||||
|
r161 | |||
xi = 0.10 | ||||
|
r141 | |||
if self.showprofile: | ||||
|
r161 | xw = 0.62 | ||
|
r141 | |||
else: | ||||
|
r161 | xw = 0.9 | ||
|
r141 | |||
if self.colorbar: | ||||
xw = xw - 0.06 | ||||
|
r161 | yi = 0.1; yw = 0.87 | ||
|
r141 | |||
return xi, yi, xw, yw | ||||
def getScreenPosGraph1(self): | ||||
|
r161 | |||
|
r141 | if self.colorbar: | ||
xi = 0.65 + 0.08 | ||||
else: | ||||
xi = 0.75 + 0.05 | ||||
xw = xi + 0.2 | ||||
|
r161 | yi = 0.1; yw = 0.87 | ||
|
r141 | |||
return xi, yi, xw, yw | ||||
def plot(self,x, y, data): | ||||
plotObj = self.plotObjList[0] | ||||
plotObj.plot(x,y,data) | ||||
if self.showprofile: | ||||
plotObj = self.plotObjList[1] | ||||
|
r156 | avg_data = numpy.average(data, axis=0) | ||
plotObj.plot(avg_data,y) | ||||
|
r141 | |||
class SpcPlot(Plot): | ||||
getGrid = True | ||||
def __init__(self, drvObj, idframe, idplot, xi, yi, xw, yw, colorbar): | ||||
self.drvObj = drvObj | ||||
self.idframe = idframe | ||||
self.idplot = idplot | ||||
self.xi = xi | ||||
self.yi = yi | ||||
self.xw = xw | ||||
self.yw = yw | ||||
self.colorbar = colorbar | ||||
if self.colorbar: | ||||
cbxi = xw + 0.03 | ||||
cbxw = cbxi + 0.03 | ||||
cbyi = yi | ||||
cbyw = yw | ||||
self.cbxpos = [cbxi,cbxw] | ||||
self.cbypos = [cbyi,cbyw] | ||||
self.xpos = [self.xi,self.xw] | ||||
self.ypos = [self.yi,self.yw] | ||||
self.xaxisastime = False | ||||
self.timefmt = None | ||||
self.xopt = "bcnst" | ||||
self.yopt = "bcnstv" | ||||
|
r156 | self.szchar = 0.7 | ||
|
r141 | self.strforchannel = "Channel %d"%self.idframe | ||
self.xlabel = "m/s" | ||||
self.ylabel = "Range (Km)" | ||||
def setBox(self, xmin, xmax, ymin, ymax, minvalue, maxvalue, *args): | ||||
self.xmin = xmin | ||||
self.xmax = xmax | ||||
self.ymin = ymin | ||||
self.ymax = ymax | ||||
self.minvalue = minvalue | ||||
self.maxvalue = maxvalue | ||||
self.colorbar = args[2] | ||||
self.title = "%s - %s"%(self.strforchannel,args[3]) | ||||
def plot(self, x, y, data): | ||||
z = data | ||||
deltax = None | ||||
deltay = None | ||||
self.plotPcolor(x, y, z, deltax, deltay, self.getGrid) | ||||
self.getGrid = False | ||||
|
r133 | |||
|
r138 | |||
|
r139 | class RTIFigure(Figure): | ||
|
r138 | overplot = 1 | ||
xw = 700 | ||||
yw = 650 | ||||
showprofile = False | ||||
starttime = None | ||||
endtime = None | ||||
minrange = None | ||||
maxrange = None | ||||
minvalue = None | ||||
maxvalue = None | ||||
|
r139 | xrangestepinsecs = None | ||
|
r158 | timefmt=None | ||
|
r138 | |||
|
r141 | def __init__(self, idfigure, nframes, wintitle, driver, colormap="br_green", colorbar= True, showprofile=False): | ||
Figure.__init__(self,idfigure, nframes, wintitle, self.xw, self.yw, self.overplot, driver, colormap, colorbar) | ||||
|
r138 | self.showprofile = showprofile | ||
|
r141 | |||
|
r138 | def getSubplots(self): | ||
nrows = self.nframes | ||||
ncolumns = 1 | ||||
return nrows, ncolumns | ||||
|
r150 | def setParms(self, data, x, y, xmin, xmax, ymin, ymax, minvalue, maxvalue, xrangestep, deltax): | ||
|
r138 | |||
self.starttime = xmin | ||||
self.endtime = xmax | ||||
|
r141 | cdatetime = datetime.datetime.utcfromtimestamp(x) | ||
|
r139 | |||
mindatetime = datetime.datetime(cdatetime.year,cdatetime.month,cdatetime.day,self.starttime.hour,self.starttime.minute,self.starttime.second) | ||||
|
r158 | |||
maxdatetime = mindatetime + datetime.timedelta(seconds=xrangestep) | ||||
self.xrangestepinsecs = xrangestep | ||||
|
r139 | |||
xmin = time.mktime(mindatetime.timetuple()) | ||||
xmax = time.mktime(maxdatetime.timetuple()) | ||||
|
r158 | if self.xrangestepinsecs<=60.: | ||
self.timefmt="%H:%M:%S" | ||||
if self.xrangestepinsecs>0. and self.xrangestepinsecs<=1200.: | ||||
self.timefmt="%H:%M:%S" | ||||
if self.xrangestepinsecs>1200. and self.xrangestepinsecs<=86400.: | ||||
self.timefmt="%H:%M" | ||||
|
r138 | |||
|
r158 | if self.xrangestepinsecs>86400.: | ||
self.timefmt="%y:%m:%d:%H" | ||||
|
r138 | |||
|
r139 | if ymin == None: ymin = numpy.min(y) | ||
if ymax == None: ymax = numpy.max(y) | ||||
|
r138 | |||
|
r139 | if minvalue == None: minvalue = 0. | ||
if maxvalue == None: maxvalue = 50. | ||||
|
r138 | |||
|
r139 | self.xmin = xmin | ||
self.xmax = xmax | ||||
self.minrange = ymin | ||||
self.maxrange = ymax | ||||
self.ymin = ymin | ||||
self.ymax = ymax | ||||
|
r138 | self.minvalue = minvalue | ||
self.maxvalue = maxvalue | ||||
|
r139 | self.xrangestep = xrangestep | ||
self.deltax = deltax | ||||
|
r141 | |||
|
r139 | def changeXRange(self,x): | ||
|
r141 | cdatetime = datetime.datetime.utcfromtimestamp(x) | ||
|
r139 | |||
if ((cdatetime.time()>=self.starttime) and (cdatetime.time()<self.endtime)): | ||||
|
r158 | |||
mindatetime = datetime.datetime(cdatetime.year,cdatetime.month,cdatetime.day,cdatetime.hour,cdatetime.minute,cdatetime.second) | ||||
|
r138 | |||
|
r139 | self.xmin = time.mktime(mindatetime.timetuple()) - time.timezone | ||
self.xmax = self.xmin + self.xrangestepinsecs | ||||
|
r141 | self.figuretitle = "%s %s : %s"%(self.figuretitle, | ||
|
r139 | datetime.datetime.utcfromtimestamp(self.xmin).strftime("%d-%b-%Y %H:%M:%S"), | ||
datetime.datetime.utcfromtimestamp(self.xmax).strftime("%d-%b-%Y %H:%M:%S")) | ||||
return 1 | ||||
return 0 | ||||
|
r138 | |||
def createFrames(self): | ||||
|
r154 | |||
self.frameObjList = [] | ||||
|
r138 | for frame in range(self.nframes): | ||
|
r158 | frameObj = RTIFrame(self.drvObj,frame + 1, self.colorbar, self.showprofile, self.timefmt) | ||
|
r138 | self.frameObjList.append(frameObj) | ||
class RTIFrame(Frame): | ||||
|
r158 | def __init__(self,drvObj,idframe,colorbar,showprofile, timefmt): | ||
|
r138 | self.drvObj = drvObj | ||
self.idframe = idframe | ||||
self.nplots = 1 | ||||
|
r139 | if showprofile: | ||
|
r138 | self.nplots += 1 | ||
self.colorbar = colorbar | ||||
self.showprofile = showprofile | ||||
|
r158 | self.timefmt = timefmt | ||
|
r138 | self.createPlots() | ||
def createPlots(self): | ||||
plotObjList = [] | ||||
idplot = 0 | ||||
xi, yi, xw, yw = self.getScreenPos(idplot) | ||||
|
r141 | |||
|
r158 | plotObj = RTIPlot(self.drvObj, self.idframe, idplot, xi, yi, xw, yw, self.colorbar, self.timefmt) | ||
|
r138 | plotObjList.append(plotObj) | ||
if self.showprofile: | ||||
idplot = 1 | ||||
xi, yi, xw, yw = self.getScreenPos(idplot) | ||||
|
r141 | type = "pwbox" | ||
title = "" | ||||
xlabel = "dB" | ||||
ylabel = "" | ||||
|
r158 | szchar = 0.75 | ||
plotObj = Plot1D(self.drvObj, self.idframe, idplot, xi, yi, xw, yw, type, title, xlabel, ylabel, szchar) | ||||
|
r138 | plotObjList.append(plotObj) | ||
self.plotObjList = plotObjList | ||||
|
r141 | def getScreenPosMainPlot(self): | ||
|
r138 | xi = 0.07 | ||
if self.showprofile: | ||||
xw = 0.65 | ||||
else: | ||||
xw = 0.9 | ||||
if self.colorbar: | ||||
xw = xw - 0.06 | ||||
yi = 0.20; yw = 0.75 | ||||
return xi, yi, xw, yw | ||||
def getScreenPosGraph1(self): | ||||
if self.colorbar: | ||||
|
r141 | xi = 0.65 + 0.08 | ||
|
r138 | else: | ||
xi = 0.9 + 0.05 | ||||
xw = xi + 0.2 | ||||
yi = 0.2; yw = 0.75 | ||||
return xi, yi, xw, yw | ||||
|
r139 | def plot(self, currenttime, range, data): | ||
plotObj = self.plotObjList[0] | ||||
plotObj.plot(currenttime,range,data) | ||||
if self.showprofile: | ||||
plotObj = self.plotObjList[1] | ||||
plotObj.plot(data,range) | ||||
|
r138 | |||
|
r139 | class RTIPlot(Plot): | ||
deltax = None | ||||
deltay = None | ||||
xrange = [None,None] | ||||
xminpos = None | ||||
xmaxpos = None | ||||
xg = None | ||||
yg = None | ||||
|
r158 | def __init__(self,drvObj, idframe, idplot, xi, yi, xw, yw, colorbar, timefmt): | ||
|
r138 | self.drvObj = drvObj | ||
self.idframe = idframe | ||||
self.idplot = idplot | ||||
self.xi = xi | ||||
self.yi = yi | ||||
self.xw = xw | ||||
self.yw = yw | ||||
|
r139 | self.colorbar = colorbar | ||
|
r138 | |||
if self.colorbar: | ||||
cbxi = xw + 0.03 | ||||
cbxw = cbxi + 0.03 | ||||
cbyi = yi | ||||
cbyw = yw | ||||
self.cbxpos = [cbxi,cbxw] | ||||
self.cbypos = [cbyi,cbyw] | ||||
self.xpos = [self.xi,self.xw] | ||||
self.ypos = [self.yi,self.yw] | ||||
self.xaxisastime = True | ||||
|
r158 | self.timefmt = timefmt | ||
|
r138 | self.xopt = "bcnstd" | ||
self.yopt = "bcnstv" | ||||
self.szchar = 1.0 | ||||
self.title = "Channel %d"%self.idframe | ||||
|
r139 | self.xlabel = "Local Time" | ||
self.ylabel = "Range (Km)" | ||||
|
r138 | |||
|
r141 | def setBox(self, xmin, xmax, ymin, ymax, minvalue, maxvalue, deltax=None, deltay=None, colorbar=True, *args): | ||
|
r138 | self.xmin = xmin | ||
self.xmax = xmax | ||||
self.ymin = ymin | ||||
self.ymax = ymax | ||||
self.minvalue = minvalue | ||||
self.maxvalue = maxvalue | ||||
|
r139 | self.deltax = deltax | ||
self.deltay = deltay | ||||
|
r141 | self.colorbar = colorbar | ||
|
r139 | |||
def plot(self, currenttime, range, data): | ||||
if self.xmaxpos == None: | ||||
self.xmaxpos = currenttime | ||||
|
r150 | # if currenttime >= self.xmaxpos: | ||
|
r139 | |||
|
r150 | self.xminpos = currenttime | ||
self.xmaxpos = currenttime + self.deltax | ||||
x = [currenttime] | ||||
y = range | ||||
z = numpy.reshape(data, (1,-1)) | ||||
getGrid = True | ||||
self.plotPcolor(x, y, z, self.deltax, self.deltay, getGrid) | ||||
|
r139 | |||
|
r138 | |||
|
r133 | class ScopeFigure(Figure): | ||
overplot = 0 | ||||
xw = 700 | ||||
|
r135 | yw = 650 | ||
colorbar = None | ||||
|
r133 | |||
|
r134 | def __init__(self,idfigure,nframes,wintitle,driver): | ||
colormap = None | ||||
|
r135 | colorbar = False | ||
|
r133 | |||
|
r142 | Figure.__init__(self,idfigure, nframes, wintitle, self.xw, self.yw, self.overplot, driver, colormap, colorbar) | ||
|
r133 | |||
def getSubplots(self): | ||||
nrows = self.nframes | ||||
ncolumns = 1 | ||||
return nrows, ncolumns | ||||
|
r135 | |||
def createFrames(self): | ||||
|
r154 | |||
self.frameObjList = [] | ||||
|
r133 | for frame in range(self.nframes): | ||
|
r135 | frameObj = ScopeFrame(self.drvObj,frame + 1) | ||
|
r133 | self.frameObjList.append(frameObj) | ||
|
r135 | |||
|
r133 | |||
|
r135 | class ScopeFrame(Frame): | ||
xlabel = "" | ||||
ylabel = "" | ||||
title = "" | ||||
|
r158 | szchar = 1.1 | ||
|
r135 | def __init__(self,drvObj,idframe): | ||
self.drvObj = drvObj | ||||
self.idframe = idframe | ||||
|
r158 | self.nplots = 1 | ||
|
r135 | self.createPlots() | ||
# Frame.__init__(self, drvObj, idframe) | ||||
|
r133 | |||
|
r135 | def getScreenPosMainPlot(self):#cada Frame determina las coordenadas de los plots | ||
|
r150 | xi = 0.08; xw = 0.9 | ||
|
r135 | yi = 0.20; yw = 0.75 | ||
return xi,yi,xw,yw | ||||
|
r133 | |||
|
r135 | def createPlots(self): | ||
plotObjList = [] | ||||
for idplot in range(self.nplots): | ||||
xi, yi, xw, yw = self.getScreenPos(idplot) | ||||
|
r141 | type = "scopebox" | ||
title = "Channel %d"%self.idframe | ||||
xlabel = "range (Km)" | ||||
ylabel = "intensity" | ||||
|
r158 | plotObj = Plot1D(self.drvObj, self.idframe, idplot, xi, yi, xw, yw, type, title, xlabel, ylabel, self.szchar) | ||
|
r135 | plotObjList.append(plotObj) | ||
|
r158 | |||
|
r135 | self.plotObjList = plotObjList | ||
|
r158 | |||
|
r133 | |||
|
r135 | def plot(self, x, y, z=None): | ||
for plotObj in self.plotObjList: | ||||
plotObj.plot(x, y) | ||||
|
r133 | |||
|
r135 | class Plot1D(Plot): | ||
|
r141 | # type, title, xlabel, ylabel | ||
|
r158 | def __init__(self, drvObj, idframe, idplot, xi, yi, xw, yw, type, title, xlabel, ylabel, szchar): | ||
|
r135 | self.drvObj = drvObj | ||
self.idframe = idframe | ||||
self.idplot = idplot | ||||
self.xi = xi | ||||
self.yi = yi | ||||
self.xw = xw | ||||
self.yw = yw | ||||
self.xpos = [self.xi,self.xw] | ||||
self.ypos = [self.yi,self.yw] | ||||
self.xaxisastime = False | ||||
self.timefmt = None | ||||
self.xopt = "bcnst" | ||||
self.yopt = "bcnstv" | ||||
|
r158 | self.szchar = szchar | ||
|
r141 | self.type = type | ||
self.title = title | ||||
self.xlabel = xlabel | ||||
self.ylabel = ylabel | ||||
|
r133 | |||
|
r141 | |||
def setBox(self, xmin, xmax, ymin, ymax, minvalue, maxvalue, *args): | ||||
if self.type == "pwbox": | ||||
self.xmin = minvalue | ||||
self.xmax = maxvalue | ||||
self.ymin = ymin | ||||
self.ymax = ymax | ||||
self.minvalue = minvalue | ||||
self.maxvalue = maxvalue | ||||
|
r161 | self.xopt = "bcnstg" | ||
self.yopt = "bcmstv" | ||||
|
r141 | |||
else: | ||||
self.xmin = xmin | ||||
self.xmax = xmax | ||||
self.ymin = ymin | ||||
self.ymax = ymax | ||||
self.minvalue = minvalue | ||||
self.maxvalue = maxvalue | ||||
self.colorbar = False | ||||
|
r134 | |||
|
r135 | def plot(self,x,y): | ||
if y.dtype == "complex128": | ||||
color="blue" | ||||
self.plotBasicLine(x, y.real, color) | ||||
color="red" | ||||
self.plotBasicLine(x, y.imag, color) | ||||
else: | ||||
color="blue" | ||||
self.plotBasicLine(x, y, color) | ||||