@@ -8,13 +8,14 import os | |||
|
8 | 8 | import sys |
|
9 | 9 | import numpy |
|
10 | 10 | import datetime |
|
11 | import time | |
|
11 | 12 | |
|
12 | 13 | path = os.path.split(os.getcwd())[0] |
|
13 | 14 | sys.path.append(path) |
|
14 | 15 | |
|
15 | 16 | from Data.JROData import Voltage |
|
16 | 17 | from IO.VoltageIO import VoltageWriter |
|
17 |
from Graphics |
|
|
18 | from Graphics.schainPlotTypes import ScopeFigure, RTIFigure | |
|
18 | 19 | |
|
19 | 20 | class VoltageProcessor: |
|
20 | 21 | |
@@ -52,7 +53,73 class VoltageProcessor: | |||
|
52 | 53 | self.dataOutObj.copy(self.dataInObj) |
|
53 | 54 | # No necesita copiar en cada init() los atributos de dataInObj |
|
54 | 55 | # la copia deberia hacerse por cada nuevo bloque de datos |
|
55 | ||
|
56 | ||
|
57 | def addRti(self, idfigure, nframes, wintitle, driver, colorbar, colormap, showprofile): | |
|
58 | rtiObj = RTIFigure(idfigure, nframes, wintitle, driver, colorbar, colormap, showprofile) | |
|
59 | self.plotObjList.append(rtiObj) | |
|
60 | ||
|
61 | def plotRti(self, idfigure=None, | |
|
62 | starttime=None, | |
|
63 | endtime=None, | |
|
64 | rangemin=None, | |
|
65 | rangemax=None, | |
|
66 | minvalue=None, | |
|
67 | maxvalue=None, | |
|
68 | wintitle='', | |
|
69 | driver='plplot', | |
|
70 | colormap='br_greeen', | |
|
71 | colorbar=True, | |
|
72 | showprofile=False, | |
|
73 | xrangestep=None, | |
|
74 | save=False, | |
|
75 | gpath=None): | |
|
76 | ||
|
77 | if self.dataOutObj.flagNoData: | |
|
78 | return 0 | |
|
79 | ||
|
80 | nframes = len(self.dataOutObj.channelList) | |
|
81 | ||
|
82 | if len(self.plotObjList) <= self.plotObjIndex: | |
|
83 | self.addRti(idfigure, nframes, wintitle, driver, colormap, colorbar, showprofile) | |
|
84 | ||
|
85 | data = self.dataOutObj.data * numpy.conjugate(self.dataOutObj.data) | |
|
86 | data = 10*numpy.log10(data.real) | |
|
87 | ||
|
88 | # currenttime = self.dataOutObj.dataUtcTime | |
|
89 | # if timezone == "lt": | |
|
90 | currenttime = self.dataOutObj.dataUtcTime - time.timezone | |
|
91 | ||
|
92 | ||
|
93 | ||
|
94 | range = self.dataOutObj.heightList | |
|
95 | ||
|
96 | channelList = self.dataOutObj.channelList | |
|
97 | ||
|
98 | thisdatetime = datetime.datetime.fromtimestamp(self.dataOutObj.dataUtcTime) | |
|
99 | dateTime = "%s"%(thisdatetime.strftime("%d-%b-%Y %H:%M:%S")) | |
|
100 | date = "%s"%(thisdatetime.strftime("%d-%b-%Y")) | |
|
101 | ||
|
102 | figuretitle = "RTI Plot Radar Data" #+ date | |
|
103 | ||
|
104 | plotObj = self.plotObjList[self.plotObjIndex] | |
|
105 | ||
|
106 | plotObj.plotPcolor(data, | |
|
107 | currenttime, | |
|
108 | range, | |
|
109 | channelList, | |
|
110 | starttime, | |
|
111 | endtime, | |
|
112 | rangemin, | |
|
113 | rangemax, | |
|
114 | minvalue, | |
|
115 | maxvalue, | |
|
116 | figuretitle, | |
|
117 | xrangestep, | |
|
118 | save, | |
|
119 | gpath) | |
|
120 | ||
|
121 | self.plotObjIndex += 1 | |
|
122 | ||
|
56 | 123 | def addScope(self, idfigure, nframes, wintitle, driver): |
|
57 | 124 | if idfigure==None: |
|
58 | 125 | idfigure = self.plotObjIndex |
General Comments 0
You need to be logged in to leave comments.
Login now