@@ -1,2077 +1,2177 | |||||
1 | import os |
|
1 | import os | |
2 | import datetime |
|
2 | import datetime | |
3 | import numpy |
|
3 | import numpy | |
4 | import inspect |
|
4 | import inspect | |
5 | from figure import Figure, isRealtime, isTimeInHourRange |
|
5 | from figure import Figure, isRealtime, isTimeInHourRange | |
6 | from plotting_codes import * |
|
6 | from plotting_codes import * | |
7 |
|
7 | |||
8 |
|
8 | |||
9 | class MomentsPlot(Figure): |
|
9 | class MomentsPlot(Figure): | |
10 |
|
10 | |||
11 | isConfig = None |
|
11 | isConfig = None | |
12 | __nsubplots = None |
|
12 | __nsubplots = None | |
13 |
|
13 | |||
14 | WIDTHPROF = None |
|
14 | WIDTHPROF = None | |
15 | HEIGHTPROF = None |
|
15 | HEIGHTPROF = None | |
16 | PREFIX = 'prm' |
|
16 | PREFIX = 'prm' | |
17 |
|
17 | |||
18 | parameters = { |
|
18 | parameters = { | |
19 | 'id': global_type_string, |
|
19 | 'id': global_type_string, | |
20 | 'wintitle': global_type_string, |
|
20 | 'wintitle': global_type_string, | |
21 | 'channelList': global_type_list, |
|
21 | 'channelList': global_type_list, | |
22 | 'showprofile': global_type_boolean, |
|
22 | 'showprofile': global_type_boolean, | |
23 | 'xmin': global_type_float, |
|
23 | 'xmin': global_type_float, | |
24 | 'xmax': global_type_float, |
|
24 | 'xmax': global_type_float, | |
25 | 'ymin': global_type_float, |
|
25 | 'ymin': global_type_float, | |
26 | 'ymax': global_type_float, |
|
26 | 'ymax': global_type_float, | |
27 | 'zmin': global_type_float, |
|
27 | 'zmin': global_type_float, | |
28 | 'zmax': global_type_float, |
|
28 | 'zmax': global_type_float, | |
29 | 'save': global_type_boolean, |
|
29 | 'save': global_type_boolean, | |
30 | 'figpath': global_type_string, |
|
30 | 'figpath': global_type_string, | |
31 | 'figfile': global_type_string, |
|
31 | 'figfile': global_type_string, | |
32 | 'show': global_type_boolean, |
|
32 | 'show': global_type_boolean, | |
33 | 'ftp': global_type_boolean, |
|
33 | 'ftp': global_type_boolean, | |
34 | 'wr_period': global_type_integer, |
|
34 | 'wr_period': global_type_integer, | |
35 | 'server': global_type_string, |
|
35 | 'server': global_type_string, | |
36 | 'folder': global_type_string, |
|
36 | 'folder': global_type_string, | |
37 | 'username': global_type_string, |
|
37 | 'username': global_type_string, | |
38 | 'password': global_type_string, |
|
38 | 'password': global_type_string, | |
39 | 'ftp_wei': global_type_string, |
|
39 | 'ftp_wei': global_type_string, | |
40 | 'exp_code': global_type_integer, |
|
40 | 'exp_code': global_type_integer, | |
41 | 'sub_exp_code': global_type_integer, |
|
41 | 'sub_exp_code': global_type_integer, | |
42 | 'plot_pos': global_type_integer, |
|
42 | 'plot_pos': global_type_integer, | |
43 | 'realtime': global_type_boolean, |
|
43 | 'realtime': global_type_boolean, | |
44 | } |
|
44 | } | |
45 |
|
45 | |||
46 | def __init__(self, **kwargs): |
|
46 | def __init__(self, **kwargs): | |
47 | Figure.__init__(self, **kwargs) |
|
47 | Figure.__init__(self, **kwargs) | |
48 | self.isConfig = False |
|
48 | self.isConfig = False | |
49 | self.__nsubplots = 1 |
|
49 | self.__nsubplots = 1 | |
50 |
|
50 | |||
51 | self.WIDTH = 280 |
|
51 | self.WIDTH = 280 | |
52 | self.HEIGHT = 250 |
|
52 | self.HEIGHT = 250 | |
53 | self.WIDTHPROF = 120 |
|
53 | self.WIDTHPROF = 120 | |
54 | self.HEIGHTPROF = 0 |
|
54 | self.HEIGHTPROF = 0 | |
55 | self.counter_imagwr = 0 |
|
55 | self.counter_imagwr = 0 | |
56 |
|
56 | |||
57 | self.PLOT_CODE = MOMENTS_CODE |
|
57 | self.PLOT_CODE = MOMENTS_CODE | |
58 |
|
58 | |||
59 | self.FTP_WEI = None |
|
59 | self.FTP_WEI = None | |
60 | self.EXP_CODE = None |
|
60 | self.EXP_CODE = None | |
61 | self.SUB_EXP_CODE = None |
|
61 | self.SUB_EXP_CODE = None | |
62 | self.PLOT_POS = None |
|
62 | self.PLOT_POS = None | |
63 |
|
63 | |||
64 | def getSubplots(self): |
|
64 | def getSubplots(self): | |
65 |
|
65 | |||
66 | ncol = int(numpy.sqrt(self.nplots)+0.9) |
|
66 | ncol = int(numpy.sqrt(self.nplots)+0.9) | |
67 | nrow = int(self.nplots*1./ncol + 0.9) |
|
67 | nrow = int(self.nplots*1./ncol + 0.9) | |
68 |
|
68 | |||
69 | return nrow, ncol |
|
69 | return nrow, ncol | |
70 |
|
70 | |||
71 | def setup(self, id, nplots, wintitle, showprofile=True, show=True): |
|
71 | def setup(self, id, nplots, wintitle, showprofile=True, show=True): | |
72 |
|
72 | |||
73 | self.__showprofile = showprofile |
|
73 | self.__showprofile = showprofile | |
74 | self.nplots = nplots |
|
74 | self.nplots = nplots | |
75 |
|
75 | |||
76 | ncolspan = 1 |
|
76 | ncolspan = 1 | |
77 | colspan = 1 |
|
77 | colspan = 1 | |
78 | if showprofile: |
|
78 | if showprofile: | |
79 | ncolspan = 3 |
|
79 | ncolspan = 3 | |
80 | colspan = 2 |
|
80 | colspan = 2 | |
81 | self.__nsubplots = 2 |
|
81 | self.__nsubplots = 2 | |
82 |
|
82 | |||
83 | self.createFigure(id = id, |
|
83 | self.createFigure(id = id, | |
84 | wintitle = wintitle, |
|
84 | wintitle = wintitle, | |
85 | widthplot = self.WIDTH + self.WIDTHPROF, |
|
85 | widthplot = self.WIDTH + self.WIDTHPROF, | |
86 | heightplot = self.HEIGHT + self.HEIGHTPROF, |
|
86 | heightplot = self.HEIGHT + self.HEIGHTPROF, | |
87 | show=show) |
|
87 | show=show) | |
88 |
|
88 | |||
89 | nrow, ncol = self.getSubplots() |
|
89 | nrow, ncol = self.getSubplots() | |
90 |
|
90 | |||
91 | counter = 0 |
|
91 | counter = 0 | |
92 | for y in range(nrow): |
|
92 | for y in range(nrow): | |
93 | for x in range(ncol): |
|
93 | for x in range(ncol): | |
94 |
|
94 | |||
95 | if counter >= self.nplots: |
|
95 | if counter >= self.nplots: | |
96 | break |
|
96 | break | |
97 |
|
97 | |||
98 | self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan, colspan, 1) |
|
98 | self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan, colspan, 1) | |
99 |
|
99 | |||
100 | if showprofile: |
|
100 | if showprofile: | |
101 | self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan+colspan, 1, 1) |
|
101 | self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan+colspan, 1, 1) | |
102 |
|
102 | |||
103 | counter += 1 |
|
103 | counter += 1 | |
104 |
|
104 | |||
105 | def run(self, dataOut, id, wintitle="", channelList=None, showprofile=True, |
|
105 | def run(self, dataOut, id, wintitle="", channelList=None, showprofile=True, | |
106 | xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None, |
|
106 | xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None, | |
107 | save=False, figpath='./', figfile=None, show=True, ftp=False, wr_period=1, |
|
107 | save=False, figpath='./', figfile=None, show=True, ftp=False, wr_period=1, | |
108 | server=None, folder=None, username=None, password=None, |
|
108 | server=None, folder=None, username=None, password=None, | |
109 | ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0, realtime=False): |
|
109 | ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0, realtime=False): | |
110 |
|
110 | |||
111 | """ |
|
111 | """ | |
112 |
|
112 | |||
113 | Input: |
|
113 | Input: | |
114 | dataOut : |
|
114 | dataOut : | |
115 | id : |
|
115 | id : | |
116 | wintitle : |
|
116 | wintitle : | |
117 | channelList : |
|
117 | channelList : | |
118 | showProfile : |
|
118 | showProfile : | |
119 | xmin : None, |
|
119 | xmin : None, | |
120 | xmax : None, |
|
120 | xmax : None, | |
121 | ymin : None, |
|
121 | ymin : None, | |
122 | ymax : None, |
|
122 | ymax : None, | |
123 | zmin : None, |
|
123 | zmin : None, | |
124 | zmax : None |
|
124 | zmax : None | |
125 | """ |
|
125 | """ | |
126 |
|
126 | |||
127 | if dataOut.flagNoData: |
|
127 | if dataOut.flagNoData: | |
128 | return None |
|
128 | return None | |
129 |
|
129 | |||
130 | if realtime: |
|
130 | if realtime: | |
131 | if not(isRealtime(utcdatatime = dataOut.utctime)): |
|
131 | if not(isRealtime(utcdatatime = dataOut.utctime)): | |
132 | print 'Skipping this plot function' |
|
132 | print 'Skipping this plot function' | |
133 | return |
|
133 | return | |
134 |
|
134 | |||
135 | if channelList == None: |
|
135 | if channelList == None: | |
136 | channelIndexList = dataOut.channelIndexList |
|
136 | channelIndexList = dataOut.channelIndexList | |
137 | else: |
|
137 | else: | |
138 | channelIndexList = [] |
|
138 | channelIndexList = [] | |
139 | for channel in channelList: |
|
139 | for channel in channelList: | |
140 | if channel not in dataOut.channelList: |
|
140 | if channel not in dataOut.channelList: | |
141 | raise ValueError, "Channel %d is not in dataOut.channelList" |
|
141 | raise ValueError, "Channel %d is not in dataOut.channelList" | |
142 | channelIndexList.append(dataOut.channelList.index(channel)) |
|
142 | channelIndexList.append(dataOut.channelList.index(channel)) | |
143 |
|
143 | |||
144 | factor = dataOut.normFactor |
|
144 | factor = dataOut.normFactor | |
145 | x = dataOut.abscissaList |
|
145 | x = dataOut.abscissaList | |
146 | y = dataOut.heightList |
|
146 | y = dataOut.heightList | |
147 |
|
147 | |||
148 | z = dataOut.data_pre[channelIndexList,:,:]/factor |
|
148 | z = dataOut.data_pre[channelIndexList,:,:]/factor | |
149 | z = numpy.where(numpy.isfinite(z), z, numpy.NAN) |
|
149 | z = numpy.where(numpy.isfinite(z), z, numpy.NAN) | |
150 | avg = numpy.average(z, axis=1) |
|
150 | avg = numpy.average(z, axis=1) | |
151 | noise = dataOut.noise/factor |
|
151 | noise = dataOut.noise/factor | |
152 |
|
152 | |||
153 | zdB = 10*numpy.log10(z) |
|
153 | zdB = 10*numpy.log10(z) | |
154 | avgdB = 10*numpy.log10(avg) |
|
154 | avgdB = 10*numpy.log10(avg) | |
155 | noisedB = 10*numpy.log10(noise) |
|
155 | noisedB = 10*numpy.log10(noise) | |
156 |
|
156 | |||
157 | #thisDatetime = dataOut.datatime |
|
157 | #thisDatetime = dataOut.datatime | |
158 | thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.getTimeRange()[0]) |
|
158 | thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.getTimeRange()[0]) | |
159 | title = wintitle + " Parameters" |
|
159 | title = wintitle + " Parameters" | |
160 | xlabel = "Velocity (m/s)" |
|
160 | xlabel = "Velocity (m/s)" | |
161 | ylabel = "Range (Km)" |
|
161 | ylabel = "Range (Km)" | |
162 |
|
162 | |||
163 | update_figfile = False |
|
163 | update_figfile = False | |
164 |
|
164 | |||
165 | if not self.isConfig: |
|
165 | if not self.isConfig: | |
166 |
|
166 | |||
167 | nplots = len(channelIndexList) |
|
167 | nplots = len(channelIndexList) | |
168 |
|
168 | |||
169 | self.setup(id=id, |
|
169 | self.setup(id=id, | |
170 | nplots=nplots, |
|
170 | nplots=nplots, | |
171 | wintitle=wintitle, |
|
171 | wintitle=wintitle, | |
172 | showprofile=showprofile, |
|
172 | showprofile=showprofile, | |
173 | show=show) |
|
173 | show=show) | |
174 |
|
174 | |||
175 | if xmin == None: xmin = numpy.nanmin(x) |
|
175 | if xmin == None: xmin = numpy.nanmin(x) | |
176 | if xmax == None: xmax = numpy.nanmax(x) |
|
176 | if xmax == None: xmax = numpy.nanmax(x) | |
177 | if ymin == None: ymin = numpy.nanmin(y) |
|
177 | if ymin == None: ymin = numpy.nanmin(y) | |
178 | if ymax == None: ymax = numpy.nanmax(y) |
|
178 | if ymax == None: ymax = numpy.nanmax(y) | |
179 | if zmin == None: zmin = numpy.nanmin(avgdB)*0.9 |
|
179 | if zmin == None: zmin = numpy.nanmin(avgdB)*0.9 | |
180 | if zmax == None: zmax = numpy.nanmax(avgdB)*0.9 |
|
180 | if zmax == None: zmax = numpy.nanmax(avgdB)*0.9 | |
181 |
|
181 | |||
182 | self.FTP_WEI = ftp_wei |
|
182 | self.FTP_WEI = ftp_wei | |
183 | self.EXP_CODE = exp_code |
|
183 | self.EXP_CODE = exp_code | |
184 | self.SUB_EXP_CODE = sub_exp_code |
|
184 | self.SUB_EXP_CODE = sub_exp_code | |
185 | self.PLOT_POS = plot_pos |
|
185 | self.PLOT_POS = plot_pos | |
186 |
|
186 | |||
187 | self.isConfig = True |
|
187 | self.isConfig = True | |
188 | update_figfile = True |
|
188 | update_figfile = True | |
189 |
|
189 | |||
190 | self.setWinTitle(title) |
|
190 | self.setWinTitle(title) | |
191 |
|
191 | |||
192 | for i in range(self.nplots): |
|
192 | for i in range(self.nplots): | |
193 | str_datetime = '%s %s'%(thisDatetime.strftime("%Y/%m/%d"),thisDatetime.strftime("%H:%M:%S")) |
|
193 | str_datetime = '%s %s'%(thisDatetime.strftime("%Y/%m/%d"),thisDatetime.strftime("%H:%M:%S")) | |
194 | title = "Channel %d: %4.2fdB: %s" %(dataOut.channelList[i], noisedB[i], str_datetime) |
|
194 | title = "Channel %d: %4.2fdB: %s" %(dataOut.channelList[i], noisedB[i], str_datetime) | |
195 | axes = self.axesList[i*self.__nsubplots] |
|
195 | axes = self.axesList[i*self.__nsubplots] | |
196 | axes.pcolor(x, y, zdB[i,:,:], |
|
196 | axes.pcolor(x, y, zdB[i,:,:], | |
197 | xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, zmin=zmin, zmax=zmax, |
|
197 | xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, zmin=zmin, zmax=zmax, | |
198 | xlabel=xlabel, ylabel=ylabel, title=title, |
|
198 | xlabel=xlabel, ylabel=ylabel, title=title, | |
199 | ticksize=9, cblabel='') |
|
199 | ticksize=9, cblabel='') | |
200 | #Mean Line |
|
200 | #Mean Line | |
201 | mean = dataOut.data_param[i, 1, :] |
|
201 | mean = dataOut.data_param[i, 1, :] | |
202 | axes.addpline(mean, y, idline=0, color="black", linestyle="solid", lw=1) |
|
202 | axes.addpline(mean, y, idline=0, color="black", linestyle="solid", lw=1) | |
203 |
|
203 | |||
204 | if self.__showprofile: |
|
204 | if self.__showprofile: | |
205 | axes = self.axesList[i*self.__nsubplots +1] |
|
205 | axes = self.axesList[i*self.__nsubplots +1] | |
206 | axes.pline(avgdB[i], y, |
|
206 | axes.pline(avgdB[i], y, | |
207 | xmin=zmin, xmax=zmax, ymin=ymin, ymax=ymax, |
|
207 | xmin=zmin, xmax=zmax, ymin=ymin, ymax=ymax, | |
208 | xlabel='dB', ylabel='', title='', |
|
208 | xlabel='dB', ylabel='', title='', | |
209 | ytick_visible=False, |
|
209 | ytick_visible=False, | |
210 | grid='x') |
|
210 | grid='x') | |
211 |
|
211 | |||
212 | noiseline = numpy.repeat(noisedB[i], len(y)) |
|
212 | noiseline = numpy.repeat(noisedB[i], len(y)) | |
213 | axes.addpline(noiseline, y, idline=1, color="black", linestyle="dashed", lw=2) |
|
213 | axes.addpline(noiseline, y, idline=1, color="black", linestyle="dashed", lw=2) | |
214 |
|
214 | |||
215 | self.draw() |
|
215 | self.draw() | |
216 |
|
216 | |||
217 | self.save(figpath=figpath, |
|
217 | self.save(figpath=figpath, | |
218 | figfile=figfile, |
|
218 | figfile=figfile, | |
219 | save=save, |
|
219 | save=save, | |
220 | ftp=ftp, |
|
220 | ftp=ftp, | |
221 | wr_period=wr_period, |
|
221 | wr_period=wr_period, | |
222 | thisDatetime=thisDatetime) |
|
222 | thisDatetime=thisDatetime) | |
223 |
|
223 | |||
224 |
|
224 | |||
225 |
|
225 | |||
226 | class SkyMapPlot(Figure): |
|
226 | class SkyMapPlot(Figure): | |
227 |
|
227 | |||
228 | __isConfig = None |
|
228 | __isConfig = None | |
229 | __nsubplots = None |
|
229 | __nsubplots = None | |
230 |
|
230 | |||
231 | WIDTHPROF = None |
|
231 | WIDTHPROF = None | |
232 | HEIGHTPROF = None |
|
232 | HEIGHTPROF = None | |
233 | PREFIX = 'mmap' |
|
233 | PREFIX = 'mmap' | |
234 |
|
234 | |||
235 | def __init__(self, **kwargs): |
|
235 | def __init__(self, **kwargs): | |
236 | Figure.__init__(self, **kwargs) |
|
236 | Figure.__init__(self, **kwargs) | |
237 | self.isConfig = False |
|
237 | self.isConfig = False | |
238 | self.__nsubplots = 1 |
|
238 | self.__nsubplots = 1 | |
239 |
|
239 | |||
240 | # self.WIDTH = 280 |
|
240 | # self.WIDTH = 280 | |
241 | # self.HEIGHT = 250 |
|
241 | # self.HEIGHT = 250 | |
242 | self.WIDTH = 600 |
|
242 | self.WIDTH = 600 | |
243 | self.HEIGHT = 600 |
|
243 | self.HEIGHT = 600 | |
244 | self.WIDTHPROF = 120 |
|
244 | self.WIDTHPROF = 120 | |
245 | self.HEIGHTPROF = 0 |
|
245 | self.HEIGHTPROF = 0 | |
246 | self.counter_imagwr = 0 |
|
246 | self.counter_imagwr = 0 | |
247 |
|
247 | |||
248 | self.PLOT_CODE = MSKYMAP_CODE |
|
248 | self.PLOT_CODE = MSKYMAP_CODE | |
249 |
|
249 | |||
250 | self.FTP_WEI = None |
|
250 | self.FTP_WEI = None | |
251 | self.EXP_CODE = None |
|
251 | self.EXP_CODE = None | |
252 | self.SUB_EXP_CODE = None |
|
252 | self.SUB_EXP_CODE = None | |
253 | self.PLOT_POS = None |
|
253 | self.PLOT_POS = None | |
254 |
|
254 | |||
255 | def getSubplots(self): |
|
255 | def getSubplots(self): | |
256 |
|
256 | |||
257 | ncol = int(numpy.sqrt(self.nplots)+0.9) |
|
257 | ncol = int(numpy.sqrt(self.nplots)+0.9) | |
258 | nrow = int(self.nplots*1./ncol + 0.9) |
|
258 | nrow = int(self.nplots*1./ncol + 0.9) | |
259 |
|
259 | |||
260 | return nrow, ncol |
|
260 | return nrow, ncol | |
261 |
|
261 | |||
262 | def setup(self, id, nplots, wintitle, showprofile=False, show=True): |
|
262 | def setup(self, id, nplots, wintitle, showprofile=False, show=True): | |
263 |
|
263 | |||
264 | self.__showprofile = showprofile |
|
264 | self.__showprofile = showprofile | |
265 | self.nplots = nplots |
|
265 | self.nplots = nplots | |
266 |
|
266 | |||
267 | ncolspan = 1 |
|
267 | ncolspan = 1 | |
268 | colspan = 1 |
|
268 | colspan = 1 | |
269 |
|
269 | |||
270 | self.createFigure(id = id, |
|
270 | self.createFigure(id = id, | |
271 | wintitle = wintitle, |
|
271 | wintitle = wintitle, | |
272 | widthplot = self.WIDTH, #+ self.WIDTHPROF, |
|
272 | widthplot = self.WIDTH, #+ self.WIDTHPROF, | |
273 | heightplot = self.HEIGHT,# + self.HEIGHTPROF, |
|
273 | heightplot = self.HEIGHT,# + self.HEIGHTPROF, | |
274 | show=show) |
|
274 | show=show) | |
275 |
|
275 | |||
276 | nrow, ncol = 1,1 |
|
276 | nrow, ncol = 1,1 | |
277 | counter = 0 |
|
277 | counter = 0 | |
278 | x = 0 |
|
278 | x = 0 | |
279 | y = 0 |
|
279 | y = 0 | |
280 | self.addAxes(1, 1, 0, 0, 1, 1, True) |
|
280 | self.addAxes(1, 1, 0, 0, 1, 1, True) | |
281 |
|
281 | |||
282 | def run(self, dataOut, id, wintitle="", channelList=None, showprofile=False, |
|
282 | def run(self, dataOut, id, wintitle="", channelList=None, showprofile=False, | |
283 | tmin=0, tmax=24, timerange=None, |
|
283 | tmin=0, tmax=24, timerange=None, | |
284 | save=False, figpath='./', figfile=None, show=True, ftp=False, wr_period=1, |
|
284 | save=False, figpath='./', figfile=None, show=True, ftp=False, wr_period=1, | |
285 | server=None, folder=None, username=None, password=None, |
|
285 | server=None, folder=None, username=None, password=None, | |
286 | ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0, realtime=False): |
|
286 | ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0, realtime=False): | |
287 |
|
287 | |||
288 | """ |
|
288 | """ | |
289 |
|
289 | |||
290 | Input: |
|
290 | Input: | |
291 | dataOut : |
|
291 | dataOut : | |
292 | id : |
|
292 | id : | |
293 | wintitle : |
|
293 | wintitle : | |
294 | channelList : |
|
294 | channelList : | |
295 | showProfile : |
|
295 | showProfile : | |
296 | xmin : None, |
|
296 | xmin : None, | |
297 | xmax : None, |
|
297 | xmax : None, | |
298 | ymin : None, |
|
298 | ymin : None, | |
299 | ymax : None, |
|
299 | ymax : None, | |
300 | zmin : None, |
|
300 | zmin : None, | |
301 | zmax : None |
|
301 | zmax : None | |
302 | """ |
|
302 | """ | |
303 |
|
303 | |||
304 | arrayParameters = dataOut.data_param |
|
304 | arrayParameters = dataOut.data_param | |
305 | error = arrayParameters[:,-1] |
|
305 | error = arrayParameters[:,-1] | |
306 | indValid = numpy.where(error == 0)[0] |
|
306 | indValid = numpy.where(error == 0)[0] | |
307 | finalMeteor = arrayParameters[indValid,:] |
|
307 | finalMeteor = arrayParameters[indValid,:] | |
308 | finalAzimuth = finalMeteor[:,3] |
|
308 | finalAzimuth = finalMeteor[:,3] | |
309 | finalZenith = finalMeteor[:,4] |
|
309 | finalZenith = finalMeteor[:,4] | |
310 |
|
310 | |||
311 | x = finalAzimuth*numpy.pi/180 |
|
311 | x = finalAzimuth*numpy.pi/180 | |
312 | y = finalZenith |
|
312 | y = finalZenith | |
313 | x1 = [dataOut.ltctime, dataOut.ltctime] |
|
313 | x1 = [dataOut.ltctime, dataOut.ltctime] | |
314 |
|
314 | |||
315 | #thisDatetime = dataOut.datatime |
|
315 | #thisDatetime = dataOut.datatime | |
316 | thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.ltctime) |
|
316 | thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.ltctime) | |
317 | title = wintitle + " Parameters" |
|
317 | title = wintitle + " Parameters" | |
318 | xlabel = "Zonal Zenith Angle (deg) " |
|
318 | xlabel = "Zonal Zenith Angle (deg) " | |
319 | ylabel = "Meridional Zenith Angle (deg)" |
|
319 | ylabel = "Meridional Zenith Angle (deg)" | |
320 | update_figfile = False |
|
320 | update_figfile = False | |
321 |
|
321 | |||
322 | if not self.isConfig: |
|
322 | if not self.isConfig: | |
323 |
|
323 | |||
324 | nplots = 1 |
|
324 | nplots = 1 | |
325 |
|
325 | |||
326 | self.setup(id=id, |
|
326 | self.setup(id=id, | |
327 | nplots=nplots, |
|
327 | nplots=nplots, | |
328 | wintitle=wintitle, |
|
328 | wintitle=wintitle, | |
329 | showprofile=showprofile, |
|
329 | showprofile=showprofile, | |
330 | show=show) |
|
330 | show=show) | |
331 |
|
331 | |||
332 | if self.xmin is None and self.xmax is None: |
|
332 | if self.xmin is None and self.xmax is None: | |
333 | self.xmin, self.xmax = self.getTimeLim(x1, tmin, tmax, timerange) |
|
333 | self.xmin, self.xmax = self.getTimeLim(x1, tmin, tmax, timerange) | |
334 |
|
334 | |||
335 | if timerange != None: |
|
335 | if timerange != None: | |
336 | self.timerange = timerange |
|
336 | self.timerange = timerange | |
337 | else: |
|
337 | else: | |
338 | self.timerange = self.xmax - self.xmin |
|
338 | self.timerange = self.xmax - self.xmin | |
339 |
|
339 | |||
340 | self.FTP_WEI = ftp_wei |
|
340 | self.FTP_WEI = ftp_wei | |
341 | self.EXP_CODE = exp_code |
|
341 | self.EXP_CODE = exp_code | |
342 | self.SUB_EXP_CODE = sub_exp_code |
|
342 | self.SUB_EXP_CODE = sub_exp_code | |
343 | self.PLOT_POS = plot_pos |
|
343 | self.PLOT_POS = plot_pos | |
344 | self.name = thisDatetime.strftime("%Y%m%d_%H%M%S") |
|
344 | self.name = thisDatetime.strftime("%Y%m%d_%H%M%S") | |
345 | self.firstdate = '%s %s'%(thisDatetime.strftime("%Y/%m/%d"),thisDatetime.strftime("%H:%M:%S")) |
|
345 | self.firstdate = '%s %s'%(thisDatetime.strftime("%Y/%m/%d"),thisDatetime.strftime("%H:%M:%S")) | |
346 | self.isConfig = True |
|
346 | self.isConfig = True | |
347 | update_figfile = True |
|
347 | update_figfile = True | |
348 |
|
348 | |||
349 | self.setWinTitle(title) |
|
349 | self.setWinTitle(title) | |
350 |
|
350 | |||
351 | i = 0 |
|
351 | i = 0 | |
352 | str_datetime = '%s %s'%(thisDatetime.strftime("%Y/%m/%d"),thisDatetime.strftime("%H:%M:%S")) |
|
352 | str_datetime = '%s %s'%(thisDatetime.strftime("%Y/%m/%d"),thisDatetime.strftime("%H:%M:%S")) | |
353 |
|
353 | |||
354 | axes = self.axesList[i*self.__nsubplots] |
|
354 | axes = self.axesList[i*self.__nsubplots] | |
355 | nevents = axes.x_buffer.shape[0] + x.shape[0] |
|
355 | nevents = axes.x_buffer.shape[0] + x.shape[0] | |
356 | title = "Meteor Detection Sky Map\n %s - %s \n Number of events: %5.0f\n" %(self.firstdate,str_datetime,nevents) |
|
356 | title = "Meteor Detection Sky Map\n %s - %s \n Number of events: %5.0f\n" %(self.firstdate,str_datetime,nevents) | |
357 | axes.polar(x, y, |
|
357 | axes.polar(x, y, | |
358 | title=title, xlabel=xlabel, ylabel=ylabel, |
|
358 | title=title, xlabel=xlabel, ylabel=ylabel, | |
359 | ticksize=9, cblabel='') |
|
359 | ticksize=9, cblabel='') | |
360 |
|
360 | |||
361 | self.draw() |
|
361 | self.draw() | |
362 |
|
362 | |||
363 | self.save(figpath=figpath, |
|
363 | self.save(figpath=figpath, | |
364 | figfile=figfile, |
|
364 | figfile=figfile, | |
365 | save=save, |
|
365 | save=save, | |
366 | ftp=ftp, |
|
366 | ftp=ftp, | |
367 | wr_period=wr_period, |
|
367 | wr_period=wr_period, | |
368 | thisDatetime=thisDatetime, |
|
368 | thisDatetime=thisDatetime, | |
369 | update_figfile=update_figfile) |
|
369 | update_figfile=update_figfile) | |
370 |
|
370 | |||
371 | if dataOut.ltctime >= self.xmax: |
|
371 | if dataOut.ltctime >= self.xmax: | |
372 | self.isConfigmagwr = wr_period |
|
372 | self.isConfigmagwr = wr_period | |
373 | self.isConfig = False |
|
373 | self.isConfig = False | |
374 | update_figfile = True |
|
374 | update_figfile = True | |
375 | axes.__firsttime = True |
|
375 | axes.__firsttime = True | |
376 | self.xmin += self.timerange |
|
376 | self.xmin += self.timerange | |
377 | self.xmax += self.timerange |
|
377 | self.xmax += self.timerange | |
378 |
|
378 | |||
379 |
|
379 | |||
380 |
|
380 | |||
381 |
|
381 | |||
382 | class WindProfilerPlot(Figure): |
|
382 | class WindProfilerPlot(Figure): | |
383 |
|
383 | |||
384 | __isConfig = None |
|
384 | __isConfig = None | |
385 | __nsubplots = None |
|
385 | __nsubplots = None | |
386 |
|
386 | |||
387 | WIDTHPROF = None |
|
387 | WIDTHPROF = None | |
388 | HEIGHTPROF = None |
|
388 | HEIGHTPROF = None | |
389 | PREFIX = 'wind' |
|
389 | PREFIX = 'wind' | |
390 |
|
390 | |||
391 | def __init__(self, **kwargs): |
|
391 | def __init__(self, **kwargs): | |
392 | Figure.__init__(self, **kwargs) |
|
392 | Figure.__init__(self, **kwargs) | |
393 | self.timerange = None |
|
393 | self.timerange = None | |
394 | self.isConfig = False |
|
394 | self.isConfig = False | |
395 | self.__nsubplots = 1 |
|
395 | self.__nsubplots = 1 | |
396 |
|
396 | |||
397 | self.WIDTH = 800 |
|
397 | self.WIDTH = 800 | |
398 | self.HEIGHT = 300 |
|
398 | self.HEIGHT = 300 | |
399 | self.WIDTHPROF = 120 |
|
399 | self.WIDTHPROF = 120 | |
400 | self.HEIGHTPROF = 0 |
|
400 | self.HEIGHTPROF = 0 | |
401 | self.counter_imagwr = 0 |
|
401 | self.counter_imagwr = 0 | |
402 |
|
402 | |||
403 | self.PLOT_CODE = WIND_CODE |
|
403 | self.PLOT_CODE = WIND_CODE | |
404 |
|
404 | |||
405 | self.FTP_WEI = None |
|
405 | self.FTP_WEI = None | |
406 | self.EXP_CODE = None |
|
406 | self.EXP_CODE = None | |
407 | self.SUB_EXP_CODE = None |
|
407 | self.SUB_EXP_CODE = None | |
408 | self.PLOT_POS = None |
|
408 | self.PLOT_POS = None | |
409 | self.tmin = None |
|
409 | self.tmin = None | |
410 | self.tmax = None |
|
410 | self.tmax = None | |
411 |
|
411 | |||
412 | self.xmin = None |
|
412 | self.xmin = None | |
413 | self.xmax = None |
|
413 | self.xmax = None | |
414 |
|
414 | |||
415 | self.figfile = None |
|
415 | self.figfile = None | |
416 |
|
416 | |||
417 | def getSubplots(self): |
|
417 | def getSubplots(self): | |
418 |
|
418 | |||
419 | ncol = 1 |
|
419 | ncol = 1 | |
420 | nrow = self.nplots |
|
420 | nrow = self.nplots | |
421 |
|
421 | |||
422 | return nrow, ncol |
|
422 | return nrow, ncol | |
423 |
|
423 | |||
424 | def setup(self, id, nplots, wintitle, showprofile=True, show=True): |
|
424 | def setup(self, id, nplots, wintitle, showprofile=True, show=True): | |
425 |
|
425 | |||
426 | self.__showprofile = showprofile |
|
426 | self.__showprofile = showprofile | |
427 | self.nplots = nplots |
|
427 | self.nplots = nplots | |
428 |
|
428 | |||
429 | ncolspan = 1 |
|
429 | ncolspan = 1 | |
430 | colspan = 1 |
|
430 | colspan = 1 | |
431 |
|
431 | |||
432 | self.createFigure(id = id, |
|
432 | self.createFigure(id = id, | |
433 | wintitle = wintitle, |
|
433 | wintitle = wintitle, | |
434 | widthplot = self.WIDTH + self.WIDTHPROF, |
|
434 | widthplot = self.WIDTH + self.WIDTHPROF, | |
435 | heightplot = self.HEIGHT + self.HEIGHTPROF, |
|
435 | heightplot = self.HEIGHT + self.HEIGHTPROF, | |
436 | show=show) |
|
436 | show=show) | |
437 |
|
437 | |||
438 | nrow, ncol = self.getSubplots() |
|
438 | nrow, ncol = self.getSubplots() | |
439 |
|
439 | |||
440 | counter = 0 |
|
440 | counter = 0 | |
441 | for y in range(nrow): |
|
441 | for y in range(nrow): | |
442 | if counter >= self.nplots: |
|
442 | if counter >= self.nplots: | |
443 | break |
|
443 | break | |
444 |
|
444 | |||
445 | self.addAxes(nrow, ncol*ncolspan, y, 0, colspan, 1) |
|
445 | self.addAxes(nrow, ncol*ncolspan, y, 0, colspan, 1) | |
446 | counter += 1 |
|
446 | counter += 1 | |
447 |
|
447 | |||
448 | def run(self, dataOut, id, wintitle="", channelList=None, showprofile='False', |
|
448 | def run(self, dataOut, id, wintitle="", channelList=None, showprofile='False', | |
449 | xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None, |
|
449 | xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None, | |
450 | zmax_ver = None, zmin_ver = None, SNRmin = None, SNRmax = None, |
|
450 | zmax_ver = None, zmin_ver = None, SNRmin = None, SNRmax = None, | |
451 | timerange=None, SNRthresh = None, |
|
451 | timerange=None, SNRthresh = None, | |
452 | save=False, figpath='./', lastone=0,figfile=None, ftp=False, wr_period=1, show=True, |
|
452 | save=False, figpath='./', lastone=0,figfile=None, ftp=False, wr_period=1, show=True, | |
453 | server=None, folder=None, username=None, password=None, |
|
453 | server=None, folder=None, username=None, password=None, | |
454 | ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0): |
|
454 | ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0): | |
455 | """ |
|
455 | """ | |
456 |
|
456 | |||
457 | Input: |
|
457 | Input: | |
458 | dataOut : |
|
458 | dataOut : | |
459 | id : |
|
459 | id : | |
460 | wintitle : |
|
460 | wintitle : | |
461 | channelList : |
|
461 | channelList : | |
462 | showProfile : |
|
462 | showProfile : | |
463 | xmin : None, |
|
463 | xmin : None, | |
464 | xmax : None, |
|
464 | xmax : None, | |
465 | ymin : None, |
|
465 | ymin : None, | |
466 | ymax : None, |
|
466 | ymax : None, | |
467 | zmin : None, |
|
467 | zmin : None, | |
468 | zmax : None |
|
468 | zmax : None | |
469 | """ |
|
469 | """ | |
470 |
|
470 | |||
471 | # if timerange is not None: |
|
471 | # if timerange is not None: | |
472 | # self.timerange = timerange |
|
472 | # self.timerange = timerange | |
473 | # |
|
473 | # | |
474 | # tmin = None |
|
474 | # tmin = None | |
475 | # tmax = None |
|
475 | # tmax = None | |
476 |
|
476 | |||
477 |
|
477 | |||
478 | x = dataOut.getTimeRange1(dataOut.outputInterval) |
|
478 | x = dataOut.getTimeRange1(dataOut.outputInterval) | |
479 | y = dataOut.heightList |
|
479 | y = dataOut.heightList | |
480 | z = dataOut.data_output.copy() |
|
480 | z = dataOut.data_output.copy() | |
481 | nplots = z.shape[0] #Number of wind dimensions estimated |
|
481 | nplots = z.shape[0] #Number of wind dimensions estimated | |
482 | nplotsw = nplots |
|
482 | nplotsw = nplots | |
483 |
|
483 | |||
484 |
|
484 | |||
485 | #If there is a SNR function defined |
|
485 | #If there is a SNR function defined | |
486 | if dataOut.data_SNR is not None: |
|
486 | if dataOut.data_SNR is not None: | |
487 | nplots += 1 |
|
487 | nplots += 1 | |
488 | SNR = dataOut.data_SNR |
|
488 | SNR = dataOut.data_SNR | |
489 | SNRavg = numpy.average(SNR, axis=0) |
|
489 | SNRavg = numpy.average(SNR, axis=0) | |
490 |
|
490 | |||
491 | SNRdB = 10*numpy.log10(SNR) |
|
491 | SNRdB = 10*numpy.log10(SNR) | |
492 | SNRavgdB = 10*numpy.log10(SNRavg) |
|
492 | SNRavgdB = 10*numpy.log10(SNRavg) | |
493 |
|
493 | |||
494 | if SNRthresh == None: SNRthresh = -5.0 |
|
494 | if SNRthresh == None: SNRthresh = -5.0 | |
495 | ind = numpy.where(SNRavg < 10**(SNRthresh/10))[0] |
|
495 | ind = numpy.where(SNRavg < 10**(SNRthresh/10))[0] | |
496 |
|
496 | |||
497 | for i in range(nplotsw): |
|
497 | for i in range(nplotsw): | |
498 | z[i,ind] = numpy.nan |
|
498 | z[i,ind] = numpy.nan | |
499 |
|
499 | |||
500 | thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.ltctime) |
|
500 | thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.ltctime) | |
501 | #thisDatetime = datetime.datetime.now() |
|
501 | #thisDatetime = datetime.datetime.now() | |
502 | title = wintitle + "Wind" |
|
502 | title = wintitle + "Wind" | |
503 | xlabel = "" |
|
503 | xlabel = "" | |
504 | ylabel = "Height (km)" |
|
504 | ylabel = "Height (km)" | |
505 | update_figfile = False |
|
505 | update_figfile = False | |
506 |
|
506 | |||
507 | if not self.isConfig: |
|
507 | if not self.isConfig: | |
508 |
|
508 | |||
509 | self.setup(id=id, |
|
509 | self.setup(id=id, | |
510 | nplots=nplots, |
|
510 | nplots=nplots, | |
511 | wintitle=wintitle, |
|
511 | wintitle=wintitle, | |
512 | showprofile=showprofile, |
|
512 | showprofile=showprofile, | |
513 | show=show) |
|
513 | show=show) | |
514 |
|
514 | |||
515 | if timerange is not None: |
|
515 | if timerange is not None: | |
516 | self.timerange = timerange |
|
516 | self.timerange = timerange | |
517 |
|
517 | |||
518 | self.xmin, self.xmax = self.getTimeLim(x, xmin, xmax, timerange) |
|
518 | self.xmin, self.xmax = self.getTimeLim(x, xmin, xmax, timerange) | |
519 |
|
519 | |||
520 | if ymin == None: ymin = numpy.nanmin(y) |
|
520 | if ymin == None: ymin = numpy.nanmin(y) | |
521 | if ymax == None: ymax = numpy.nanmax(y) |
|
521 | if ymax == None: ymax = numpy.nanmax(y) | |
522 |
|
522 | |||
523 | if zmax == None: zmax = numpy.nanmax(abs(z[range(2),:])) |
|
523 | if zmax == None: zmax = numpy.nanmax(abs(z[range(2),:])) | |
524 | #if numpy.isnan(zmax): zmax = 50 |
|
524 | #if numpy.isnan(zmax): zmax = 50 | |
525 | if zmin == None: zmin = -zmax |
|
525 | if zmin == None: zmin = -zmax | |
526 |
|
526 | |||
527 | if nplotsw == 3: |
|
527 | if nplotsw == 3: | |
528 | if zmax_ver == None: zmax_ver = numpy.nanmax(abs(z[2,:])) |
|
528 | if zmax_ver == None: zmax_ver = numpy.nanmax(abs(z[2,:])) | |
529 | if zmin_ver == None: zmin_ver = -zmax_ver |
|
529 | if zmin_ver == None: zmin_ver = -zmax_ver | |
530 |
|
530 | |||
531 | if dataOut.data_SNR is not None: |
|
531 | if dataOut.data_SNR is not None: | |
532 | if SNRmin == None: SNRmin = numpy.nanmin(SNRavgdB) |
|
532 | if SNRmin == None: SNRmin = numpy.nanmin(SNRavgdB) | |
533 | if SNRmax == None: SNRmax = numpy.nanmax(SNRavgdB) |
|
533 | if SNRmax == None: SNRmax = numpy.nanmax(SNRavgdB) | |
534 |
|
534 | |||
535 |
|
535 | |||
536 | self.FTP_WEI = ftp_wei |
|
536 | self.FTP_WEI = ftp_wei | |
537 | self.EXP_CODE = exp_code |
|
537 | self.EXP_CODE = exp_code | |
538 | self.SUB_EXP_CODE = sub_exp_code |
|
538 | self.SUB_EXP_CODE = sub_exp_code | |
539 | self.PLOT_POS = plot_pos |
|
539 | self.PLOT_POS = plot_pos | |
540 |
|
540 | |||
541 | self.name = thisDatetime.strftime("%Y%m%d_%H%M%S") |
|
541 | self.name = thisDatetime.strftime("%Y%m%d_%H%M%S") | |
542 | self.isConfig = True |
|
542 | self.isConfig = True | |
543 | self.figfile = figfile |
|
543 | self.figfile = figfile | |
544 | update_figfile = True |
|
544 | update_figfile = True | |
545 |
|
545 | |||
546 | self.setWinTitle(title) |
|
546 | self.setWinTitle(title) | |
547 |
|
547 | |||
548 | if ((self.xmax - x[1]) < (x[1]-x[0])): |
|
548 | if ((self.xmax - x[1]) < (x[1]-x[0])): | |
549 | x[1] = self.xmax |
|
549 | x[1] = self.xmax | |
550 |
|
550 | |||
551 | strWind = ['Zonal', 'Meridional', 'Vertical'] |
|
551 | strWind = ['Zonal', 'Meridional', 'Vertical'] | |
552 | strCb = ['Velocity (m/s)','Velocity (m/s)','Velocity (cm/s)'] |
|
552 | strCb = ['Velocity (m/s)','Velocity (m/s)','Velocity (cm/s)'] | |
553 | zmaxVector = [zmax, zmax, zmax_ver] |
|
553 | zmaxVector = [zmax, zmax, zmax_ver] | |
554 | zminVector = [zmin, zmin, zmin_ver] |
|
554 | zminVector = [zmin, zmin, zmin_ver] | |
555 | windFactor = [1,1,100] |
|
555 | windFactor = [1,1,100] | |
556 |
|
556 | |||
557 | for i in range(nplotsw): |
|
557 | for i in range(nplotsw): | |
558 |
|
558 | |||
559 | title = "%s Wind: %s" %(strWind[i], thisDatetime.strftime("%Y/%m/%d %H:%M:%S")) |
|
559 | title = "%s Wind: %s" %(strWind[i], thisDatetime.strftime("%Y/%m/%d %H:%M:%S")) | |
560 | axes = self.axesList[i*self.__nsubplots] |
|
560 | axes = self.axesList[i*self.__nsubplots] | |
561 |
|
561 | |||
562 | z1 = z[i,:].reshape((1,-1))*windFactor[i] |
|
562 | z1 = z[i,:].reshape((1,-1))*windFactor[i] | |
563 | #z1=numpy.ma.masked_where(z1==0.,z1) |
|
563 | #z1=numpy.ma.masked_where(z1==0.,z1) | |
564 |
|
564 | |||
565 | axes.pcolorbuffer(x, y, z1, |
|
565 | axes.pcolorbuffer(x, y, z1, | |
566 | xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=zminVector[i], zmax=zmaxVector[i], |
|
566 | xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=zminVector[i], zmax=zmaxVector[i], | |
567 | xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True, |
|
567 | xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True, | |
568 | ticksize=9, cblabel=strCb[i], cbsize="1%", colormap="seismic" ) |
|
568 | ticksize=9, cblabel=strCb[i], cbsize="1%", colormap="seismic" ) | |
569 |
|
569 | |||
570 | if dataOut.data_SNR is not None: |
|
570 | if dataOut.data_SNR is not None: | |
571 | i += 1 |
|
571 | i += 1 | |
572 | title = "Signal Noise Ratio (SNR): %s" %(thisDatetime.strftime("%Y/%m/%d %H:%M:%S")) |
|
572 | title = "Signal Noise Ratio (SNR): %s" %(thisDatetime.strftime("%Y/%m/%d %H:%M:%S")) | |
573 | axes = self.axesList[i*self.__nsubplots] |
|
573 | axes = self.axesList[i*self.__nsubplots] | |
574 | SNRavgdB = SNRavgdB.reshape((1,-1)) |
|
574 | SNRavgdB = SNRavgdB.reshape((1,-1)) | |
575 | axes.pcolorbuffer(x, y, SNRavgdB, |
|
575 | axes.pcolorbuffer(x, y, SNRavgdB, | |
576 | xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=SNRmin, zmax=SNRmax, |
|
576 | xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=SNRmin, zmax=SNRmax, | |
577 | xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True, |
|
577 | xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True, | |
578 | ticksize=9, cblabel='', cbsize="1%", colormap="jet") |
|
578 | ticksize=9, cblabel='', cbsize="1%", colormap="jet") | |
579 |
|
579 | |||
580 | self.draw() |
|
580 | self.draw() | |
581 |
|
581 | |||
582 | self.save(figpath=figpath, |
|
582 | self.save(figpath=figpath, | |
583 | figfile=figfile, |
|
583 | figfile=figfile, | |
584 | save=save, |
|
584 | save=save, | |
585 | ftp=ftp, |
|
585 | ftp=ftp, | |
586 | wr_period=wr_period, |
|
586 | wr_period=wr_period, | |
587 | thisDatetime=thisDatetime, |
|
587 | thisDatetime=thisDatetime, | |
588 | update_figfile=update_figfile) |
|
588 | update_figfile=update_figfile) | |
589 |
|
589 | |||
590 | if dataOut.ltctime + dataOut.outputInterval >= self.xmax: |
|
590 | if dataOut.ltctime + dataOut.outputInterval >= self.xmax: | |
591 | self.counter_imagwr = wr_period |
|
591 | self.counter_imagwr = wr_period | |
592 | self.isConfig = False |
|
592 | self.isConfig = False | |
593 | update_figfile = True |
|
593 | update_figfile = True | |
594 |
|
594 | |||
595 |
|
595 | |||
596 | class ParametersPlot(Figure): |
|
596 | class ParametersPlot(Figure): | |
597 |
|
597 | |||
598 | __isConfig = None |
|
598 | __isConfig = None | |
599 | __nsubplots = None |
|
599 | __nsubplots = None | |
600 |
|
600 | |||
601 | WIDTHPROF = None |
|
601 | WIDTHPROF = None | |
602 | HEIGHTPROF = None |
|
602 | HEIGHTPROF = None | |
603 | PREFIX = 'param' |
|
603 | PREFIX = 'param' | |
604 |
|
604 | |||
605 | nplots = None |
|
605 | nplots = None | |
606 | nchan = None |
|
606 | nchan = None | |
607 |
|
607 | |||
|
608 | parameters = { | |||
|
609 | 'id': global_type_string, | |||
|
610 | 'wintitle': global_type_string, | |||
|
611 | 'channelList': global_type_list, | |||
|
612 | 'paramIndex': global_type_integer, | |||
|
613 | 'colormap': global_type_colormap, | |||
|
614 | 'xmin': global_type_float, | |||
|
615 | 'xmax': global_type_float, | |||
|
616 | 'ymin': global_type_float, | |||
|
617 | 'ymax': global_type_float, | |||
|
618 | 'zmin': global_type_float, | |||
|
619 | 'zmax': global_type_float, | |||
|
620 | 'timerange': global_type_float, | |||
|
621 | 'showSNR': global_type_boolean, | |||
|
622 | 'SNRthresh': global_type_float, | |||
|
623 | 'SNRmin': global_type_float, | |||
|
624 | 'SNRmax': global_type_float, | |||
|
625 | 'save': global_type_boolean, | |||
|
626 | 'figpath': global_type_string, | |||
|
627 | 'lastone': global_type_integer, | |||
|
628 | 'figfile': global_type_string, | |||
|
629 | 'ftp': global_type_boolean, | |||
|
630 | 'wr_period': global_type_integer, | |||
|
631 | 'show': global_type_boolean, | |||
|
632 | 'server': global_type_string, | |||
|
633 | 'folder': global_type_string, | |||
|
634 | 'username': global_type_string, | |||
|
635 | 'password': global_type_string, | |||
|
636 | 'ftp_wei': global_type_integer, | |||
|
637 | 'exp_code': global_type_integer, | |||
|
638 | 'sub_exp_code': global_type_integer, | |||
|
639 | 'plot_pos': global_type_integer, | |||
|
640 | } | |||
|
641 | ||||
608 | def __init__(self, **kwargs): |
|
642 | def __init__(self, **kwargs): | |
609 | Figure.__init__(self, **kwargs) |
|
643 | Figure.__init__(self, **kwargs) | |
610 | self.timerange = None |
|
644 | self.timerange = None | |
611 | self.isConfig = False |
|
645 | self.isConfig = False | |
612 | self.__nsubplots = 1 |
|
646 | self.__nsubplots = 1 | |
613 |
|
647 | |||
614 | self.WIDTH = 800 |
|
648 | self.WIDTH = 800 | |
615 | self.HEIGHT = 180 |
|
649 | self.HEIGHT = 180 | |
616 | self.WIDTHPROF = 120 |
|
650 | self.WIDTHPROF = 120 | |
617 | self.HEIGHTPROF = 0 |
|
651 | self.HEIGHTPROF = 0 | |
618 | self.counter_imagwr = 0 |
|
652 | self.counter_imagwr = 0 | |
619 |
|
653 | |||
620 | self.PLOT_CODE = RTI_CODE |
|
654 | self.PLOT_CODE = RTI_CODE | |
621 |
|
655 | |||
622 | self.FTP_WEI = None |
|
656 | self.FTP_WEI = None | |
623 | self.EXP_CODE = None |
|
657 | self.EXP_CODE = None | |
624 | self.SUB_EXP_CODE = None |
|
658 | self.SUB_EXP_CODE = None | |
625 | self.PLOT_POS = None |
|
659 | self.PLOT_POS = None | |
626 | self.tmin = None |
|
660 | self.tmin = None | |
627 | self.tmax = None |
|
661 | self.tmax = None | |
628 |
|
662 | |||
629 | self.xmin = None |
|
663 | self.xmin = None | |
630 | self.xmax = None |
|
664 | self.xmax = None | |
631 |
|
665 | |||
632 | self.figfile = None |
|
666 | self.figfile = None | |
633 |
|
667 | |||
634 | def getSubplots(self): |
|
668 | def getSubplots(self): | |
635 |
|
669 | |||
636 | ncol = 1 |
|
670 | ncol = 1 | |
637 | nrow = self.nplots |
|
671 | nrow = self.nplots | |
638 |
|
672 | |||
639 | return nrow, ncol |
|
673 | return nrow, ncol | |
640 |
|
674 | |||
641 | def setup(self, id, nplots, wintitle, show=True): |
|
675 | def setup(self, id, nplots, wintitle, show=True): | |
642 |
|
676 | |||
643 | self.nplots = nplots |
|
677 | self.nplots = nplots | |
644 |
|
678 | |||
645 | ncolspan = 1 |
|
679 | ncolspan = 1 | |
646 | colspan = 1 |
|
680 | colspan = 1 | |
647 |
|
681 | |||
648 | self.createFigure(id = id, |
|
682 | self.createFigure(id = id, | |
649 | wintitle = wintitle, |
|
683 | wintitle = wintitle, | |
650 | widthplot = self.WIDTH + self.WIDTHPROF, |
|
684 | widthplot = self.WIDTH + self.WIDTHPROF, | |
651 | heightplot = self.HEIGHT + self.HEIGHTPROF, |
|
685 | heightplot = self.HEIGHT + self.HEIGHTPROF, | |
652 | show=show) |
|
686 | show=show) | |
653 |
|
687 | |||
654 | nrow, ncol = self.getSubplots() |
|
688 | nrow, ncol = self.getSubplots() | |
655 |
|
689 | |||
656 | counter = 0 |
|
690 | counter = 0 | |
657 | for y in range(nrow): |
|
691 | for y in range(nrow): | |
658 | for x in range(ncol): |
|
692 | for x in range(ncol): | |
659 |
|
693 | |||
660 | if counter >= self.nplots: |
|
694 | if counter >= self.nplots: | |
661 | break |
|
695 | break | |
662 |
|
696 | |||
663 | self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan, colspan, 1) |
|
697 | self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan, colspan, 1) | |
664 |
|
698 | |||
665 | counter += 1 |
|
699 | counter += 1 | |
666 |
|
700 | |||
667 | def run(self, dataOut, id, wintitle="", channelList=None, paramIndex = 0, colormap=True, |
|
701 | def run(self, dataOut, id, wintitle="", channelList=None, paramIndex = 0, colormap=True, | |
668 | xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None, timerange=None, |
|
702 | xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None, timerange=None, | |
669 | showSNR=False, SNRthresh = -numpy.inf, SNRmin=None, SNRmax=None, |
|
703 | showSNR=False, SNRthresh = -numpy.inf, SNRmin=None, SNRmax=None, | |
670 | save=False, figpath='./', lastone=0,figfile=None, ftp=False, wr_period=1, show=True, |
|
704 | save=False, figpath='./', lastone=0,figfile=None, ftp=False, wr_period=1, show=True, | |
671 | server=None, folder=None, username=None, password=None, |
|
705 | server=None, folder=None, username=None, password=None, | |
672 | ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0): |
|
706 | ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0): | |
673 | """ |
|
707 | """ | |
674 |
|
708 | |||
675 | Input: |
|
709 | Input: | |
676 | dataOut : |
|
710 | dataOut : | |
677 | id : |
|
711 | id : | |
678 | wintitle : |
|
712 | wintitle : | |
679 | channelList : |
|
713 | channelList : | |
680 | showProfile : |
|
714 | showProfile : | |
681 | xmin : None, |
|
715 | xmin : None, | |
682 | xmax : None, |
|
716 | xmax : None, | |
683 | ymin : None, |
|
717 | ymin : None, | |
684 | ymax : None, |
|
718 | ymax : None, | |
685 | zmin : None, |
|
719 | zmin : None, | |
686 | zmax : None |
|
720 | zmax : None | |
687 | """ |
|
721 | """ | |
688 |
|
722 | |||
689 | if colormap: |
|
723 | if colormap: | |
690 | colormap="jet" |
|
724 | colormap="jet" | |
691 | else: |
|
725 | else: | |
692 | colormap="RdBu_r" |
|
726 | colormap="RdBu_r" | |
693 |
|
727 | |||
694 | if not isTimeInHourRange(dataOut.datatime, xmin, xmax): |
|
728 | if not isTimeInHourRange(dataOut.datatime, xmin, xmax): | |
695 | return |
|
729 | return | |
696 |
|
730 | |||
697 | if channelList == None: |
|
731 | if channelList == None: | |
698 | channelIndexList = range(dataOut.data_param.shape[0]) |
|
732 | channelIndexList = range(dataOut.data_param.shape[0]) | |
699 | else: |
|
733 | else: | |
700 | channelIndexList = [] |
|
734 | channelIndexList = [] | |
701 | for channel in channelList: |
|
735 | for channel in channelList: | |
702 | if channel not in dataOut.channelList: |
|
736 | if channel not in dataOut.channelList: | |
703 | raise ValueError, "Channel %d is not in dataOut.channelList" |
|
737 | raise ValueError, "Channel %d is not in dataOut.channelList" | |
704 | channelIndexList.append(dataOut.channelList.index(channel)) |
|
738 | channelIndexList.append(dataOut.channelList.index(channel)) | |
705 |
|
739 | |||
706 | x = dataOut.getTimeRange1(dataOut.paramInterval) |
|
740 | x = dataOut.getTimeRange1(dataOut.paramInterval) | |
707 | y = dataOut.getHeiRange() |
|
741 | y = dataOut.getHeiRange() | |
708 |
|
742 | |||
709 | if dataOut.data_param.ndim == 3: |
|
743 | if dataOut.data_param.ndim == 3: | |
710 | z = dataOut.data_param[channelIndexList,paramIndex,:] |
|
744 | z = dataOut.data_param[channelIndexList,paramIndex,:] | |
711 | else: |
|
745 | else: | |
712 | z = dataOut.data_param[channelIndexList,:] |
|
746 | z = dataOut.data_param[channelIndexList,:] | |
713 |
|
747 | |||
714 | if showSNR: |
|
748 | if showSNR: | |
715 | #SNR data |
|
749 | #SNR data | |
716 | SNRarray = dataOut.data_SNR[channelIndexList,:] |
|
750 | SNRarray = dataOut.data_SNR[channelIndexList,:] | |
717 | SNRdB = 10*numpy.log10(SNRarray) |
|
751 | SNRdB = 10*numpy.log10(SNRarray) | |
718 | ind = numpy.where(SNRdB < SNRthresh) |
|
752 | ind = numpy.where(SNRdB < SNRthresh) | |
719 | z[ind] = numpy.nan |
|
753 | z[ind] = numpy.nan | |
720 |
|
754 | |||
721 | thisDatetime = dataOut.datatime |
|
755 | thisDatetime = dataOut.datatime | |
722 | # thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.getTimeRange()[0]) |
|
756 | # thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.getTimeRange()[0]) | |
723 | title = wintitle + " Parameters Plot" #: %s" %(thisDatetime.strftime("%d-%b-%Y")) |
|
757 | title = wintitle + " Parameters Plot" #: %s" %(thisDatetime.strftime("%d-%b-%Y")) | |
724 | xlabel = "" |
|
758 | xlabel = "" | |
725 | ylabel = "Range (Km)" |
|
759 | ylabel = "Range (Km)" | |
726 |
|
760 | |||
727 | update_figfile = False |
|
761 | update_figfile = False | |
728 |
|
762 | |||
729 | if not self.isConfig: |
|
763 | if not self.isConfig: | |
730 |
|
764 | |||
731 | nchan = len(channelIndexList) |
|
765 | nchan = len(channelIndexList) | |
732 | self.nchan = nchan |
|
766 | self.nchan = nchan | |
733 | self.plotFact = 1 |
|
767 | self.plotFact = 1 | |
734 | nplots = nchan |
|
768 | nplots = nchan | |
735 |
|
769 | |||
736 | if showSNR: |
|
770 | if showSNR: | |
737 | nplots = nchan*2 |
|
771 | nplots = nchan*2 | |
738 | self.plotFact = 2 |
|
772 | self.plotFact = 2 | |
739 | if SNRmin == None: SNRmin = numpy.nanmin(SNRdB) |
|
773 | if SNRmin == None: SNRmin = numpy.nanmin(SNRdB) | |
740 | if SNRmax == None: SNRmax = numpy.nanmax(SNRdB) |
|
774 | if SNRmax == None: SNRmax = numpy.nanmax(SNRdB) | |
741 |
|
775 | |||
742 | self.setup(id=id, |
|
776 | self.setup(id=id, | |
743 | nplots=nplots, |
|
777 | nplots=nplots, | |
744 | wintitle=wintitle, |
|
778 | wintitle=wintitle, | |
745 | show=show) |
|
779 | show=show) | |
746 |
|
780 | |||
747 | if timerange != None: |
|
781 | if timerange != None: | |
748 | self.timerange = timerange |
|
782 | self.timerange = timerange | |
749 |
|
783 | |||
750 | self.xmin, self.xmax = self.getTimeLim(x, xmin, xmax, timerange) |
|
784 | self.xmin, self.xmax = self.getTimeLim(x, xmin, xmax, timerange) | |
751 |
|
785 | |||
752 | if ymin == None: ymin = numpy.nanmin(y) |
|
786 | if ymin == None: ymin = numpy.nanmin(y) | |
753 | if ymax == None: ymax = numpy.nanmax(y) |
|
787 | if ymax == None: ymax = numpy.nanmax(y) | |
754 | if zmin == None: zmin = numpy.nanmin(z) |
|
788 | if zmin == None: zmin = numpy.nanmin(z) | |
755 | if zmax == None: zmax = numpy.nanmax(z) |
|
789 | if zmax == None: zmax = numpy.nanmax(z) | |
756 |
|
790 | |||
757 | self.FTP_WEI = ftp_wei |
|
791 | self.FTP_WEI = ftp_wei | |
758 | self.EXP_CODE = exp_code |
|
792 | self.EXP_CODE = exp_code | |
759 | self.SUB_EXP_CODE = sub_exp_code |
|
793 | self.SUB_EXP_CODE = sub_exp_code | |
760 | self.PLOT_POS = plot_pos |
|
794 | self.PLOT_POS = plot_pos | |
761 |
|
795 | |||
762 | self.name = thisDatetime.strftime("%Y%m%d_%H%M%S") |
|
796 | self.name = thisDatetime.strftime("%Y%m%d_%H%M%S") | |
763 | self.isConfig = True |
|
797 | self.isConfig = True | |
764 | self.figfile = figfile |
|
798 | self.figfile = figfile | |
765 | update_figfile = True |
|
799 | update_figfile = True | |
766 |
|
800 | |||
767 | self.setWinTitle(title) |
|
801 | self.setWinTitle(title) | |
768 |
|
802 | |||
769 | for i in range(self.nchan): |
|
803 | for i in range(self.nchan): | |
770 | index = channelIndexList[i] |
|
804 | index = channelIndexList[i] | |
771 | title = "Channel %d: %s" %(dataOut.channelList[index], thisDatetime.strftime("%Y/%m/%d %H:%M:%S")) |
|
805 | title = "Channel %d: %s" %(dataOut.channelList[index], thisDatetime.strftime("%Y/%m/%d %H:%M:%S")) | |
772 | axes = self.axesList[i*self.plotFact] |
|
806 | axes = self.axesList[i*self.plotFact] | |
773 | z1 = z[i,:].reshape((1,-1)) |
|
807 | z1 = z[i,:].reshape((1,-1)) | |
774 | axes.pcolorbuffer(x, y, z1, |
|
808 | axes.pcolorbuffer(x, y, z1, | |
775 | xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=zmin, zmax=zmax, |
|
809 | xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=zmin, zmax=zmax, | |
776 | xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True, |
|
810 | xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True, | |
777 | ticksize=9, cblabel='', cbsize="1%",colormap=colormap) |
|
811 | ticksize=9, cblabel='', cbsize="1%",colormap=colormap) | |
778 |
|
812 | |||
779 | if showSNR: |
|
813 | if showSNR: | |
780 | title = "Channel %d SNR: %s" %(dataOut.channelList[index], thisDatetime.strftime("%Y/%m/%d %H:%M:%S")) |
|
814 | title = "Channel %d SNR: %s" %(dataOut.channelList[index], thisDatetime.strftime("%Y/%m/%d %H:%M:%S")) | |
781 | axes = self.axesList[i*self.plotFact + 1] |
|
815 | axes = self.axesList[i*self.plotFact + 1] | |
782 | SNRdB1 = SNRdB[i,:].reshape((1,-1)) |
|
816 | SNRdB1 = SNRdB[i,:].reshape((1,-1)) | |
783 | axes.pcolorbuffer(x, y, SNRdB1, |
|
817 | axes.pcolorbuffer(x, y, SNRdB1, | |
784 | xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=SNRmin, zmax=SNRmax, |
|
818 | xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=SNRmin, zmax=SNRmax, | |
785 | xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True, |
|
819 | xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True, | |
786 | ticksize=9, cblabel='', cbsize="1%",colormap='jet') |
|
820 | ticksize=9, cblabel='', cbsize="1%",colormap='jet') | |
787 |
|
821 | |||
788 |
|
822 | |||
789 | self.draw() |
|
823 | self.draw() | |
790 |
|
824 | |||
791 | if dataOut.ltctime >= self.xmax: |
|
825 | if dataOut.ltctime >= self.xmax: | |
792 | self.counter_imagwr = wr_period |
|
826 | self.counter_imagwr = wr_period | |
793 | self.isConfig = False |
|
827 | self.isConfig = False | |
794 | update_figfile = True |
|
828 | update_figfile = True | |
795 |
|
829 | |||
796 | self.save(figpath=figpath, |
|
830 | self.save(figpath=figpath, | |
797 | figfile=figfile, |
|
831 | figfile=figfile, | |
798 | save=save, |
|
832 | save=save, | |
799 | ftp=ftp, |
|
833 | ftp=ftp, | |
800 | wr_period=wr_period, |
|
834 | wr_period=wr_period, | |
801 | thisDatetime=thisDatetime, |
|
835 | thisDatetime=thisDatetime, | |
802 | update_figfile=update_figfile) |
|
836 | update_figfile=update_figfile) | |
803 |
|
837 | |||
804 |
|
838 | |||
805 |
|
839 | |||
806 | class Parameters1Plot(Figure): |
|
840 | class Parameters1Plot(Figure): | |
807 |
|
841 | |||
808 | __isConfig = None |
|
842 | __isConfig = None | |
809 | __nsubplots = None |
|
843 | __nsubplots = None | |
810 |
|
844 | |||
811 | WIDTHPROF = None |
|
845 | WIDTHPROF = None | |
812 | HEIGHTPROF = None |
|
846 | HEIGHTPROF = None | |
813 | PREFIX = 'prm' |
|
847 | PREFIX = 'prm' | |
814 |
|
848 | |||
|
849 | parameters = { | |||
|
850 | 'id': global_type_string, | |||
|
851 | 'wintitle': global_type_string, | |||
|
852 | 'channelList': global_type_list, | |||
|
853 | 'showprofile': global_type_boolean, | |||
|
854 | 'xmin': global_type_float, | |||
|
855 | 'xmax': global_type_float, | |||
|
856 | 'ymin': global_type_float, | |||
|
857 | 'ymax': global_type_float, | |||
|
858 | 'zmin': global_type_float, | |||
|
859 | 'zmax': global_type_float, | |||
|
860 | 'timerange': global_type_float, | |||
|
861 | 'parameterIndex': global_type_float, | |||
|
862 | 'onlyPositive': global_type_boolean, | |||
|
863 | 'SNRthresh': global_type_float, | |||
|
864 | 'SNR': global_type_boolean, | |||
|
865 | 'SNRmin': global_type_float, | |||
|
866 | 'SNRmax': global_type_float, | |||
|
867 | 'onlySNR': global_type_boolean, | |||
|
868 | 'DOP': global_type_boolean, | |||
|
869 | 'zlabel': global_type_string, | |||
|
870 | 'parameterName': global_type_string, | |||
|
871 | 'parameterObject': global_type_string, | |||
|
872 | 'save': global_type_boolean, | |||
|
873 | 'figpath': global_type_string, | |||
|
874 | 'lastone': global_type_integer, | |||
|
875 | 'figfile': global_type_string, | |||
|
876 | 'ftp': global_type_boolean, | |||
|
877 | 'wr_period': global_type_integer, | |||
|
878 | 'show': global_type_string, | |||
|
879 | 'server': global_type_string, | |||
|
880 | 'folder': global_type_string, | |||
|
881 | 'username': global_type_string, | |||
|
882 | 'password': global_type_string, | |||
|
883 | 'ftp_wei': global_type_integer, | |||
|
884 | 'exp_code': global_type_integer, | |||
|
885 | 'sub_exp_code': global_type_integer, | |||
|
886 | 'plot_pos': global_type_integer, | |||
|
887 | } | |||
|
888 | ||||
815 | def __init__(self, **kwargs): |
|
889 | def __init__(self, **kwargs): | |
816 | Figure.__init__(self, **kwargs) |
|
890 | Figure.__init__(self, **kwargs) | |
817 | self.timerange = 2*60*60 |
|
891 | self.timerange = 2*60*60 | |
818 | self.isConfig = False |
|
892 | self.isConfig = False | |
819 | self.__nsubplots = 1 |
|
893 | self.__nsubplots = 1 | |
820 |
|
894 | |||
821 | self.WIDTH = 800 |
|
895 | self.WIDTH = 800 | |
822 | self.HEIGHT = 180 |
|
896 | self.HEIGHT = 180 | |
823 | self.WIDTHPROF = 120 |
|
897 | self.WIDTHPROF = 120 | |
824 | self.HEIGHTPROF = 0 |
|
898 | self.HEIGHTPROF = 0 | |
825 | self.counter_imagwr = 0 |
|
899 | self.counter_imagwr = 0 | |
826 |
|
900 | |||
827 | self.PLOT_CODE = PARMS_CODE |
|
901 | self.PLOT_CODE = PARMS_CODE | |
828 |
|
902 | |||
829 | self.FTP_WEI = None |
|
903 | self.FTP_WEI = None | |
830 | self.EXP_CODE = None |
|
904 | self.EXP_CODE = None | |
831 | self.SUB_EXP_CODE = None |
|
905 | self.SUB_EXP_CODE = None | |
832 | self.PLOT_POS = None |
|
906 | self.PLOT_POS = None | |
833 | self.tmin = None |
|
907 | self.tmin = None | |
834 | self.tmax = None |
|
908 | self.tmax = None | |
835 |
|
909 | |||
836 | self.xmin = None |
|
910 | self.xmin = None | |
837 | self.xmax = None |
|
911 | self.xmax = None | |
838 |
|
912 | |||
839 | self.figfile = None |
|
913 | self.figfile = None | |
840 |
|
914 | |||
841 | def getSubplots(self): |
|
915 | def getSubplots(self): | |
842 |
|
916 | |||
843 | ncol = 1 |
|
917 | ncol = 1 | |
844 | nrow = self.nplots |
|
918 | nrow = self.nplots | |
845 |
|
919 | |||
846 | return nrow, ncol |
|
920 | return nrow, ncol | |
847 |
|
921 | |||
848 | def setup(self, id, nplots, wintitle, showprofile=True, show=True): |
|
922 | def setup(self, id, nplots, wintitle, showprofile=True, show=True): | |
849 |
|
923 | |||
850 | self.__showprofile = showprofile |
|
924 | self.__showprofile = showprofile | |
851 | self.nplots = nplots |
|
925 | self.nplots = nplots | |
852 |
|
926 | |||
853 | ncolspan = 1 |
|
927 | ncolspan = 1 | |
854 | colspan = 1 |
|
928 | colspan = 1 | |
855 |
|
929 | |||
856 | self.createFigure(id = id, |
|
930 | self.createFigure(id = id, | |
857 | wintitle = wintitle, |
|
931 | wintitle = wintitle, | |
858 | widthplot = self.WIDTH + self.WIDTHPROF, |
|
932 | widthplot = self.WIDTH + self.WIDTHPROF, | |
859 | heightplot = self.HEIGHT + self.HEIGHTPROF, |
|
933 | heightplot = self.HEIGHT + self.HEIGHTPROF, | |
860 | show=show) |
|
934 | show=show) | |
861 |
|
935 | |||
862 | nrow, ncol = self.getSubplots() |
|
936 | nrow, ncol = self.getSubplots() | |
863 |
|
937 | |||
864 | counter = 0 |
|
938 | counter = 0 | |
865 | for y in range(nrow): |
|
939 | for y in range(nrow): | |
866 | for x in range(ncol): |
|
940 | for x in range(ncol): | |
867 |
|
941 | |||
868 | if counter >= self.nplots: |
|
942 | if counter >= self.nplots: | |
869 | break |
|
943 | break | |
870 |
|
944 | |||
871 | self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan, colspan, 1) |
|
945 | self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan, colspan, 1) | |
872 |
|
946 | |||
873 | if showprofile: |
|
947 | if showprofile: | |
874 | self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan+colspan, 1, 1) |
|
948 | self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan+colspan, 1, 1) | |
875 |
|
949 | |||
876 | counter += 1 |
|
950 | counter += 1 | |
877 |
|
951 | |||
878 | def run(self, dataOut, id, wintitle="", channelList=None, showprofile=False, |
|
952 | def run(self, dataOut, id, wintitle="", channelList=None, showprofile=False, | |
879 | xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None,timerange=None, |
|
953 | xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None,timerange=None, | |
880 | parameterIndex = None, onlyPositive = False, |
|
954 | parameterIndex = None, onlyPositive = False, | |
881 | SNRthresh = -numpy.inf, SNR = True, SNRmin = None, SNRmax = None, onlySNR = False, |
|
955 | SNRthresh = -numpy.inf, SNR = True, SNRmin = None, SNRmax = None, onlySNR = False, | |
882 | DOP = True, |
|
956 | DOP = True, | |
883 | zlabel = "", parameterName = "", parameterObject = "data_param", |
|
957 | zlabel = "", parameterName = "", parameterObject = "data_param", | |
884 | save=False, figpath='./', lastone=0,figfile=None, ftp=False, wr_period=1, show=True, |
|
958 | save=False, figpath='./', lastone=0,figfile=None, ftp=False, wr_period=1, show=True, | |
885 | server=None, folder=None, username=None, password=None, |
|
959 | server=None, folder=None, username=None, password=None, | |
886 | ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0): |
|
960 | ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0): | |
887 | #print inspect.getargspec(self.run).args |
|
961 | #print inspect.getargspec(self.run).args | |
888 | """ |
|
962 | """ | |
889 |
|
963 | |||
890 | Input: |
|
964 | Input: | |
891 | dataOut : |
|
965 | dataOut : | |
892 | id : |
|
966 | id : | |
893 | wintitle : |
|
967 | wintitle : | |
894 | channelList : |
|
968 | channelList : | |
895 | showProfile : |
|
969 | showProfile : | |
896 | xmin : None, |
|
970 | xmin : None, | |
897 | xmax : None, |
|
971 | xmax : None, | |
898 | ymin : None, |
|
972 | ymin : None, | |
899 | ymax : None, |
|
973 | ymax : None, | |
900 | zmin : None, |
|
974 | zmin : None, | |
901 | zmax : None |
|
975 | zmax : None | |
902 | """ |
|
976 | """ | |
903 |
|
977 | |||
904 | data_param = getattr(dataOut, parameterObject) |
|
978 | data_param = getattr(dataOut, parameterObject) | |
905 |
|
979 | |||
906 | if channelList == None: |
|
980 | if channelList == None: | |
907 | channelIndexList = numpy.arange(data_param.shape[0]) |
|
981 | channelIndexList = numpy.arange(data_param.shape[0]) | |
908 | else: |
|
982 | else: | |
909 | channelIndexList = numpy.array(channelList) |
|
983 | channelIndexList = numpy.array(channelList) | |
910 |
|
984 | |||
911 | nchan = len(channelIndexList) #Number of channels being plotted |
|
985 | nchan = len(channelIndexList) #Number of channels being plotted | |
912 |
|
986 | |||
913 | if nchan < 1: |
|
987 | if nchan < 1: | |
914 | return |
|
988 | return | |
915 |
|
989 | |||
916 | nGraphsByChannel = 0 |
|
990 | nGraphsByChannel = 0 | |
917 |
|
991 | |||
918 | if SNR: |
|
992 | if SNR: | |
919 | nGraphsByChannel += 1 |
|
993 | nGraphsByChannel += 1 | |
920 | if DOP: |
|
994 | if DOP: | |
921 | nGraphsByChannel += 1 |
|
995 | nGraphsByChannel += 1 | |
922 |
|
996 | |||
923 | if nGraphsByChannel < 1: |
|
997 | if nGraphsByChannel < 1: | |
924 | return |
|
998 | return | |
925 |
|
999 | |||
926 | nplots = nGraphsByChannel*nchan |
|
1000 | nplots = nGraphsByChannel*nchan | |
927 |
|
1001 | |||
928 | if timerange is not None: |
|
1002 | if timerange is not None: | |
929 | self.timerange = timerange |
|
1003 | self.timerange = timerange | |
930 |
|
1004 | |||
931 | #tmin = None |
|
1005 | #tmin = None | |
932 | #tmax = None |
|
1006 | #tmax = None | |
933 | if parameterIndex == None: |
|
1007 | if parameterIndex == None: | |
934 | parameterIndex = 1 |
|
1008 | parameterIndex = 1 | |
935 |
|
1009 | |||
936 | x = dataOut.getTimeRange1(dataOut.paramInterval) |
|
1010 | x = dataOut.getTimeRange1(dataOut.paramInterval) | |
937 | y = dataOut.heightList |
|
1011 | y = dataOut.heightList | |
938 | z = data_param[channelIndexList,parameterIndex,:].copy() |
|
1012 | z = data_param[channelIndexList,parameterIndex,:].copy() | |
939 |
|
1013 | |||
940 | zRange = dataOut.abscissaList |
|
1014 | zRange = dataOut.abscissaList | |
941 | # nChannels = z.shape[0] #Number of wind dimensions estimated |
|
1015 | # nChannels = z.shape[0] #Number of wind dimensions estimated | |
942 | # thisDatetime = dataOut.datatime |
|
1016 | # thisDatetime = dataOut.datatime | |
943 |
|
1017 | |||
944 | if dataOut.data_SNR is not None: |
|
1018 | if dataOut.data_SNR is not None: | |
945 | SNRarray = dataOut.data_SNR[channelIndexList,:] |
|
1019 | SNRarray = dataOut.data_SNR[channelIndexList,:] | |
946 | SNRdB = 10*numpy.log10(SNRarray) |
|
1020 | SNRdB = 10*numpy.log10(SNRarray) | |
947 | # SNRavgdB = 10*numpy.log10(SNRavg) |
|
1021 | # SNRavgdB = 10*numpy.log10(SNRavg) | |
948 | ind = numpy.where(SNRdB < 10**(SNRthresh/10)) |
|
1022 | ind = numpy.where(SNRdB < 10**(SNRthresh/10)) | |
949 | z[ind] = numpy.nan |
|
1023 | z[ind] = numpy.nan | |
950 |
|
1024 | |||
951 | thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.getTimeRange()[0]) |
|
1025 | thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.getTimeRange()[0]) | |
952 | title = wintitle + " Parameters Plot" #: %s" %(thisDatetime.strftime("%d-%b-%Y")) |
|
1026 | title = wintitle + " Parameters Plot" #: %s" %(thisDatetime.strftime("%d-%b-%Y")) | |
953 | xlabel = "" |
|
1027 | xlabel = "" | |
954 | ylabel = "Range (Km)" |
|
1028 | ylabel = "Range (Km)" | |
955 |
|
1029 | |||
956 | if (SNR and not onlySNR): nplots = 2*nplots |
|
1030 | if (SNR and not onlySNR): nplots = 2*nplots | |
957 |
|
1031 | |||
958 | if onlyPositive: |
|
1032 | if onlyPositive: | |
959 | colormap = "jet" |
|
1033 | colormap = "jet" | |
960 | zmin = 0 |
|
1034 | zmin = 0 | |
961 | else: colormap = "RdBu_r" |
|
1035 | else: colormap = "RdBu_r" | |
962 |
|
1036 | |||
963 | if not self.isConfig: |
|
1037 | if not self.isConfig: | |
964 |
|
1038 | |||
965 | self.setup(id=id, |
|
1039 | self.setup(id=id, | |
966 | nplots=nplots, |
|
1040 | nplots=nplots, | |
967 | wintitle=wintitle, |
|
1041 | wintitle=wintitle, | |
968 | showprofile=showprofile, |
|
1042 | showprofile=showprofile, | |
969 | show=show) |
|
1043 | show=show) | |
970 |
|
1044 | |||
971 | self.xmin, self.xmax = self.getTimeLim(x, xmin, xmax, timerange) |
|
1045 | self.xmin, self.xmax = self.getTimeLim(x, xmin, xmax, timerange) | |
972 |
|
1046 | |||
973 | if ymin == None: ymin = numpy.nanmin(y) |
|
1047 | if ymin == None: ymin = numpy.nanmin(y) | |
974 | if ymax == None: ymax = numpy.nanmax(y) |
|
1048 | if ymax == None: ymax = numpy.nanmax(y) | |
975 | if zmin == None: zmin = numpy.nanmin(zRange) |
|
1049 | if zmin == None: zmin = numpy.nanmin(zRange) | |
976 | if zmax == None: zmax = numpy.nanmax(zRange) |
|
1050 | if zmax == None: zmax = numpy.nanmax(zRange) | |
977 |
|
1051 | |||
978 | if SNR: |
|
1052 | if SNR: | |
979 | if SNRmin == None: SNRmin = numpy.nanmin(SNRdB) |
|
1053 | if SNRmin == None: SNRmin = numpy.nanmin(SNRdB) | |
980 | if SNRmax == None: SNRmax = numpy.nanmax(SNRdB) |
|
1054 | if SNRmax == None: SNRmax = numpy.nanmax(SNRdB) | |
981 |
|
1055 | |||
982 | self.FTP_WEI = ftp_wei |
|
1056 | self.FTP_WEI = ftp_wei | |
983 | self.EXP_CODE = exp_code |
|
1057 | self.EXP_CODE = exp_code | |
984 | self.SUB_EXP_CODE = sub_exp_code |
|
1058 | self.SUB_EXP_CODE = sub_exp_code | |
985 | self.PLOT_POS = plot_pos |
|
1059 | self.PLOT_POS = plot_pos | |
986 |
|
1060 | |||
987 | self.name = thisDatetime.strftime("%Y%m%d_%H%M%S") |
|
1061 | self.name = thisDatetime.strftime("%Y%m%d_%H%M%S") | |
988 | self.isConfig = True |
|
1062 | self.isConfig = True | |
989 | self.figfile = figfile |
|
1063 | self.figfile = figfile | |
990 |
|
1064 | |||
991 | self.setWinTitle(title) |
|
1065 | self.setWinTitle(title) | |
992 |
|
1066 | |||
993 | if ((self.xmax - x[1]) < (x[1]-x[0])): |
|
1067 | if ((self.xmax - x[1]) < (x[1]-x[0])): | |
994 | x[1] = self.xmax |
|
1068 | x[1] = self.xmax | |
995 |
|
1069 | |||
996 | for i in range(nchan): |
|
1070 | for i in range(nchan): | |
997 |
|
1071 | |||
998 | if (SNR and not onlySNR): j = 2*i |
|
1072 | if (SNR and not onlySNR): j = 2*i | |
999 | else: j = i |
|
1073 | else: j = i | |
1000 |
|
1074 | |||
1001 | j = nGraphsByChannel*i |
|
1075 | j = nGraphsByChannel*i | |
1002 |
|
1076 | |||
1003 | if ((dataOut.azimuth!=None) and (dataOut.zenith!=None)): |
|
1077 | if ((dataOut.azimuth!=None) and (dataOut.zenith!=None)): | |
1004 | title = title + '_' + 'azimuth,zenith=%2.2f,%2.2f'%(dataOut.azimuth, dataOut.zenith) |
|
1078 | title = title + '_' + 'azimuth,zenith=%2.2f,%2.2f'%(dataOut.azimuth, dataOut.zenith) | |
1005 |
|
1079 | |||
1006 | if not onlySNR: |
|
1080 | if not onlySNR: | |
1007 | axes = self.axesList[j*self.__nsubplots] |
|
1081 | axes = self.axesList[j*self.__nsubplots] | |
1008 | z1 = z[i,:].reshape((1,-1)) |
|
1082 | z1 = z[i,:].reshape((1,-1)) | |
1009 | axes.pcolorbuffer(x, y, z1, |
|
1083 | axes.pcolorbuffer(x, y, z1, | |
1010 | xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=zmin, zmax=zmax, |
|
1084 | xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=zmin, zmax=zmax, | |
1011 | xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True,colormap=colormap, |
|
1085 | xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True,colormap=colormap, | |
1012 | ticksize=9, cblabel=zlabel, cbsize="1%") |
|
1086 | ticksize=9, cblabel=zlabel, cbsize="1%") | |
1013 |
|
1087 | |||
1014 | if DOP: |
|
1088 | if DOP: | |
1015 | title = "%s Channel %d: %s" %(parameterName, channelIndexList[i], thisDatetime.strftime("%Y/%m/%d %H:%M:%S")) |
|
1089 | title = "%s Channel %d: %s" %(parameterName, channelIndexList[i], thisDatetime.strftime("%Y/%m/%d %H:%M:%S")) | |
1016 |
|
1090 | |||
1017 | if ((dataOut.azimuth!=None) and (dataOut.zenith!=None)): |
|
1091 | if ((dataOut.azimuth!=None) and (dataOut.zenith!=None)): | |
1018 | title = title + '_' + 'azimuth,zenith=%2.2f,%2.2f'%(dataOut.azimuth, dataOut.zenith) |
|
1092 | title = title + '_' + 'azimuth,zenith=%2.2f,%2.2f'%(dataOut.azimuth, dataOut.zenith) | |
1019 | axes = self.axesList[j] |
|
1093 | axes = self.axesList[j] | |
1020 | z1 = z[i,:].reshape((1,-1)) |
|
1094 | z1 = z[i,:].reshape((1,-1)) | |
1021 | axes.pcolorbuffer(x, y, z1, |
|
1095 | axes.pcolorbuffer(x, y, z1, | |
1022 | xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=zmin, zmax=zmax, |
|
1096 | xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=zmin, zmax=zmax, | |
1023 | xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True,colormap=colormap, |
|
1097 | xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True,colormap=colormap, | |
1024 | ticksize=9, cblabel=zlabel, cbsize="1%") |
|
1098 | ticksize=9, cblabel=zlabel, cbsize="1%") | |
1025 |
|
1099 | |||
1026 | if SNR: |
|
1100 | if SNR: | |
1027 | title = "Channel %d Signal Noise Ratio (SNR): %s" %(channelIndexList[i], thisDatetime.strftime("%Y/%m/%d %H:%M:%S")) |
|
1101 | title = "Channel %d Signal Noise Ratio (SNR): %s" %(channelIndexList[i], thisDatetime.strftime("%Y/%m/%d %H:%M:%S")) | |
1028 | axes = self.axesList[(j)*self.__nsubplots] |
|
1102 | axes = self.axesList[(j)*self.__nsubplots] | |
1029 | if not onlySNR: |
|
1103 | if not onlySNR: | |
1030 | axes = self.axesList[(j + 1)*self.__nsubplots] |
|
1104 | axes = self.axesList[(j + 1)*self.__nsubplots] | |
1031 |
|
1105 | |||
1032 | axes = self.axesList[(j + nGraphsByChannel-1)] |
|
1106 | axes = self.axesList[(j + nGraphsByChannel-1)] | |
1033 |
|
1107 | |||
1034 | z1 = SNRdB[i,:].reshape((1,-1)) |
|
1108 | z1 = SNRdB[i,:].reshape((1,-1)) | |
1035 | axes.pcolorbuffer(x, y, z1, |
|
1109 | axes.pcolorbuffer(x, y, z1, | |
1036 | xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=SNRmin, zmax=SNRmax, |
|
1110 | xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=SNRmin, zmax=SNRmax, | |
1037 | xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True,colormap="jet", |
|
1111 | xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True,colormap="jet", | |
1038 | ticksize=9, cblabel=zlabel, cbsize="1%") |
|
1112 | ticksize=9, cblabel=zlabel, cbsize="1%") | |
1039 |
|
1113 | |||
1040 |
|
1114 | |||
1041 |
|
1115 | |||
1042 | self.draw() |
|
1116 | self.draw() | |
1043 |
|
1117 | |||
1044 | if x[1] >= self.axesList[0].xmax: |
|
1118 | if x[1] >= self.axesList[0].xmax: | |
1045 | self.counter_imagwr = wr_period |
|
1119 | self.counter_imagwr = wr_period | |
1046 | self.isConfig = False |
|
1120 | self.isConfig = False | |
1047 | self.figfile = None |
|
1121 | self.figfile = None | |
1048 |
|
1122 | |||
1049 | self.save(figpath=figpath, |
|
1123 | self.save(figpath=figpath, | |
1050 | figfile=figfile, |
|
1124 | figfile=figfile, | |
1051 | save=save, |
|
1125 | save=save, | |
1052 | ftp=ftp, |
|
1126 | ftp=ftp, | |
1053 | wr_period=wr_period, |
|
1127 | wr_period=wr_period, | |
1054 | thisDatetime=thisDatetime, |
|
1128 | thisDatetime=thisDatetime, | |
1055 | update_figfile=False) |
|
1129 | update_figfile=False) | |
1056 |
|
1130 | |||
1057 | class SpectralFittingPlot(Figure): |
|
1131 | class SpectralFittingPlot(Figure): | |
1058 |
|
1132 | |||
1059 | __isConfig = None |
|
1133 | __isConfig = None | |
1060 | __nsubplots = None |
|
1134 | __nsubplots = None | |
1061 |
|
1135 | |||
1062 | WIDTHPROF = None |
|
1136 | WIDTHPROF = None | |
1063 | HEIGHTPROF = None |
|
1137 | HEIGHTPROF = None | |
1064 | PREFIX = 'prm' |
|
1138 | PREFIX = 'prm' | |
1065 |
|
1139 | |||
1066 |
|
1140 | |||
1067 | N = None |
|
1141 | N = None | |
1068 | ippSeconds = None |
|
1142 | ippSeconds = None | |
1069 |
|
1143 | |||
1070 | def __init__(self, **kwargs): |
|
1144 | def __init__(self, **kwargs): | |
1071 | Figure.__init__(self, **kwargs) |
|
1145 | Figure.__init__(self, **kwargs) | |
1072 | self.isConfig = False |
|
1146 | self.isConfig = False | |
1073 | self.__nsubplots = 1 |
|
1147 | self.__nsubplots = 1 | |
1074 |
|
1148 | |||
1075 | self.PLOT_CODE = SPECFIT_CODE |
|
1149 | self.PLOT_CODE = SPECFIT_CODE | |
1076 |
|
1150 | |||
1077 | self.WIDTH = 450 |
|
1151 | self.WIDTH = 450 | |
1078 | self.HEIGHT = 250 |
|
1152 | self.HEIGHT = 250 | |
1079 | self.WIDTHPROF = 0 |
|
1153 | self.WIDTHPROF = 0 | |
1080 | self.HEIGHTPROF = 0 |
|
1154 | self.HEIGHTPROF = 0 | |
1081 |
|
1155 | |||
1082 | def getSubplots(self): |
|
1156 | def getSubplots(self): | |
1083 |
|
1157 | |||
1084 | ncol = int(numpy.sqrt(self.nplots)+0.9) |
|
1158 | ncol = int(numpy.sqrt(self.nplots)+0.9) | |
1085 | nrow = int(self.nplots*1./ncol + 0.9) |
|
1159 | nrow = int(self.nplots*1./ncol + 0.9) | |
1086 |
|
1160 | |||
1087 | return nrow, ncol |
|
1161 | return nrow, ncol | |
1088 |
|
1162 | |||
1089 | def setup(self, id, nplots, wintitle, showprofile=False, show=True): |
|
1163 | def setup(self, id, nplots, wintitle, showprofile=False, show=True): | |
1090 |
|
1164 | |||
1091 | showprofile = False |
|
1165 | showprofile = False | |
1092 | self.__showprofile = showprofile |
|
1166 | self.__showprofile = showprofile | |
1093 | self.nplots = nplots |
|
1167 | self.nplots = nplots | |
1094 |
|
1168 | |||
1095 | ncolspan = 5 |
|
1169 | ncolspan = 5 | |
1096 | colspan = 4 |
|
1170 | colspan = 4 | |
1097 | if showprofile: |
|
1171 | if showprofile: | |
1098 | ncolspan = 5 |
|
1172 | ncolspan = 5 | |
1099 | colspan = 4 |
|
1173 | colspan = 4 | |
1100 | self.__nsubplots = 2 |
|
1174 | self.__nsubplots = 2 | |
1101 |
|
1175 | |||
1102 | self.createFigure(id = id, |
|
1176 | self.createFigure(id = id, | |
1103 | wintitle = wintitle, |
|
1177 | wintitle = wintitle, | |
1104 | widthplot = self.WIDTH + self.WIDTHPROF, |
|
1178 | widthplot = self.WIDTH + self.WIDTHPROF, | |
1105 | heightplot = self.HEIGHT + self.HEIGHTPROF, |
|
1179 | heightplot = self.HEIGHT + self.HEIGHTPROF, | |
1106 | show=show) |
|
1180 | show=show) | |
1107 |
|
1181 | |||
1108 | nrow, ncol = self.getSubplots() |
|
1182 | nrow, ncol = self.getSubplots() | |
1109 |
|
1183 | |||
1110 | counter = 0 |
|
1184 | counter = 0 | |
1111 | for y in range(nrow): |
|
1185 | for y in range(nrow): | |
1112 | for x in range(ncol): |
|
1186 | for x in range(ncol): | |
1113 |
|
1187 | |||
1114 | if counter >= self.nplots: |
|
1188 | if counter >= self.nplots: | |
1115 | break |
|
1189 | break | |
1116 |
|
1190 | |||
1117 | self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan, colspan, 1) |
|
1191 | self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan, colspan, 1) | |
1118 |
|
1192 | |||
1119 | if showprofile: |
|
1193 | if showprofile: | |
1120 | self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan+colspan, 1, 1) |
|
1194 | self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan+colspan, 1, 1) | |
1121 |
|
1195 | |||
1122 | counter += 1 |
|
1196 | counter += 1 | |
1123 |
|
1197 | |||
1124 | def run(self, dataOut, id, cutHeight=None, fit=False, wintitle="", channelList=None, showprofile=True, |
|
1198 | def run(self, dataOut, id, cutHeight=None, fit=False, wintitle="", channelList=None, showprofile=True, | |
1125 | xmin=None, xmax=None, ymin=None, ymax=None, |
|
1199 | xmin=None, xmax=None, ymin=None, ymax=None, | |
1126 | save=False, figpath='./', figfile=None, show=True): |
|
1200 | save=False, figpath='./', figfile=None, show=True): | |
1127 |
|
1201 | |||
1128 | """ |
|
1202 | """ | |
1129 |
|
1203 | |||
1130 | Input: |
|
1204 | Input: | |
1131 | dataOut : |
|
1205 | dataOut : | |
1132 | id : |
|
1206 | id : | |
1133 | wintitle : |
|
1207 | wintitle : | |
1134 | channelList : |
|
1208 | channelList : | |
1135 | showProfile : |
|
1209 | showProfile : | |
1136 | xmin : None, |
|
1210 | xmin : None, | |
1137 | xmax : None, |
|
1211 | xmax : None, | |
1138 | zmin : None, |
|
1212 | zmin : None, | |
1139 | zmax : None |
|
1213 | zmax : None | |
1140 | """ |
|
1214 | """ | |
1141 |
|
1215 | |||
1142 | if cutHeight==None: |
|
1216 | if cutHeight==None: | |
1143 | h=270 |
|
1217 | h=270 | |
1144 | heightindex = numpy.abs(cutHeight - dataOut.heightList).argmin() |
|
1218 | heightindex = numpy.abs(cutHeight - dataOut.heightList).argmin() | |
1145 | cutHeight = dataOut.heightList[heightindex] |
|
1219 | cutHeight = dataOut.heightList[heightindex] | |
1146 |
|
1220 | |||
1147 | factor = dataOut.normFactor |
|
1221 | factor = dataOut.normFactor | |
1148 | x = dataOut.abscissaList[:-1] |
|
1222 | x = dataOut.abscissaList[:-1] | |
1149 | #y = dataOut.getHeiRange() |
|
1223 | #y = dataOut.getHeiRange() | |
1150 |
|
1224 | |||
1151 | z = dataOut.data_pre[:,:,heightindex]/factor |
|
1225 | z = dataOut.data_pre[:,:,heightindex]/factor | |
1152 | z = numpy.where(numpy.isfinite(z), z, numpy.NAN) |
|
1226 | z = numpy.where(numpy.isfinite(z), z, numpy.NAN) | |
1153 | avg = numpy.average(z, axis=1) |
|
1227 | avg = numpy.average(z, axis=1) | |
1154 | listChannels = z.shape[0] |
|
1228 | listChannels = z.shape[0] | |
1155 |
|
1229 | |||
1156 | #Reconstruct Function |
|
1230 | #Reconstruct Function | |
1157 | if fit==True: |
|
1231 | if fit==True: | |
1158 | groupArray = dataOut.groupList |
|
1232 | groupArray = dataOut.groupList | |
1159 | listChannels = groupArray.reshape((groupArray.size)) |
|
1233 | listChannels = groupArray.reshape((groupArray.size)) | |
1160 | listChannels.sort() |
|
1234 | listChannels.sort() | |
1161 | spcFitLine = numpy.zeros(z.shape) |
|
1235 | spcFitLine = numpy.zeros(z.shape) | |
1162 | constants = dataOut.constants |
|
1236 | constants = dataOut.constants | |
1163 |
|
1237 | |||
1164 | nGroups = groupArray.shape[0] |
|
1238 | nGroups = groupArray.shape[0] | |
1165 | nChannels = groupArray.shape[1] |
|
1239 | nChannels = groupArray.shape[1] | |
1166 | nProfiles = z.shape[1] |
|
1240 | nProfiles = z.shape[1] | |
1167 |
|
1241 | |||
1168 | for f in range(nGroups): |
|
1242 | for f in range(nGroups): | |
1169 | groupChann = groupArray[f,:] |
|
1243 | groupChann = groupArray[f,:] | |
1170 | p = dataOut.data_param[f,:,heightindex] |
|
1244 | p = dataOut.data_param[f,:,heightindex] | |
1171 | # p = numpy.array([ 89.343967,0.14036615,0.17086219,18.89835291,1.58388365,1.55099167]) |
|
1245 | # p = numpy.array([ 89.343967,0.14036615,0.17086219,18.89835291,1.58388365,1.55099167]) | |
1172 | fitLineAux = dataOut.library.modelFunction(p, constants)*nProfiles |
|
1246 | fitLineAux = dataOut.library.modelFunction(p, constants)*nProfiles | |
1173 | fitLineAux = fitLineAux.reshape((nChannels,nProfiles)) |
|
1247 | fitLineAux = fitLineAux.reshape((nChannels,nProfiles)) | |
1174 | spcFitLine[groupChann,:] = fitLineAux |
|
1248 | spcFitLine[groupChann,:] = fitLineAux | |
1175 | # spcFitLine = spcFitLine/factor |
|
1249 | # spcFitLine = spcFitLine/factor | |
1176 |
|
1250 | |||
1177 | z = z[listChannels,:] |
|
1251 | z = z[listChannels,:] | |
1178 | spcFitLine = spcFitLine[listChannels,:] |
|
1252 | spcFitLine = spcFitLine[listChannels,:] | |
1179 | spcFitLinedB = 10*numpy.log10(spcFitLine) |
|
1253 | spcFitLinedB = 10*numpy.log10(spcFitLine) | |
1180 |
|
1254 | |||
1181 | zdB = 10*numpy.log10(z) |
|
1255 | zdB = 10*numpy.log10(z) | |
1182 | #thisDatetime = dataOut.datatime |
|
1256 | #thisDatetime = dataOut.datatime | |
1183 | thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.getTimeRange()[0]) |
|
1257 | thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.getTimeRange()[0]) | |
1184 | title = wintitle + " Doppler Spectra: %s" %(thisDatetime.strftime("%d-%b-%Y %H:%M:%S")) |
|
1258 | title = wintitle + " Doppler Spectra: %s" %(thisDatetime.strftime("%d-%b-%Y %H:%M:%S")) | |
1185 | xlabel = "Velocity (m/s)" |
|
1259 | xlabel = "Velocity (m/s)" | |
1186 | ylabel = "Spectrum" |
|
1260 | ylabel = "Spectrum" | |
1187 |
|
1261 | |||
1188 | if not self.isConfig: |
|
1262 | if not self.isConfig: | |
1189 |
|
1263 | |||
1190 | nplots = listChannels.size |
|
1264 | nplots = listChannels.size | |
1191 |
|
1265 | |||
1192 | self.setup(id=id, |
|
1266 | self.setup(id=id, | |
1193 | nplots=nplots, |
|
1267 | nplots=nplots, | |
1194 | wintitle=wintitle, |
|
1268 | wintitle=wintitle, | |
1195 | showprofile=showprofile, |
|
1269 | showprofile=showprofile, | |
1196 | show=show) |
|
1270 | show=show) | |
1197 |
|
1271 | |||
1198 | if xmin == None: xmin = numpy.nanmin(x) |
|
1272 | if xmin == None: xmin = numpy.nanmin(x) | |
1199 | if xmax == None: xmax = numpy.nanmax(x) |
|
1273 | if xmax == None: xmax = numpy.nanmax(x) | |
1200 | if ymin == None: ymin = numpy.nanmin(zdB) |
|
1274 | if ymin == None: ymin = numpy.nanmin(zdB) | |
1201 | if ymax == None: ymax = numpy.nanmax(zdB)+2 |
|
1275 | if ymax == None: ymax = numpy.nanmax(zdB)+2 | |
1202 |
|
1276 | |||
1203 | self.isConfig = True |
|
1277 | self.isConfig = True | |
1204 |
|
1278 | |||
1205 | self.setWinTitle(title) |
|
1279 | self.setWinTitle(title) | |
1206 | for i in range(self.nplots): |
|
1280 | for i in range(self.nplots): | |
1207 | # title = "Channel %d: %4.2fdB" %(dataOut.channelList[i]+1, noisedB[i]) |
|
1281 | # title = "Channel %d: %4.2fdB" %(dataOut.channelList[i]+1, noisedB[i]) | |
1208 | title = "Height %4.1f km\nChannel %d:" %(cutHeight, listChannels[i]) |
|
1282 | title = "Height %4.1f km\nChannel %d:" %(cutHeight, listChannels[i]) | |
1209 | axes = self.axesList[i*self.__nsubplots] |
|
1283 | axes = self.axesList[i*self.__nsubplots] | |
1210 | if fit == False: |
|
1284 | if fit == False: | |
1211 | axes.pline(x, zdB[i,:], |
|
1285 | axes.pline(x, zdB[i,:], | |
1212 | xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, |
|
1286 | xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, | |
1213 | xlabel=xlabel, ylabel=ylabel, title=title |
|
1287 | xlabel=xlabel, ylabel=ylabel, title=title | |
1214 | ) |
|
1288 | ) | |
1215 | if fit == True: |
|
1289 | if fit == True: | |
1216 | fitline=spcFitLinedB[i,:] |
|
1290 | fitline=spcFitLinedB[i,:] | |
1217 | y=numpy.vstack([zdB[i,:],fitline] ) |
|
1291 | y=numpy.vstack([zdB[i,:],fitline] ) | |
1218 | legendlabels=['Data','Fitting'] |
|
1292 | legendlabels=['Data','Fitting'] | |
1219 | axes.pmultilineyaxis(x, y, |
|
1293 | axes.pmultilineyaxis(x, y, | |
1220 | xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, |
|
1294 | xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, | |
1221 | xlabel=xlabel, ylabel=ylabel, title=title, |
|
1295 | xlabel=xlabel, ylabel=ylabel, title=title, | |
1222 | legendlabels=legendlabels, marker=None, |
|
1296 | legendlabels=legendlabels, marker=None, | |
1223 | linestyle='solid', grid='both') |
|
1297 | linestyle='solid', grid='both') | |
1224 |
|
1298 | |||
1225 | self.draw() |
|
1299 | self.draw() | |
1226 |
|
1300 | |||
1227 | self.save(figpath=figpath, |
|
1301 | self.save(figpath=figpath, | |
1228 | figfile=figfile, |
|
1302 | figfile=figfile, | |
1229 | save=save, |
|
1303 | save=save, | |
1230 | ftp=ftp, |
|
1304 | ftp=ftp, | |
1231 | wr_period=wr_period, |
|
1305 | wr_period=wr_period, | |
1232 | thisDatetime=thisDatetime) |
|
1306 | thisDatetime=thisDatetime) | |
1233 |
|
1307 | |||
1234 |
|
1308 | |||
1235 | class EWDriftsPlot(Figure): |
|
1309 | class EWDriftsPlot(Figure): | |
1236 |
|
1310 | |||
1237 | __isConfig = None |
|
1311 | __isConfig = None | |
1238 | __nsubplots = None |
|
1312 | __nsubplots = None | |
1239 |
|
1313 | |||
1240 | WIDTHPROF = None |
|
1314 | WIDTHPROF = None | |
1241 | HEIGHTPROF = None |
|
1315 | HEIGHTPROF = None | |
1242 | PREFIX = 'drift' |
|
1316 | PREFIX = 'drift' | |
1243 |
|
1317 | |||
1244 | parameters = { |
|
1318 | parameters = { | |
1245 | 'id': global_type_string, |
|
1319 | 'id': global_type_string, | |
1246 | 'wintitle': global_type_string, |
|
1320 | 'wintitle': global_type_string, | |
1247 | 'channelList': global_type_string, |
|
1321 | 'channelList': global_type_string, | |
1248 | 'xmin': global_type_float, |
|
1322 | 'xmin': global_type_float, | |
1249 | 'xmax': global_type_float, |
|
1323 | 'xmax': global_type_float, | |
1250 | 'ymin': global_type_float, |
|
1324 | 'ymin': global_type_float, | |
1251 | 'ymax': global_type_float, |
|
1325 | 'ymax': global_type_float, | |
1252 | 'zmin': global_type_float, |
|
1326 | 'zmin': global_type_float, | |
1253 | 'zmax': global_type_float, |
|
1327 | 'zmax': global_type_float, | |
1254 | 'zmaxVertfloat': global_type_float, |
|
1328 | 'zmaxVertfloat': global_type_float, | |
1255 | 'zminVertfloat': global_type_float, |
|
1329 | 'zminVertfloat': global_type_float, | |
1256 | 'zmaxZonafloat': global_type_float, |
|
1330 | 'zmaxZonafloat': global_type_float, | |
1257 | 'zminZonafloat': global_type_float, |
|
1331 | 'zminZonafloat': global_type_float, | |
1258 | 'timerange': global_type_float, |
|
1332 | 'timerange': global_type_float, | |
1259 | 'SNRthresh': global_type_float, |
|
1333 | 'SNRthresh': global_type_float, | |
1260 | 'SNRmin': global_type_float, |
|
1334 | 'SNRmin': global_type_float, | |
1261 | 'SNRmax': global_type_float, |
|
1335 | 'SNRmax': global_type_float, | |
1262 | 'SNR_1': global_type_boolean, |
|
1336 | 'SNR_1': global_type_boolean, | |
1263 | 'save': global_type_boolean, |
|
1337 | 'save': global_type_boolean, | |
1264 | 'figpath': global_type_string, |
|
1338 | 'figpath': global_type_string, | |
1265 | 'lastone': global_type_float, |
|
1339 | 'lastone': global_type_float, | |
1266 | 'figfile': global_type_string, |
|
1340 | 'figfile': global_type_string, | |
1267 | 'ftp': global_type_string, |
|
1341 | 'ftp': global_type_string, | |
1268 | 'wr_period': global_type_integer, |
|
1342 | 'wr_period': global_type_integer, | |
1269 | 'show': global_type_string, |
|
1343 | 'show': global_type_string, | |
1270 | 'server': global_type_string, |
|
1344 | 'server': global_type_string, | |
1271 | 'folder': global_type_string, |
|
1345 | 'folder': global_type_string, | |
1272 | 'username': global_type_string, |
|
1346 | 'username': global_type_string, | |
1273 | 'password': global_type_string, |
|
1347 | 'password': global_type_string, | |
1274 | 'ftp_wei': global_type_integer, |
|
1348 | 'ftp_wei': global_type_integer, | |
1275 | 'exp_code': global_type_integer, |
|
1349 | 'exp_code': global_type_integer, | |
1276 | 'sub_exp_code': global_type_integer, |
|
1350 | 'sub_exp_code': global_type_integer, | |
1277 | 'plot_pos': global_type_integer, |
|
1351 | 'plot_pos': global_type_integer, | |
1278 | } |
|
1352 | } | |
1279 |
|
1353 | |||
1280 | def __init__(self, **kwargs): |
|
1354 | def __init__(self, **kwargs): | |
1281 | Figure.__init__(self, **kwargs) |
|
1355 | Figure.__init__(self, **kwargs) | |
1282 | self.timerange = 2*60*60 |
|
1356 | self.timerange = 2*60*60 | |
1283 | self.isConfig = False |
|
1357 | self.isConfig = False | |
1284 | self.__nsubplots = 1 |
|
1358 | self.__nsubplots = 1 | |
1285 |
|
1359 | |||
1286 | self.WIDTH = 800 |
|
1360 | self.WIDTH = 800 | |
1287 | self.HEIGHT = 150 |
|
1361 | self.HEIGHT = 150 | |
1288 | self.WIDTHPROF = 120 |
|
1362 | self.WIDTHPROF = 120 | |
1289 | self.HEIGHTPROF = 0 |
|
1363 | self.HEIGHTPROF = 0 | |
1290 | self.counter_imagwr = 0 |
|
1364 | self.counter_imagwr = 0 | |
1291 |
|
1365 | |||
1292 | self.PLOT_CODE = EWDRIFT_CODE |
|
1366 | self.PLOT_CODE = EWDRIFT_CODE | |
1293 |
|
1367 | |||
1294 | self.FTP_WEI = None |
|
1368 | self.FTP_WEI = None | |
1295 | self.EXP_CODE = None |
|
1369 | self.EXP_CODE = None | |
1296 | self.SUB_EXP_CODE = None |
|
1370 | self.SUB_EXP_CODE = None | |
1297 | self.PLOT_POS = None |
|
1371 | self.PLOT_POS = None | |
1298 | self.tmin = None |
|
1372 | self.tmin = None | |
1299 | self.tmax = None |
|
1373 | self.tmax = None | |
1300 |
|
1374 | |||
1301 | self.xmin = None |
|
1375 | self.xmin = None | |
1302 | self.xmax = None |
|
1376 | self.xmax = None | |
1303 |
|
1377 | |||
1304 | self.figfile = None |
|
1378 | self.figfile = None | |
1305 |
|
1379 | |||
1306 | def getSubplots(self): |
|
1380 | def getSubplots(self): | |
1307 |
|
1381 | |||
1308 | ncol = 1 |
|
1382 | ncol = 1 | |
1309 | nrow = self.nplots |
|
1383 | nrow = self.nplots | |
1310 |
|
1384 | |||
1311 | return nrow, ncol |
|
1385 | return nrow, ncol | |
1312 |
|
1386 | |||
1313 | def setup(self, id, nplots, wintitle, showprofile=True, show=True): |
|
1387 | def setup(self, id, nplots, wintitle, showprofile=True, show=True): | |
1314 |
|
1388 | |||
1315 | self.__showprofile = showprofile |
|
1389 | self.__showprofile = showprofile | |
1316 | self.nplots = nplots |
|
1390 | self.nplots = nplots | |
1317 |
|
1391 | |||
1318 | ncolspan = 1 |
|
1392 | ncolspan = 1 | |
1319 | colspan = 1 |
|
1393 | colspan = 1 | |
1320 |
|
1394 | |||
1321 | self.createFigure(id = id, |
|
1395 | self.createFigure(id = id, | |
1322 | wintitle = wintitle, |
|
1396 | wintitle = wintitle, | |
1323 | widthplot = self.WIDTH + self.WIDTHPROF, |
|
1397 | widthplot = self.WIDTH + self.WIDTHPROF, | |
1324 | heightplot = self.HEIGHT + self.HEIGHTPROF, |
|
1398 | heightplot = self.HEIGHT + self.HEIGHTPROF, | |
1325 | show=show) |
|
1399 | show=show) | |
1326 |
|
1400 | |||
1327 | nrow, ncol = self.getSubplots() |
|
1401 | nrow, ncol = self.getSubplots() | |
1328 |
|
1402 | |||
1329 | counter = 0 |
|
1403 | counter = 0 | |
1330 | for y in range(nrow): |
|
1404 | for y in range(nrow): | |
1331 | if counter >= self.nplots: |
|
1405 | if counter >= self.nplots: | |
1332 | break |
|
1406 | break | |
1333 |
|
1407 | |||
1334 | self.addAxes(nrow, ncol*ncolspan, y, 0, colspan, 1) |
|
1408 | self.addAxes(nrow, ncol*ncolspan, y, 0, colspan, 1) | |
1335 | counter += 1 |
|
1409 | counter += 1 | |
1336 |
|
1410 | |||
1337 | def run(self, dataOut, id, wintitle="", channelList=None, |
|
1411 | def run(self, dataOut, id, wintitle="", channelList=None, | |
1338 | xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None, |
|
1412 | xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None, | |
1339 | zmaxVertical = None, zminVertical = None, zmaxZonal = None, zminZonal = None, |
|
1413 | zmaxVertical = None, zminVertical = None, zmaxZonal = None, zminZonal = None, | |
1340 | timerange=None, SNRthresh = -numpy.inf, SNRmin = None, SNRmax = None, SNR_1 = False, |
|
1414 | timerange=None, SNRthresh = -numpy.inf, SNRmin = None, SNRmax = None, SNR_1 = False, | |
1341 | save=False, figpath='./', lastone=0,figfile=None, ftp=False, wr_period=1, show=True, |
|
1415 | save=False, figpath='./', lastone=0,figfile=None, ftp=False, wr_period=1, show=True, | |
1342 | server=None, folder=None, username=None, password=None, |
|
1416 | server=None, folder=None, username=None, password=None, | |
1343 | ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0): |
|
1417 | ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0): | |
1344 | """ |
|
1418 | """ | |
1345 |
|
1419 | |||
1346 | Input: |
|
1420 | Input: | |
1347 | dataOut : |
|
1421 | dataOut : | |
1348 | id : |
|
1422 | id : | |
1349 | wintitle : |
|
1423 | wintitle : | |
1350 | channelList : |
|
1424 | channelList : | |
1351 | showProfile : |
|
1425 | showProfile : | |
1352 | xmin : None, |
|
1426 | xmin : None, | |
1353 | xmax : None, |
|
1427 | xmax : None, | |
1354 | ymin : None, |
|
1428 | ymin : None, | |
1355 | ymax : None, |
|
1429 | ymax : None, | |
1356 | zmin : None, |
|
1430 | zmin : None, | |
1357 | zmax : None |
|
1431 | zmax : None | |
1358 | """ |
|
1432 | """ | |
1359 |
|
1433 | |||
1360 | if timerange is not None: |
|
1434 | if timerange is not None: | |
1361 | self.timerange = timerange |
|
1435 | self.timerange = timerange | |
1362 |
|
1436 | |||
1363 | tmin = None |
|
1437 | tmin = None | |
1364 | tmax = None |
|
1438 | tmax = None | |
1365 |
|
1439 | |||
1366 | x = dataOut.getTimeRange1(dataOut.outputInterval) |
|
1440 | x = dataOut.getTimeRange1(dataOut.outputInterval) | |
1367 | # y = dataOut.heightList |
|
1441 | # y = dataOut.heightList | |
1368 | y = dataOut.heightList |
|
1442 | y = dataOut.heightList | |
1369 |
|
1443 | |||
1370 | z = dataOut.data_output |
|
1444 | z = dataOut.data_output | |
1371 | nplots = z.shape[0] #Number of wind dimensions estimated |
|
1445 | nplots = z.shape[0] #Number of wind dimensions estimated | |
1372 | nplotsw = nplots |
|
1446 | nplotsw = nplots | |
1373 |
|
1447 | |||
1374 | #If there is a SNR function defined |
|
1448 | #If there is a SNR function defined | |
1375 | if dataOut.data_SNR is not None: |
|
1449 | if dataOut.data_SNR is not None: | |
1376 | nplots += 1 |
|
1450 | nplots += 1 | |
1377 | SNR = dataOut.data_SNR |
|
1451 | SNR = dataOut.data_SNR | |
1378 |
|
1452 | |||
1379 | if SNR_1: |
|
1453 | if SNR_1: | |
1380 | SNR += 1 |
|
1454 | SNR += 1 | |
1381 |
|
1455 | |||
1382 | SNRavg = numpy.average(SNR, axis=0) |
|
1456 | SNRavg = numpy.average(SNR, axis=0) | |
1383 |
|
1457 | |||
1384 | SNRdB = 10*numpy.log10(SNR) |
|
1458 | SNRdB = 10*numpy.log10(SNR) | |
1385 | SNRavgdB = 10*numpy.log10(SNRavg) |
|
1459 | SNRavgdB = 10*numpy.log10(SNRavg) | |
1386 |
|
1460 | |||
1387 | ind = numpy.where(SNRavg < 10**(SNRthresh/10))[0] |
|
1461 | ind = numpy.where(SNRavg < 10**(SNRthresh/10))[0] | |
1388 |
|
1462 | |||
1389 | for i in range(nplotsw): |
|
1463 | for i in range(nplotsw): | |
1390 | z[i,ind] = numpy.nan |
|
1464 | z[i,ind] = numpy.nan | |
1391 |
|
1465 | |||
1392 |
|
1466 | |||
1393 | showprofile = False |
|
1467 | showprofile = False | |
1394 | # thisDatetime = dataOut.datatime |
|
1468 | # thisDatetime = dataOut.datatime | |
1395 | thisDatetime = datetime.datetime.utcfromtimestamp(x[1]) |
|
1469 | thisDatetime = datetime.datetime.utcfromtimestamp(x[1]) | |
1396 | title = wintitle + " EW Drifts" |
|
1470 | title = wintitle + " EW Drifts" | |
1397 | xlabel = "" |
|
1471 | xlabel = "" | |
1398 | ylabel = "Height (Km)" |
|
1472 | ylabel = "Height (Km)" | |
1399 |
|
1473 | |||
1400 | if not self.isConfig: |
|
1474 | if not self.isConfig: | |
1401 |
|
1475 | |||
1402 | self.setup(id=id, |
|
1476 | self.setup(id=id, | |
1403 | nplots=nplots, |
|
1477 | nplots=nplots, | |
1404 | wintitle=wintitle, |
|
1478 | wintitle=wintitle, | |
1405 | showprofile=showprofile, |
|
1479 | showprofile=showprofile, | |
1406 | show=show) |
|
1480 | show=show) | |
1407 |
|
1481 | |||
1408 | self.xmin, self.xmax = self.getTimeLim(x, xmin, xmax, timerange) |
|
1482 | self.xmin, self.xmax = self.getTimeLim(x, xmin, xmax, timerange) | |
1409 |
|
1483 | |||
1410 | if ymin == None: ymin = numpy.nanmin(y) |
|
1484 | if ymin == None: ymin = numpy.nanmin(y) | |
1411 | if ymax == None: ymax = numpy.nanmax(y) |
|
1485 | if ymax == None: ymax = numpy.nanmax(y) | |
1412 |
|
1486 | |||
1413 | if zmaxZonal == None: zmaxZonal = numpy.nanmax(abs(z[0,:])) |
|
1487 | if zmaxZonal == None: zmaxZonal = numpy.nanmax(abs(z[0,:])) | |
1414 | if zminZonal == None: zminZonal = -zmaxZonal |
|
1488 | if zminZonal == None: zminZonal = -zmaxZonal | |
1415 | if zmaxVertical == None: zmaxVertical = numpy.nanmax(abs(z[1,:])) |
|
1489 | if zmaxVertical == None: zmaxVertical = numpy.nanmax(abs(z[1,:])) | |
1416 | if zminVertical == None: zminVertical = -zmaxVertical |
|
1490 | if zminVertical == None: zminVertical = -zmaxVertical | |
1417 |
|
1491 | |||
1418 | if dataOut.data_SNR is not None: |
|
1492 | if dataOut.data_SNR is not None: | |
1419 | if SNRmin == None: SNRmin = numpy.nanmin(SNRavgdB) |
|
1493 | if SNRmin == None: SNRmin = numpy.nanmin(SNRavgdB) | |
1420 | if SNRmax == None: SNRmax = numpy.nanmax(SNRavgdB) |
|
1494 | if SNRmax == None: SNRmax = numpy.nanmax(SNRavgdB) | |
1421 |
|
1495 | |||
1422 | self.FTP_WEI = ftp_wei |
|
1496 | self.FTP_WEI = ftp_wei | |
1423 | self.EXP_CODE = exp_code |
|
1497 | self.EXP_CODE = exp_code | |
1424 | self.SUB_EXP_CODE = sub_exp_code |
|
1498 | self.SUB_EXP_CODE = sub_exp_code | |
1425 | self.PLOT_POS = plot_pos |
|
1499 | self.PLOT_POS = plot_pos | |
1426 |
|
1500 | |||
1427 | self.name = thisDatetime.strftime("%Y%m%d_%H%M%S") |
|
1501 | self.name = thisDatetime.strftime("%Y%m%d_%H%M%S") | |
1428 | self.isConfig = True |
|
1502 | self.isConfig = True | |
1429 |
|
1503 | |||
1430 |
|
1504 | |||
1431 | self.setWinTitle(title) |
|
1505 | self.setWinTitle(title) | |
1432 |
|
1506 | |||
1433 | if ((self.xmax - x[1]) < (x[1]-x[0])): |
|
1507 | if ((self.xmax - x[1]) < (x[1]-x[0])): | |
1434 | x[1] = self.xmax |
|
1508 | x[1] = self.xmax | |
1435 |
|
1509 | |||
1436 | strWind = ['Zonal','Vertical'] |
|
1510 | strWind = ['Zonal','Vertical'] | |
1437 | strCb = 'Velocity (m/s)' |
|
1511 | strCb = 'Velocity (m/s)' | |
1438 | zmaxVector = [zmaxZonal, zmaxVertical] |
|
1512 | zmaxVector = [zmaxZonal, zmaxVertical] | |
1439 | zminVector = [zminZonal, zminVertical] |
|
1513 | zminVector = [zminZonal, zminVertical] | |
1440 |
|
1514 | |||
1441 | for i in range(nplotsw): |
|
1515 | for i in range(nplotsw): | |
1442 |
|
1516 | |||
1443 | title = "%s Drifts: %s" %(strWind[i], thisDatetime.strftime("%Y/%m/%d %H:%M:%S")) |
|
1517 | title = "%s Drifts: %s" %(strWind[i], thisDatetime.strftime("%Y/%m/%d %H:%M:%S")) | |
1444 | axes = self.axesList[i*self.__nsubplots] |
|
1518 | axes = self.axesList[i*self.__nsubplots] | |
1445 |
|
1519 | |||
1446 | z1 = z[i,:].reshape((1,-1)) |
|
1520 | z1 = z[i,:].reshape((1,-1)) | |
1447 |
|
1521 | |||
1448 | axes.pcolorbuffer(x, y, z1, |
|
1522 | axes.pcolorbuffer(x, y, z1, | |
1449 | xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=zminVector[i], zmax=zmaxVector[i], |
|
1523 | xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=zminVector[i], zmax=zmaxVector[i], | |
1450 | xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True, |
|
1524 | xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True, | |
1451 | ticksize=9, cblabel=strCb, cbsize="1%", colormap="RdBu_r") |
|
1525 | ticksize=9, cblabel=strCb, cbsize="1%", colormap="RdBu_r") | |
1452 |
|
1526 | |||
1453 | if dataOut.data_SNR is not None: |
|
1527 | if dataOut.data_SNR is not None: | |
1454 | i += 1 |
|
1528 | i += 1 | |
1455 | if SNR_1: |
|
1529 | if SNR_1: | |
1456 | title = "Signal Noise Ratio + 1 (SNR+1): %s" %(thisDatetime.strftime("%Y/%m/%d %H:%M:%S")) |
|
1530 | title = "Signal Noise Ratio + 1 (SNR+1): %s" %(thisDatetime.strftime("%Y/%m/%d %H:%M:%S")) | |
1457 | else: |
|
1531 | else: | |
1458 | title = "Signal Noise Ratio (SNR): %s" %(thisDatetime.strftime("%Y/%m/%d %H:%M:%S")) |
|
1532 | title = "Signal Noise Ratio (SNR): %s" %(thisDatetime.strftime("%Y/%m/%d %H:%M:%S")) | |
1459 | axes = self.axesList[i*self.__nsubplots] |
|
1533 | axes = self.axesList[i*self.__nsubplots] | |
1460 | SNRavgdB = SNRavgdB.reshape((1,-1)) |
|
1534 | SNRavgdB = SNRavgdB.reshape((1,-1)) | |
1461 |
|
1535 | |||
1462 | axes.pcolorbuffer(x, y, SNRavgdB, |
|
1536 | axes.pcolorbuffer(x, y, SNRavgdB, | |
1463 | xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=SNRmin, zmax=SNRmax, |
|
1537 | xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=SNRmin, zmax=SNRmax, | |
1464 | xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True, |
|
1538 | xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True, | |
1465 | ticksize=9, cblabel='', cbsize="1%", colormap="jet") |
|
1539 | ticksize=9, cblabel='', cbsize="1%", colormap="jet") | |
1466 |
|
1540 | |||
1467 | self.draw() |
|
1541 | self.draw() | |
1468 |
|
1542 | |||
1469 | if x[1] >= self.axesList[0].xmax: |
|
1543 | if x[1] >= self.axesList[0].xmax: | |
1470 | self.counter_imagwr = wr_period |
|
1544 | self.counter_imagwr = wr_period | |
1471 | self.isConfig = False |
|
1545 | self.isConfig = False | |
1472 | self.figfile = None |
|
1546 | self.figfile = None | |
1473 |
|
1547 | |||
1474 |
|
1548 | |||
1475 |
|
1549 | |||
1476 |
|
1550 | |||
1477 | class PhasePlot(Figure): |
|
1551 | class PhasePlot(Figure): | |
1478 |
|
1552 | |||
1479 | __isConfig = None |
|
1553 | __isConfig = None | |
1480 | __nsubplots = None |
|
1554 | __nsubplots = None | |
1481 |
|
1555 | |||
1482 | PREFIX = 'mphase' |
|
1556 | PREFIX = 'mphase' | |
1483 |
|
1557 | |||
|
1558 | parameters = { | |||
|
1559 | 'id': global_type_string, | |||
|
1560 | 'wintitle': global_type_string, | |||
|
1561 | 'pairsList': global_type_pairsList, | |||
|
1562 | 'showprofile': global_type_boolean, | |||
|
1563 | 'xmin': global_type_float, | |||
|
1564 | 'xmax': global_type_float, | |||
|
1565 | 'ymin': global_type_float, | |||
|
1566 | 'ymax': global_type_float, | |||
|
1567 | 'timerange': global_type_float, | |||
|
1568 | 'save': global_type_boolean, | |||
|
1569 | 'figpath': global_type_string, | |||
|
1570 | 'figfile': global_type_string, | |||
|
1571 | 'show': global_type_boolean, | |||
|
1572 | 'ftp': global_type_boolean, | |||
|
1573 | 'wr_period': global_type_integer, | |||
|
1574 | 'server': global_type_string, | |||
|
1575 | 'folder': global_type_string, | |||
|
1576 | 'username': global_type_string, | |||
|
1577 | 'password': global_type_string, | |||
|
1578 | 'ftp_wei': global_type_integer, | |||
|
1579 | 'exp_code': global_type_integer, | |||
|
1580 | 'sub_exp_code': global_type_integer, | |||
|
1581 | 'plot_pos': global_type_integer, | |||
|
1582 | } | |||
|
1583 | ||||
1484 | def __init__(self, **kwargs): |
|
1584 | def __init__(self, **kwargs): | |
1485 | Figure.__init__(self, **kwargs) |
|
1585 | Figure.__init__(self, **kwargs) | |
1486 | self.timerange = 24*60*60 |
|
1586 | self.timerange = 24*60*60 | |
1487 | self.isConfig = False |
|
1587 | self.isConfig = False | |
1488 | self.__nsubplots = 1 |
|
1588 | self.__nsubplots = 1 | |
1489 | self.counter_imagwr = 0 |
|
1589 | self.counter_imagwr = 0 | |
1490 | self.WIDTH = 600 |
|
1590 | self.WIDTH = 600 | |
1491 | self.HEIGHT = 300 |
|
1591 | self.HEIGHT = 300 | |
1492 | self.WIDTHPROF = 120 |
|
1592 | self.WIDTHPROF = 120 | |
1493 | self.HEIGHTPROF = 0 |
|
1593 | self.HEIGHTPROF = 0 | |
1494 | self.xdata = None |
|
1594 | self.xdata = None | |
1495 | self.ydata = None |
|
1595 | self.ydata = None | |
1496 |
|
1596 | |||
1497 | self.PLOT_CODE = MPHASE_CODE |
|
1597 | self.PLOT_CODE = MPHASE_CODE | |
1498 |
|
1598 | |||
1499 | self.FTP_WEI = None |
|
1599 | self.FTP_WEI = None | |
1500 | self.EXP_CODE = None |
|
1600 | self.EXP_CODE = None | |
1501 | self.SUB_EXP_CODE = None |
|
1601 | self.SUB_EXP_CODE = None | |
1502 | self.PLOT_POS = None |
|
1602 | self.PLOT_POS = None | |
1503 |
|
1603 | |||
1504 |
|
1604 | |||
1505 | self.filename_phase = None |
|
1605 | self.filename_phase = None | |
1506 |
|
1606 | |||
1507 | self.figfile = None |
|
1607 | self.figfile = None | |
1508 |
|
1608 | |||
1509 | def getSubplots(self): |
|
1609 | def getSubplots(self): | |
1510 |
|
1610 | |||
1511 | ncol = 1 |
|
1611 | ncol = 1 | |
1512 | nrow = 1 |
|
1612 | nrow = 1 | |
1513 |
|
1613 | |||
1514 | return nrow, ncol |
|
1614 | return nrow, ncol | |
1515 |
|
1615 | |||
1516 | def setup(self, id, nplots, wintitle, showprofile=True, show=True): |
|
1616 | def setup(self, id, nplots, wintitle, showprofile=True, show=True): | |
1517 |
|
1617 | |||
1518 | self.__showprofile = showprofile |
|
1618 | self.__showprofile = showprofile | |
1519 | self.nplots = nplots |
|
1619 | self.nplots = nplots | |
1520 |
|
1620 | |||
1521 | ncolspan = 7 |
|
1621 | ncolspan = 7 | |
1522 | colspan = 6 |
|
1622 | colspan = 6 | |
1523 | self.__nsubplots = 2 |
|
1623 | self.__nsubplots = 2 | |
1524 |
|
1624 | |||
1525 | self.createFigure(id = id, |
|
1625 | self.createFigure(id = id, | |
1526 | wintitle = wintitle, |
|
1626 | wintitle = wintitle, | |
1527 | widthplot = self.WIDTH+self.WIDTHPROF, |
|
1627 | widthplot = self.WIDTH+self.WIDTHPROF, | |
1528 | heightplot = self.HEIGHT+self.HEIGHTPROF, |
|
1628 | heightplot = self.HEIGHT+self.HEIGHTPROF, | |
1529 | show=show) |
|
1629 | show=show) | |
1530 |
|
1630 | |||
1531 | nrow, ncol = self.getSubplots() |
|
1631 | nrow, ncol = self.getSubplots() | |
1532 |
|
1632 | |||
1533 | self.addAxes(nrow, ncol*ncolspan, 0, 0, colspan, 1) |
|
1633 | self.addAxes(nrow, ncol*ncolspan, 0, 0, colspan, 1) | |
1534 |
|
1634 | |||
1535 |
|
1635 | |||
1536 | def run(self, dataOut, id, wintitle="", pairsList=None, showprofile='True', |
|
1636 | def run(self, dataOut, id, wintitle="", pairsList=None, showprofile='True', | |
1537 | xmin=None, xmax=None, ymin=None, ymax=None, |
|
1637 | xmin=None, xmax=None, ymin=None, ymax=None, | |
1538 | timerange=None, |
|
1638 | timerange=None, | |
1539 | save=False, figpath='./', figfile=None, show=True, ftp=False, wr_period=1, |
|
1639 | save=False, figpath='./', figfile=None, show=True, ftp=False, wr_period=1, | |
1540 | server=None, folder=None, username=None, password=None, |
|
1640 | server=None, folder=None, username=None, password=None, | |
1541 | ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0): |
|
1641 | ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0): | |
1542 |
|
1642 | |||
1543 |
|
1643 | |||
1544 | tmin = None |
|
1644 | tmin = None | |
1545 | tmax = None |
|
1645 | tmax = None | |
1546 | x = dataOut.getTimeRange1(dataOut.outputInterval) |
|
1646 | x = dataOut.getTimeRange1(dataOut.outputInterval) | |
1547 | y = dataOut.getHeiRange() |
|
1647 | y = dataOut.getHeiRange() | |
1548 |
|
1648 | |||
1549 |
|
1649 | |||
1550 | #thisDatetime = dataOut.datatime |
|
1650 | #thisDatetime = dataOut.datatime | |
1551 | thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.ltctime) |
|
1651 | thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.ltctime) | |
1552 | title = wintitle + " Phase of Beacon Signal" # : %s" %(thisDatetime.strftime("%d-%b-%Y")) |
|
1652 | title = wintitle + " Phase of Beacon Signal" # : %s" %(thisDatetime.strftime("%d-%b-%Y")) | |
1553 | xlabel = "Local Time" |
|
1653 | xlabel = "Local Time" | |
1554 | ylabel = "Phase" |
|
1654 | ylabel = "Phase" | |
1555 |
|
1655 | |||
1556 |
|
1656 | |||
1557 | #phase = numpy.zeros((len(pairsIndexList),len(dataOut.beacon_heiIndexList))) |
|
1657 | #phase = numpy.zeros((len(pairsIndexList),len(dataOut.beacon_heiIndexList))) | |
1558 | phase_beacon = dataOut.data_output |
|
1658 | phase_beacon = dataOut.data_output | |
1559 | update_figfile = False |
|
1659 | update_figfile = False | |
1560 |
|
1660 | |||
1561 | if not self.isConfig: |
|
1661 | if not self.isConfig: | |
1562 |
|
1662 | |||
1563 | self.nplots = phase_beacon.size |
|
1663 | self.nplots = phase_beacon.size | |
1564 |
|
1664 | |||
1565 | self.setup(id=id, |
|
1665 | self.setup(id=id, | |
1566 | nplots=self.nplots, |
|
1666 | nplots=self.nplots, | |
1567 | wintitle=wintitle, |
|
1667 | wintitle=wintitle, | |
1568 | showprofile=showprofile, |
|
1668 | showprofile=showprofile, | |
1569 | show=show) |
|
1669 | show=show) | |
1570 |
|
1670 | |||
1571 | if timerange is not None: |
|
1671 | if timerange is not None: | |
1572 | self.timerange = timerange |
|
1672 | self.timerange = timerange | |
1573 |
|
1673 | |||
1574 | self.xmin, self.xmax = self.getTimeLim(x, xmin, xmax, timerange) |
|
1674 | self.xmin, self.xmax = self.getTimeLim(x, xmin, xmax, timerange) | |
1575 |
|
1675 | |||
1576 | if ymin == None: ymin = numpy.nanmin(phase_beacon) - 10.0 |
|
1676 | if ymin == None: ymin = numpy.nanmin(phase_beacon) - 10.0 | |
1577 | if ymax == None: ymax = numpy.nanmax(phase_beacon) + 10.0 |
|
1677 | if ymax == None: ymax = numpy.nanmax(phase_beacon) + 10.0 | |
1578 |
|
1678 | |||
1579 | self.FTP_WEI = ftp_wei |
|
1679 | self.FTP_WEI = ftp_wei | |
1580 | self.EXP_CODE = exp_code |
|
1680 | self.EXP_CODE = exp_code | |
1581 | self.SUB_EXP_CODE = sub_exp_code |
|
1681 | self.SUB_EXP_CODE = sub_exp_code | |
1582 | self.PLOT_POS = plot_pos |
|
1682 | self.PLOT_POS = plot_pos | |
1583 |
|
1683 | |||
1584 | self.name = thisDatetime.strftime("%Y%m%d_%H%M%S") |
|
1684 | self.name = thisDatetime.strftime("%Y%m%d_%H%M%S") | |
1585 | self.isConfig = True |
|
1685 | self.isConfig = True | |
1586 | self.figfile = figfile |
|
1686 | self.figfile = figfile | |
1587 | self.xdata = numpy.array([]) |
|
1687 | self.xdata = numpy.array([]) | |
1588 | self.ydata = numpy.array([]) |
|
1688 | self.ydata = numpy.array([]) | |
1589 |
|
1689 | |||
1590 | #open file beacon phase |
|
1690 | #open file beacon phase | |
1591 | path = '%s%03d' %(self.PREFIX, self.id) |
|
1691 | path = '%s%03d' %(self.PREFIX, self.id) | |
1592 | beacon_file = os.path.join(path,'%s.txt'%self.name) |
|
1692 | beacon_file = os.path.join(path,'%s.txt'%self.name) | |
1593 | self.filename_phase = os.path.join(figpath,beacon_file) |
|
1693 | self.filename_phase = os.path.join(figpath,beacon_file) | |
1594 | update_figfile = True |
|
1694 | update_figfile = True | |
1595 |
|
1695 | |||
1596 |
|
1696 | |||
1597 | #store data beacon phase |
|
1697 | #store data beacon phase | |
1598 | #self.save_data(self.filename_phase, phase_beacon, thisDatetime) |
|
1698 | #self.save_data(self.filename_phase, phase_beacon, thisDatetime) | |
1599 |
|
1699 | |||
1600 | self.setWinTitle(title) |
|
1700 | self.setWinTitle(title) | |
1601 |
|
1701 | |||
1602 |
|
1702 | |||
1603 | title = "Phase Offset %s" %(thisDatetime.strftime("%Y/%m/%d %H:%M:%S")) |
|
1703 | title = "Phase Offset %s" %(thisDatetime.strftime("%Y/%m/%d %H:%M:%S")) | |
1604 |
|
1704 | |||
1605 | legendlabels = ["phase %d"%(chan) for chan in numpy.arange(self.nplots)] |
|
1705 | legendlabels = ["phase %d"%(chan) for chan in numpy.arange(self.nplots)] | |
1606 |
|
1706 | |||
1607 | axes = self.axesList[0] |
|
1707 | axes = self.axesList[0] | |
1608 |
|
1708 | |||
1609 | self.xdata = numpy.hstack((self.xdata, x[0:1])) |
|
1709 | self.xdata = numpy.hstack((self.xdata, x[0:1])) | |
1610 |
|
1710 | |||
1611 | if len(self.ydata)==0: |
|
1711 | if len(self.ydata)==0: | |
1612 | self.ydata = phase_beacon.reshape(-1,1) |
|
1712 | self.ydata = phase_beacon.reshape(-1,1) | |
1613 | else: |
|
1713 | else: | |
1614 | self.ydata = numpy.hstack((self.ydata, phase_beacon.reshape(-1,1))) |
|
1714 | self.ydata = numpy.hstack((self.ydata, phase_beacon.reshape(-1,1))) | |
1615 |
|
1715 | |||
1616 |
|
1716 | |||
1617 | axes.pmultilineyaxis(x=self.xdata, y=self.ydata, |
|
1717 | axes.pmultilineyaxis(x=self.xdata, y=self.ydata, | |
1618 | xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, |
|
1718 | xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, | |
1619 | xlabel=xlabel, ylabel=ylabel, title=title, legendlabels=legendlabels, marker='x', markersize=8, linestyle="solid", |
|
1719 | xlabel=xlabel, ylabel=ylabel, title=title, legendlabels=legendlabels, marker='x', markersize=8, linestyle="solid", | |
1620 | XAxisAsTime=True, grid='both' |
|
1720 | XAxisAsTime=True, grid='both' | |
1621 | ) |
|
1721 | ) | |
1622 |
|
1722 | |||
1623 | self.draw() |
|
1723 | self.draw() | |
1624 |
|
1724 | |||
1625 | self.save(figpath=figpath, |
|
1725 | self.save(figpath=figpath, | |
1626 | figfile=figfile, |
|
1726 | figfile=figfile, | |
1627 | save=save, |
|
1727 | save=save, | |
1628 | ftp=ftp, |
|
1728 | ftp=ftp, | |
1629 | wr_period=wr_period, |
|
1729 | wr_period=wr_period, | |
1630 | thisDatetime=thisDatetime, |
|
1730 | thisDatetime=thisDatetime, | |
1631 | update_figfile=update_figfile) |
|
1731 | update_figfile=update_figfile) | |
1632 |
|
1732 | |||
1633 | if dataOut.ltctime + dataOut.outputInterval >= self.xmax: |
|
1733 | if dataOut.ltctime + dataOut.outputInterval >= self.xmax: | |
1634 | self.counter_imagwr = wr_period |
|
1734 | self.counter_imagwr = wr_period | |
1635 | self.isConfig = False |
|
1735 | self.isConfig = False | |
1636 | update_figfile = True |
|
1736 | update_figfile = True | |
1637 |
|
1737 | |||
1638 |
|
1738 | |||
1639 |
|
1739 | |||
1640 | class NSMeteorDetection1Plot(Figure): |
|
1740 | class NSMeteorDetection1Plot(Figure): | |
1641 |
|
1741 | |||
1642 | isConfig = None |
|
1742 | isConfig = None | |
1643 | __nsubplots = None |
|
1743 | __nsubplots = None | |
1644 |
|
1744 | |||
1645 | WIDTHPROF = None |
|
1745 | WIDTHPROF = None | |
1646 | HEIGHTPROF = None |
|
1746 | HEIGHTPROF = None | |
1647 | PREFIX = 'nsm' |
|
1747 | PREFIX = 'nsm' | |
1648 |
|
1748 | |||
1649 | zminList = None |
|
1749 | zminList = None | |
1650 | zmaxList = None |
|
1750 | zmaxList = None | |
1651 | cmapList = None |
|
1751 | cmapList = None | |
1652 | titleList = None |
|
1752 | titleList = None | |
1653 | nPairs = None |
|
1753 | nPairs = None | |
1654 | nChannels = None |
|
1754 | nChannels = None | |
1655 | nParam = None |
|
1755 | nParam = None | |
1656 |
|
1756 | |||
1657 | parameters = { |
|
1757 | parameters = { | |
1658 | 'id': global_type_string, |
|
1758 | 'id': global_type_string, | |
1659 | 'wintitle': global_type_string, |
|
1759 | 'wintitle': global_type_string, | |
1660 | 'channelList': global_type_list, |
|
1760 | 'channelList': global_type_list, | |
1661 | 'showprofile': global_type_boolean, |
|
1761 | 'showprofile': global_type_boolean, | |
1662 | 'xmin': global_type_float, |
|
1762 | 'xmin': global_type_float, | |
1663 | 'xmax': global_type_float, |
|
1763 | 'xmax': global_type_float, | |
1664 | 'ymin': global_type_float, |
|
1764 | 'ymin': global_type_float, | |
1665 | 'ymax': global_type_float, |
|
1765 | 'ymax': global_type_float, | |
1666 | 'SNRmin': global_type_float, |
|
1766 | 'SNRmin': global_type_float, | |
1667 | 'SNRmax': global_type_float, |
|
1767 | 'SNRmax': global_type_float, | |
1668 | 'vmin': global_type_float, |
|
1768 | 'vmin': global_type_float, | |
1669 | 'vmax': global_type_float, |
|
1769 | 'vmax': global_type_float, | |
1670 | 'wmin': global_type_float, |
|
1770 | 'wmin': global_type_float, | |
1671 | 'wmax': global_type_float, |
|
1771 | 'wmax': global_type_float, | |
1672 | 'mode': global_type_string, |
|
1772 | 'mode': global_type_string, | |
1673 | 'save': global_type_boolean, |
|
1773 | 'save': global_type_boolean, | |
1674 | 'figpath': global_type_string, |
|
1774 | 'figpath': global_type_string, | |
1675 | 'figfile': global_type_string, |
|
1775 | 'figfile': global_type_string, | |
1676 | 'show': global_type_boolean, |
|
1776 | 'show': global_type_boolean, | |
1677 | 'ftp': global_type_string, |
|
1777 | 'ftp': global_type_string, | |
1678 | 'wr_period': global_type_integer, |
|
1778 | 'wr_period': global_type_integer, | |
1679 | 'server': global_type_string, |
|
1779 | 'server': global_type_string, | |
1680 | 'folder': global_type_string, |
|
1780 | 'folder': global_type_string, | |
1681 | 'username': global_type_string, |
|
1781 | 'username': global_type_string, | |
1682 | 'password': global_type_string, |
|
1782 | 'password': global_type_string, | |
1683 | 'ftp_wei': global_type_integer, |
|
1783 | 'ftp_wei': global_type_integer, | |
1684 | 'exp_code': global_type_integer, |
|
1784 | 'exp_code': global_type_integer, | |
1685 | 'sub_exp_code': global_type_integer, |
|
1785 | 'sub_exp_code': global_type_integer, | |
1686 | 'plot_pos': global_type_integer, |
|
1786 | 'plot_pos': global_type_integer, | |
1687 | 'realtime': global_type_boolean, |
|
1787 | 'realtime': global_type_boolean, | |
1688 | 'xaxis': global_type_string, |
|
1788 | 'xaxis': global_type_string, | |
1689 | } |
|
1789 | } | |
1690 |
|
1790 | |||
1691 | def __init__(self, **kwargs): |
|
1791 | def __init__(self, **kwargs): | |
1692 | Figure.__init__(self, **kwargs) |
|
1792 | Figure.__init__(self, **kwargs) | |
1693 | self.isConfig = False |
|
1793 | self.isConfig = False | |
1694 | self.__nsubplots = 1 |
|
1794 | self.__nsubplots = 1 | |
1695 |
|
1795 | |||
1696 | self.WIDTH = 750 |
|
1796 | self.WIDTH = 750 | |
1697 | self.HEIGHT = 250 |
|
1797 | self.HEIGHT = 250 | |
1698 | self.WIDTHPROF = 120 |
|
1798 | self.WIDTHPROF = 120 | |
1699 | self.HEIGHTPROF = 0 |
|
1799 | self.HEIGHTPROF = 0 | |
1700 | self.counter_imagwr = 0 |
|
1800 | self.counter_imagwr = 0 | |
1701 |
|
1801 | |||
1702 | self.PLOT_CODE = SPEC_CODE |
|
1802 | self.PLOT_CODE = SPEC_CODE | |
1703 |
|
1803 | |||
1704 | self.FTP_WEI = None |
|
1804 | self.FTP_WEI = None | |
1705 | self.EXP_CODE = None |
|
1805 | self.EXP_CODE = None | |
1706 | self.SUB_EXP_CODE = None |
|
1806 | self.SUB_EXP_CODE = None | |
1707 | self.PLOT_POS = None |
|
1807 | self.PLOT_POS = None | |
1708 |
|
1808 | |||
1709 | self.__xfilter_ena = False |
|
1809 | self.__xfilter_ena = False | |
1710 | self.__yfilter_ena = False |
|
1810 | self.__yfilter_ena = False | |
1711 |
|
1811 | |||
1712 | def getSubplots(self): |
|
1812 | def getSubplots(self): | |
1713 |
|
1813 | |||
1714 | ncol = 3 |
|
1814 | ncol = 3 | |
1715 | nrow = int(numpy.ceil(self.nplots/3.0)) |
|
1815 | nrow = int(numpy.ceil(self.nplots/3.0)) | |
1716 |
|
1816 | |||
1717 | return nrow, ncol |
|
1817 | return nrow, ncol | |
1718 |
|
1818 | |||
1719 | def setup(self, id, nplots, wintitle, show=True): |
|
1819 | def setup(self, id, nplots, wintitle, show=True): | |
1720 |
|
1820 | |||
1721 | self.nplots = nplots |
|
1821 | self.nplots = nplots | |
1722 |
|
1822 | |||
1723 | ncolspan = 1 |
|
1823 | ncolspan = 1 | |
1724 | colspan = 1 |
|
1824 | colspan = 1 | |
1725 |
|
1825 | |||
1726 | self.createFigure(id = id, |
|
1826 | self.createFigure(id = id, | |
1727 | wintitle = wintitle, |
|
1827 | wintitle = wintitle, | |
1728 | widthplot = self.WIDTH + self.WIDTHPROF, |
|
1828 | widthplot = self.WIDTH + self.WIDTHPROF, | |
1729 | heightplot = self.HEIGHT + self.HEIGHTPROF, |
|
1829 | heightplot = self.HEIGHT + self.HEIGHTPROF, | |
1730 | show=show) |
|
1830 | show=show) | |
1731 |
|
1831 | |||
1732 | nrow, ncol = self.getSubplots() |
|
1832 | nrow, ncol = self.getSubplots() | |
1733 |
|
1833 | |||
1734 | counter = 0 |
|
1834 | counter = 0 | |
1735 | for y in range(nrow): |
|
1835 | for y in range(nrow): | |
1736 | for x in range(ncol): |
|
1836 | for x in range(ncol): | |
1737 |
|
1837 | |||
1738 | if counter >= self.nplots: |
|
1838 | if counter >= self.nplots: | |
1739 | break |
|
1839 | break | |
1740 |
|
1840 | |||
1741 | self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan, colspan, 1) |
|
1841 | self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan, colspan, 1) | |
1742 |
|
1842 | |||
1743 | counter += 1 |
|
1843 | counter += 1 | |
1744 |
|
1844 | |||
1745 | def run(self, dataOut, id, wintitle="", channelList=None, showprofile=True, |
|
1845 | def run(self, dataOut, id, wintitle="", channelList=None, showprofile=True, | |
1746 | xmin=None, xmax=None, ymin=None, ymax=None, SNRmin=None, SNRmax=None, |
|
1846 | xmin=None, xmax=None, ymin=None, ymax=None, SNRmin=None, SNRmax=None, | |
1747 | vmin=None, vmax=None, wmin=None, wmax=None, mode = 'SA', |
|
1847 | vmin=None, vmax=None, wmin=None, wmax=None, mode = 'SA', | |
1748 | save=False, figpath='./', figfile=None, show=True, ftp=False, wr_period=1, |
|
1848 | save=False, figpath='./', figfile=None, show=True, ftp=False, wr_period=1, | |
1749 | server=None, folder=None, username=None, password=None, |
|
1849 | server=None, folder=None, username=None, password=None, | |
1750 | ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0, realtime=False, |
|
1850 | ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0, realtime=False, | |
1751 | xaxis="frequency"): |
|
1851 | xaxis="frequency"): | |
1752 |
|
1852 | |||
1753 | """ |
|
1853 | """ | |
1754 |
|
1854 | |||
1755 | Input: |
|
1855 | Input: | |
1756 | dataOut : |
|
1856 | dataOut : | |
1757 | id : |
|
1857 | id : | |
1758 | wintitle : |
|
1858 | wintitle : | |
1759 | channelList : |
|
1859 | channelList : | |
1760 | showProfile : |
|
1860 | showProfile : | |
1761 | xmin : None, |
|
1861 | xmin : None, | |
1762 | xmax : None, |
|
1862 | xmax : None, | |
1763 | ymin : None, |
|
1863 | ymin : None, | |
1764 | ymax : None, |
|
1864 | ymax : None, | |
1765 | zmin : None, |
|
1865 | zmin : None, | |
1766 | zmax : None |
|
1866 | zmax : None | |
1767 | """ |
|
1867 | """ | |
1768 | #SEPARAR EN DOS PLOTS |
|
1868 | #SEPARAR EN DOS PLOTS | |
1769 | nParam = dataOut.data_param.shape[1] - 3 |
|
1869 | nParam = dataOut.data_param.shape[1] - 3 | |
1770 |
|
1870 | |||
1771 | utctime = dataOut.data_param[0,0] |
|
1871 | utctime = dataOut.data_param[0,0] | |
1772 | tmet = dataOut.data_param[:,1].astype(int) |
|
1872 | tmet = dataOut.data_param[:,1].astype(int) | |
1773 | hmet = dataOut.data_param[:,2].astype(int) |
|
1873 | hmet = dataOut.data_param[:,2].astype(int) | |
1774 |
|
1874 | |||
1775 | x = dataOut.abscissaList |
|
1875 | x = dataOut.abscissaList | |
1776 | y = dataOut.heightList |
|
1876 | y = dataOut.heightList | |
1777 |
|
1877 | |||
1778 | z = numpy.zeros((nParam, y.size, x.size - 1)) |
|
1878 | z = numpy.zeros((nParam, y.size, x.size - 1)) | |
1779 | z[:,:] = numpy.nan |
|
1879 | z[:,:] = numpy.nan | |
1780 | z[:,hmet,tmet] = dataOut.data_param[:,3:].T |
|
1880 | z[:,hmet,tmet] = dataOut.data_param[:,3:].T | |
1781 | z[0,:,:] = 10*numpy.log10(z[0,:,:]) |
|
1881 | z[0,:,:] = 10*numpy.log10(z[0,:,:]) | |
1782 |
|
1882 | |||
1783 | xlabel = "Time (s)" |
|
1883 | xlabel = "Time (s)" | |
1784 | ylabel = "Range (km)" |
|
1884 | ylabel = "Range (km)" | |
1785 |
|
1885 | |||
1786 | thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.ltctime) |
|
1886 | thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.ltctime) | |
1787 |
|
1887 | |||
1788 | if not self.isConfig: |
|
1888 | if not self.isConfig: | |
1789 |
|
1889 | |||
1790 | nplots = nParam |
|
1890 | nplots = nParam | |
1791 |
|
1891 | |||
1792 | self.setup(id=id, |
|
1892 | self.setup(id=id, | |
1793 | nplots=nplots, |
|
1893 | nplots=nplots, | |
1794 | wintitle=wintitle, |
|
1894 | wintitle=wintitle, | |
1795 | show=show) |
|
1895 | show=show) | |
1796 |
|
1896 | |||
1797 | if xmin is None: xmin = numpy.nanmin(x) |
|
1897 | if xmin is None: xmin = numpy.nanmin(x) | |
1798 | if xmax is None: xmax = numpy.nanmax(x) |
|
1898 | if xmax is None: xmax = numpy.nanmax(x) | |
1799 | if ymin is None: ymin = numpy.nanmin(y) |
|
1899 | if ymin is None: ymin = numpy.nanmin(y) | |
1800 | if ymax is None: ymax = numpy.nanmax(y) |
|
1900 | if ymax is None: ymax = numpy.nanmax(y) | |
1801 | if SNRmin is None: SNRmin = numpy.nanmin(z[0,:]) |
|
1901 | if SNRmin is None: SNRmin = numpy.nanmin(z[0,:]) | |
1802 | if SNRmax is None: SNRmax = numpy.nanmax(z[0,:]) |
|
1902 | if SNRmax is None: SNRmax = numpy.nanmax(z[0,:]) | |
1803 | if vmax is None: vmax = numpy.nanmax(numpy.abs(z[1,:])) |
|
1903 | if vmax is None: vmax = numpy.nanmax(numpy.abs(z[1,:])) | |
1804 | if vmin is None: vmin = -vmax |
|
1904 | if vmin is None: vmin = -vmax | |
1805 | if wmin is None: wmin = 0 |
|
1905 | if wmin is None: wmin = 0 | |
1806 | if wmax is None: wmax = 50 |
|
1906 | if wmax is None: wmax = 50 | |
1807 |
|
1907 | |||
1808 | pairsList = dataOut.groupList |
|
1908 | pairsList = dataOut.groupList | |
1809 | self.nPairs = len(dataOut.groupList) |
|
1909 | self.nPairs = len(dataOut.groupList) | |
1810 |
|
1910 | |||
1811 | zminList = [SNRmin, vmin, cmin] + [pmin]*self.nPairs |
|
1911 | zminList = [SNRmin, vmin, cmin] + [pmin]*self.nPairs | |
1812 | zmaxList = [SNRmax, vmax, cmax] + [pmax]*self.nPairs |
|
1912 | zmaxList = [SNRmax, vmax, cmax] + [pmax]*self.nPairs | |
1813 | titleList = ["SNR","Radial Velocity","Coherence"] |
|
1913 | titleList = ["SNR","Radial Velocity","Coherence"] | |
1814 | cmapList = ["jet","RdBu_r","jet"] |
|
1914 | cmapList = ["jet","RdBu_r","jet"] | |
1815 |
|
1915 | |||
1816 | for i in range(self.nPairs): |
|
1916 | for i in range(self.nPairs): | |
1817 | strAux1 = "Phase Difference "+ str(pairsList[i][0]) + str(pairsList[i][1]) |
|
1917 | strAux1 = "Phase Difference "+ str(pairsList[i][0]) + str(pairsList[i][1]) | |
1818 | titleList = titleList + [strAux1] |
|
1918 | titleList = titleList + [strAux1] | |
1819 | cmapList = cmapList + ["RdBu_r"] |
|
1919 | cmapList = cmapList + ["RdBu_r"] | |
1820 |
|
1920 | |||
1821 | self.zminList = zminList |
|
1921 | self.zminList = zminList | |
1822 | self.zmaxList = zmaxList |
|
1922 | self.zmaxList = zmaxList | |
1823 | self.cmapList = cmapList |
|
1923 | self.cmapList = cmapList | |
1824 | self.titleList = titleList |
|
1924 | self.titleList = titleList | |
1825 |
|
1925 | |||
1826 | self.FTP_WEI = ftp_wei |
|
1926 | self.FTP_WEI = ftp_wei | |
1827 | self.EXP_CODE = exp_code |
|
1927 | self.EXP_CODE = exp_code | |
1828 | self.SUB_EXP_CODE = sub_exp_code |
|
1928 | self.SUB_EXP_CODE = sub_exp_code | |
1829 | self.PLOT_POS = plot_pos |
|
1929 | self.PLOT_POS = plot_pos | |
1830 |
|
1930 | |||
1831 | self.isConfig = True |
|
1931 | self.isConfig = True | |
1832 |
|
1932 | |||
1833 | str_datetime = '%s %s'%(thisDatetime.strftime("%Y/%m/%d"),thisDatetime.strftime("%H:%M:%S")) |
|
1933 | str_datetime = '%s %s'%(thisDatetime.strftime("%Y/%m/%d"),thisDatetime.strftime("%H:%M:%S")) | |
1834 |
|
1934 | |||
1835 | for i in range(nParam): |
|
1935 | for i in range(nParam): | |
1836 | title = self.titleList[i] + ": " +str_datetime |
|
1936 | title = self.titleList[i] + ": " +str_datetime | |
1837 | axes = self.axesList[i] |
|
1937 | axes = self.axesList[i] | |
1838 | axes.pcolor(x, y, z[i,:].T, |
|
1938 | axes.pcolor(x, y, z[i,:].T, | |
1839 | xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, zmin=self.zminList[i], zmax=self.zmaxList[i], |
|
1939 | xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, zmin=self.zminList[i], zmax=self.zmaxList[i], | |
1840 | xlabel=xlabel, ylabel=ylabel, title=title, colormap=self.cmapList[i],ticksize=9, cblabel='') |
|
1940 | xlabel=xlabel, ylabel=ylabel, title=title, colormap=self.cmapList[i],ticksize=9, cblabel='') | |
1841 | self.draw() |
|
1941 | self.draw() | |
1842 |
|
1942 | |||
1843 | if figfile == None: |
|
1943 | if figfile == None: | |
1844 | str_datetime = thisDatetime.strftime("%Y%m%d_%H%M%S") |
|
1944 | str_datetime = thisDatetime.strftime("%Y%m%d_%H%M%S") | |
1845 | name = str_datetime |
|
1945 | name = str_datetime | |
1846 | if ((dataOut.azimuth!=None) and (dataOut.zenith!=None)): |
|
1946 | if ((dataOut.azimuth!=None) and (dataOut.zenith!=None)): | |
1847 | name = name + '_az' + '_%2.2f'%(dataOut.azimuth) + '_zn' + '_%2.2f'%(dataOut.zenith) |
|
1947 | name = name + '_az' + '_%2.2f'%(dataOut.azimuth) + '_zn' + '_%2.2f'%(dataOut.zenith) | |
1848 | figfile = self.getFilename(name) |
|
1948 | figfile = self.getFilename(name) | |
1849 |
|
1949 | |||
1850 | self.save(figpath=figpath, |
|
1950 | self.save(figpath=figpath, | |
1851 | figfile=figfile, |
|
1951 | figfile=figfile, | |
1852 | save=save, |
|
1952 | save=save, | |
1853 | ftp=ftp, |
|
1953 | ftp=ftp, | |
1854 | wr_period=wr_period, |
|
1954 | wr_period=wr_period, | |
1855 | thisDatetime=thisDatetime) |
|
1955 | thisDatetime=thisDatetime) | |
1856 |
|
1956 | |||
1857 |
|
1957 | |||
1858 | class NSMeteorDetection2Plot(Figure): |
|
1958 | class NSMeteorDetection2Plot(Figure): | |
1859 |
|
1959 | |||
1860 | isConfig = None |
|
1960 | isConfig = None | |
1861 | __nsubplots = None |
|
1961 | __nsubplots = None | |
1862 |
|
1962 | |||
1863 | WIDTHPROF = None |
|
1963 | WIDTHPROF = None | |
1864 | HEIGHTPROF = None |
|
1964 | HEIGHTPROF = None | |
1865 | PREFIX = 'nsm' |
|
1965 | PREFIX = 'nsm' | |
1866 |
|
1966 | |||
1867 | zminList = None |
|
1967 | zminList = None | |
1868 | zmaxList = None |
|
1968 | zmaxList = None | |
1869 | cmapList = None |
|
1969 | cmapList = None | |
1870 | titleList = None |
|
1970 | titleList = None | |
1871 | nPairs = None |
|
1971 | nPairs = None | |
1872 | nChannels = None |
|
1972 | nChannels = None | |
1873 | nParam = None |
|
1973 | nParam = None | |
1874 |
|
1974 | |||
1875 | parameters = { |
|
1975 | parameters = { | |
1876 | 'id': global_type_string, |
|
1976 | 'id': global_type_string, | |
1877 | 'wintitle': global_type_string, |
|
1977 | 'wintitle': global_type_string, | |
1878 | 'channelList': global_type_list, |
|
1978 | 'channelList': global_type_list, | |
1879 | 'showprofile': global_type_boolean, |
|
1979 | 'showprofile': global_type_boolean, | |
1880 | 'xmin': global_type_float, |
|
1980 | 'xmin': global_type_float, | |
1881 | 'xmax': global_type_float, |
|
1981 | 'xmax': global_type_float, | |
1882 | 'ymin': global_type_float, |
|
1982 | 'ymin': global_type_float, | |
1883 | 'ymax': global_type_float, |
|
1983 | 'ymax': global_type_float, | |
1884 | 'SNRmin': global_type_float, |
|
1984 | 'SNRmin': global_type_float, | |
1885 | 'SNRmax': global_type_float, |
|
1985 | 'SNRmax': global_type_float, | |
1886 | 'vmin': global_type_float, |
|
1986 | 'vmin': global_type_float, | |
1887 | 'vmax': global_type_float, |
|
1987 | 'vmax': global_type_float, | |
1888 | 'wmin': global_type_float, |
|
1988 | 'wmin': global_type_float, | |
1889 | 'wmax': global_type_float, |
|
1989 | 'wmax': global_type_float, | |
1890 | 'mode': global_type_string, |
|
1990 | 'mode': global_type_string, | |
1891 | 'save': global_type_boolean, |
|
1991 | 'save': global_type_boolean, | |
1892 | 'figpath': global_type_string, |
|
1992 | 'figpath': global_type_string, | |
1893 | 'figfile': global_type_string, |
|
1993 | 'figfile': global_type_string, | |
1894 | 'show': global_type_string, |
|
1994 | 'show': global_type_string, | |
1895 | 'ftp': global_type_boolean, |
|
1995 | 'ftp': global_type_boolean, | |
1896 | 'wr_period': global_type_integer, |
|
1996 | 'wr_period': global_type_integer, | |
1897 | 'server': global_type_string, |
|
1997 | 'server': global_type_string, | |
1898 | 'folder': global_type_string, |
|
1998 | 'folder': global_type_string, | |
1899 | 'username': global_type_string, |
|
1999 | 'username': global_type_string, | |
1900 | 'password': global_type_string, |
|
2000 | 'password': global_type_string, | |
1901 | 'ftp_wei': global_type_integer, |
|
2001 | 'ftp_wei': global_type_integer, | |
1902 | 'exp_code': global_type_integer, |
|
2002 | 'exp_code': global_type_integer, | |
1903 | 'sub_exp_code': global_type_integer, |
|
2003 | 'sub_exp_code': global_type_integer, | |
1904 | 'plot_pos': global_type_integer, |
|
2004 | 'plot_pos': global_type_integer, | |
1905 | 'realtime': global_type_boolean, |
|
2005 | 'realtime': global_type_boolean, | |
1906 | 'xaxis': global_type_string, |
|
2006 | 'xaxis': global_type_string, | |
1907 | } |
|
2007 | } | |
1908 |
|
2008 | |||
1909 | def __init__(self, **kwargs): |
|
2009 | def __init__(self, **kwargs): | |
1910 | Figure.__init__(self, **kwargs) |
|
2010 | Figure.__init__(self, **kwargs) | |
1911 | self.isConfig = False |
|
2011 | self.isConfig = False | |
1912 | self.__nsubplots = 1 |
|
2012 | self.__nsubplots = 1 | |
1913 |
|
2013 | |||
1914 | self.WIDTH = 750 |
|
2014 | self.WIDTH = 750 | |
1915 | self.HEIGHT = 250 |
|
2015 | self.HEIGHT = 250 | |
1916 | self.WIDTHPROF = 120 |
|
2016 | self.WIDTHPROF = 120 | |
1917 | self.HEIGHTPROF = 0 |
|
2017 | self.HEIGHTPROF = 0 | |
1918 | self.counter_imagwr = 0 |
|
2018 | self.counter_imagwr = 0 | |
1919 |
|
2019 | |||
1920 | self.PLOT_CODE = SPEC_CODE |
|
2020 | self.PLOT_CODE = SPEC_CODE | |
1921 |
|
2021 | |||
1922 | self.FTP_WEI = None |
|
2022 | self.FTP_WEI = None | |
1923 | self.EXP_CODE = None |
|
2023 | self.EXP_CODE = None | |
1924 | self.SUB_EXP_CODE = None |
|
2024 | self.SUB_EXP_CODE = None | |
1925 | self.PLOT_POS = None |
|
2025 | self.PLOT_POS = None | |
1926 |
|
2026 | |||
1927 | self.__xfilter_ena = False |
|
2027 | self.__xfilter_ena = False | |
1928 | self.__yfilter_ena = False |
|
2028 | self.__yfilter_ena = False | |
1929 |
|
2029 | |||
1930 | def getSubplots(self): |
|
2030 | def getSubplots(self): | |
1931 |
|
2031 | |||
1932 | ncol = 3 |
|
2032 | ncol = 3 | |
1933 | nrow = int(numpy.ceil(self.nplots/3.0)) |
|
2033 | nrow = int(numpy.ceil(self.nplots/3.0)) | |
1934 |
|
2034 | |||
1935 | return nrow, ncol |
|
2035 | return nrow, ncol | |
1936 |
|
2036 | |||
1937 | def setup(self, id, nplots, wintitle, show=True): |
|
2037 | def setup(self, id, nplots, wintitle, show=True): | |
1938 |
|
2038 | |||
1939 | self.nplots = nplots |
|
2039 | self.nplots = nplots | |
1940 |
|
2040 | |||
1941 | ncolspan = 1 |
|
2041 | ncolspan = 1 | |
1942 | colspan = 1 |
|
2042 | colspan = 1 | |
1943 |
|
2043 | |||
1944 | self.createFigure(id = id, |
|
2044 | self.createFigure(id = id, | |
1945 | wintitle = wintitle, |
|
2045 | wintitle = wintitle, | |
1946 | widthplot = self.WIDTH + self.WIDTHPROF, |
|
2046 | widthplot = self.WIDTH + self.WIDTHPROF, | |
1947 | heightplot = self.HEIGHT + self.HEIGHTPROF, |
|
2047 | heightplot = self.HEIGHT + self.HEIGHTPROF, | |
1948 | show=show) |
|
2048 | show=show) | |
1949 |
|
2049 | |||
1950 | nrow, ncol = self.getSubplots() |
|
2050 | nrow, ncol = self.getSubplots() | |
1951 |
|
2051 | |||
1952 | counter = 0 |
|
2052 | counter = 0 | |
1953 | for y in range(nrow): |
|
2053 | for y in range(nrow): | |
1954 | for x in range(ncol): |
|
2054 | for x in range(ncol): | |
1955 |
|
2055 | |||
1956 | if counter >= self.nplots: |
|
2056 | if counter >= self.nplots: | |
1957 | break |
|
2057 | break | |
1958 |
|
2058 | |||
1959 | self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan, colspan, 1) |
|
2059 | self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan, colspan, 1) | |
1960 |
|
2060 | |||
1961 | counter += 1 |
|
2061 | counter += 1 | |
1962 |
|
2062 | |||
1963 | def run(self, dataOut, id, wintitle="", channelList=None, showprofile=True, |
|
2063 | def run(self, dataOut, id, wintitle="", channelList=None, showprofile=True, | |
1964 | xmin=None, xmax=None, ymin=None, ymax=None, SNRmin=None, SNRmax=None, |
|
2064 | xmin=None, xmax=None, ymin=None, ymax=None, SNRmin=None, SNRmax=None, | |
1965 | vmin=None, vmax=None, wmin=None, wmax=None, mode = 'SA', |
|
2065 | vmin=None, vmax=None, wmin=None, wmax=None, mode = 'SA', | |
1966 | save=False, figpath='./', figfile=None, show=True, ftp=False, wr_period=1, |
|
2066 | save=False, figpath='./', figfile=None, show=True, ftp=False, wr_period=1, | |
1967 | server=None, folder=None, username=None, password=None, |
|
2067 | server=None, folder=None, username=None, password=None, | |
1968 | ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0, realtime=False, |
|
2068 | ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0, realtime=False, | |
1969 | xaxis="frequency"): |
|
2069 | xaxis="frequency"): | |
1970 |
|
2070 | |||
1971 | """ |
|
2071 | """ | |
1972 |
|
2072 | |||
1973 | Input: |
|
2073 | Input: | |
1974 | dataOut : |
|
2074 | dataOut : | |
1975 | id : |
|
2075 | id : | |
1976 | wintitle : |
|
2076 | wintitle : | |
1977 | channelList : |
|
2077 | channelList : | |
1978 | showProfile : |
|
2078 | showProfile : | |
1979 | xmin : None, |
|
2079 | xmin : None, | |
1980 | xmax : None, |
|
2080 | xmax : None, | |
1981 | ymin : None, |
|
2081 | ymin : None, | |
1982 | ymax : None, |
|
2082 | ymax : None, | |
1983 | zmin : None, |
|
2083 | zmin : None, | |
1984 | zmax : None |
|
2084 | zmax : None | |
1985 | """ |
|
2085 | """ | |
1986 | #Rebuild matrix |
|
2086 | #Rebuild matrix | |
1987 | utctime = dataOut.data_param[0,0] |
|
2087 | utctime = dataOut.data_param[0,0] | |
1988 | cmet = dataOut.data_param[:,1].astype(int) |
|
2088 | cmet = dataOut.data_param[:,1].astype(int) | |
1989 | tmet = dataOut.data_param[:,2].astype(int) |
|
2089 | tmet = dataOut.data_param[:,2].astype(int) | |
1990 | hmet = dataOut.data_param[:,3].astype(int) |
|
2090 | hmet = dataOut.data_param[:,3].astype(int) | |
1991 |
|
2091 | |||
1992 | nParam = 3 |
|
2092 | nParam = 3 | |
1993 | nChan = len(dataOut.groupList) |
|
2093 | nChan = len(dataOut.groupList) | |
1994 | x = dataOut.abscissaList |
|
2094 | x = dataOut.abscissaList | |
1995 | y = dataOut.heightList |
|
2095 | y = dataOut.heightList | |
1996 |
|
2096 | |||
1997 | z = numpy.full((nChan, nParam, y.size, x.size - 1),numpy.nan) |
|
2097 | z = numpy.full((nChan, nParam, y.size, x.size - 1),numpy.nan) | |
1998 | z[cmet,:,hmet,tmet] = dataOut.data_param[:,4:] |
|
2098 | z[cmet,:,hmet,tmet] = dataOut.data_param[:,4:] | |
1999 | z[:,0,:,:] = 10*numpy.log10(z[:,0,:,:]) #logarithmic scale |
|
2099 | z[:,0,:,:] = 10*numpy.log10(z[:,0,:,:]) #logarithmic scale | |
2000 | z = numpy.reshape(z, (nChan*nParam, y.size, x.size-1)) |
|
2100 | z = numpy.reshape(z, (nChan*nParam, y.size, x.size-1)) | |
2001 |
|
2101 | |||
2002 | xlabel = "Time (s)" |
|
2102 | xlabel = "Time (s)" | |
2003 | ylabel = "Range (km)" |
|
2103 | ylabel = "Range (km)" | |
2004 |
|
2104 | |||
2005 | thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.ltctime) |
|
2105 | thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.ltctime) | |
2006 |
|
2106 | |||
2007 | if not self.isConfig: |
|
2107 | if not self.isConfig: | |
2008 |
|
2108 | |||
2009 | nplots = nParam*nChan |
|
2109 | nplots = nParam*nChan | |
2010 |
|
2110 | |||
2011 | self.setup(id=id, |
|
2111 | self.setup(id=id, | |
2012 | nplots=nplots, |
|
2112 | nplots=nplots, | |
2013 | wintitle=wintitle, |
|
2113 | wintitle=wintitle, | |
2014 | show=show) |
|
2114 | show=show) | |
2015 |
|
2115 | |||
2016 | if xmin is None: xmin = numpy.nanmin(x) |
|
2116 | if xmin is None: xmin = numpy.nanmin(x) | |
2017 | if xmax is None: xmax = numpy.nanmax(x) |
|
2117 | if xmax is None: xmax = numpy.nanmax(x) | |
2018 | if ymin is None: ymin = numpy.nanmin(y) |
|
2118 | if ymin is None: ymin = numpy.nanmin(y) | |
2019 | if ymax is None: ymax = numpy.nanmax(y) |
|
2119 | if ymax is None: ymax = numpy.nanmax(y) | |
2020 | if SNRmin is None: SNRmin = numpy.nanmin(z[0,:]) |
|
2120 | if SNRmin is None: SNRmin = numpy.nanmin(z[0,:]) | |
2021 | if SNRmax is None: SNRmax = numpy.nanmax(z[0,:]) |
|
2121 | if SNRmax is None: SNRmax = numpy.nanmax(z[0,:]) | |
2022 | if vmax is None: vmax = numpy.nanmax(numpy.abs(z[1,:])) |
|
2122 | if vmax is None: vmax = numpy.nanmax(numpy.abs(z[1,:])) | |
2023 | if vmin is None: vmin = -vmax |
|
2123 | if vmin is None: vmin = -vmax | |
2024 | if wmin is None: wmin = 0 |
|
2124 | if wmin is None: wmin = 0 | |
2025 | if wmax is None: wmax = 50 |
|
2125 | if wmax is None: wmax = 50 | |
2026 |
|
2126 | |||
2027 | self.nChannels = nChan |
|
2127 | self.nChannels = nChan | |
2028 |
|
2128 | |||
2029 | zminList = [] |
|
2129 | zminList = [] | |
2030 | zmaxList = [] |
|
2130 | zmaxList = [] | |
2031 | titleList = [] |
|
2131 | titleList = [] | |
2032 | cmapList = [] |
|
2132 | cmapList = [] | |
2033 | for i in range(self.nChannels): |
|
2133 | for i in range(self.nChannels): | |
2034 | strAux1 = "SNR Channel "+ str(i) |
|
2134 | strAux1 = "SNR Channel "+ str(i) | |
2035 | strAux2 = "Radial Velocity Channel "+ str(i) |
|
2135 | strAux2 = "Radial Velocity Channel "+ str(i) | |
2036 | strAux3 = "Spectral Width Channel "+ str(i) |
|
2136 | strAux3 = "Spectral Width Channel "+ str(i) | |
2037 |
|
2137 | |||
2038 | titleList = titleList + [strAux1,strAux2,strAux3] |
|
2138 | titleList = titleList + [strAux1,strAux2,strAux3] | |
2039 | cmapList = cmapList + ["jet","RdBu_r","jet"] |
|
2139 | cmapList = cmapList + ["jet","RdBu_r","jet"] | |
2040 | zminList = zminList + [SNRmin,vmin,wmin] |
|
2140 | zminList = zminList + [SNRmin,vmin,wmin] | |
2041 | zmaxList = zmaxList + [SNRmax,vmax,wmax] |
|
2141 | zmaxList = zmaxList + [SNRmax,vmax,wmax] | |
2042 |
|
2142 | |||
2043 | self.zminList = zminList |
|
2143 | self.zminList = zminList | |
2044 | self.zmaxList = zmaxList |
|
2144 | self.zmaxList = zmaxList | |
2045 | self.cmapList = cmapList |
|
2145 | self.cmapList = cmapList | |
2046 | self.titleList = titleList |
|
2146 | self.titleList = titleList | |
2047 |
|
2147 | |||
2048 | self.FTP_WEI = ftp_wei |
|
2148 | self.FTP_WEI = ftp_wei | |
2049 | self.EXP_CODE = exp_code |
|
2149 | self.EXP_CODE = exp_code | |
2050 | self.SUB_EXP_CODE = sub_exp_code |
|
2150 | self.SUB_EXP_CODE = sub_exp_code | |
2051 | self.PLOT_POS = plot_pos |
|
2151 | self.PLOT_POS = plot_pos | |
2052 |
|
2152 | |||
2053 | self.isConfig = True |
|
2153 | self.isConfig = True | |
2054 |
|
2154 | |||
2055 | str_datetime = '%s %s'%(thisDatetime.strftime("%Y/%m/%d"),thisDatetime.strftime("%H:%M:%S")) |
|
2155 | str_datetime = '%s %s'%(thisDatetime.strftime("%Y/%m/%d"),thisDatetime.strftime("%H:%M:%S")) | |
2056 |
|
2156 | |||
2057 | for i in range(self.nplots): |
|
2157 | for i in range(self.nplots): | |
2058 | title = self.titleList[i] + ": " +str_datetime |
|
2158 | title = self.titleList[i] + ": " +str_datetime | |
2059 | axes = self.axesList[i] |
|
2159 | axes = self.axesList[i] | |
2060 | axes.pcolor(x, y, z[i,:].T, |
|
2160 | axes.pcolor(x, y, z[i,:].T, | |
2061 | xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, zmin=self.zminList[i], zmax=self.zmaxList[i], |
|
2161 | xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, zmin=self.zminList[i], zmax=self.zmaxList[i], | |
2062 | xlabel=xlabel, ylabel=ylabel, title=title, colormap=self.cmapList[i],ticksize=9, cblabel='') |
|
2162 | xlabel=xlabel, ylabel=ylabel, title=title, colormap=self.cmapList[i],ticksize=9, cblabel='') | |
2063 | self.draw() |
|
2163 | self.draw() | |
2064 |
|
2164 | |||
2065 | if figfile == None: |
|
2165 | if figfile == None: | |
2066 | str_datetime = thisDatetime.strftime("%Y%m%d_%H%M%S") |
|
2166 | str_datetime = thisDatetime.strftime("%Y%m%d_%H%M%S") | |
2067 | name = str_datetime |
|
2167 | name = str_datetime | |
2068 | if ((dataOut.azimuth!=None) and (dataOut.zenith!=None)): |
|
2168 | if ((dataOut.azimuth!=None) and (dataOut.zenith!=None)): | |
2069 | name = name + '_az' + '_%2.2f'%(dataOut.azimuth) + '_zn' + '_%2.2f'%(dataOut.zenith) |
|
2169 | name = name + '_az' + '_%2.2f'%(dataOut.azimuth) + '_zn' + '_%2.2f'%(dataOut.zenith) | |
2070 | figfile = self.getFilename(name) |
|
2170 | figfile = self.getFilename(name) | |
2071 |
|
2171 | |||
2072 | self.save(figpath=figpath, |
|
2172 | self.save(figpath=figpath, | |
2073 | figfile=figfile, |
|
2173 | figfile=figfile, | |
2074 | save=save, |
|
2174 | save=save, | |
2075 | ftp=ftp, |
|
2175 | ftp=ftp, | |
2076 | wr_period=wr_period, |
|
2176 | wr_period=wr_period, | |
2077 | thisDatetime=thisDatetime) |
|
2177 | thisDatetime=thisDatetime) |
@@ -1,1090 +1,1090 | |||||
1 | import numpy |
|
1 | import numpy | |
2 | import time |
|
2 | import time | |
3 | import os |
|
3 | import os | |
4 | import h5py |
|
4 | import h5py | |
5 | import re |
|
5 | import re | |
6 | import datetime |
|
6 | import datetime | |
7 |
|
7 | |||
8 | from schainpy.model.data.jrodata import * |
|
8 | from schainpy.model.data.jrodata import * | |
9 | from schainpy.model.proc.jroproc_base import ProcessingUnit, Operation |
|
9 | from schainpy.model.proc.jroproc_base import ProcessingUnit, Operation | |
10 | # from jroIO_base import * |
|
10 | # from jroIO_base import * | |
11 | from schainpy.model.io.jroIO_base import * |
|
11 | from schainpy.model.io.jroIO_base import * | |
12 | import schainpy |
|
12 | import schainpy | |
13 |
|
13 | |||
14 |
|
14 | |||
15 | class ParamReader(ProcessingUnit): |
|
15 | class ParamReader(ProcessingUnit): | |
16 | ''' |
|
16 | ''' | |
17 | Reads HDF5 format files |
|
17 | Reads HDF5 format files | |
18 |
|
18 | |||
19 | path |
|
19 | path | |
20 |
|
20 | |||
21 | startDate |
|
21 | startDate | |
22 |
|
22 | |||
23 | endDate |
|
23 | endDate | |
24 |
|
24 | |||
25 | startTime |
|
25 | startTime | |
26 |
|
26 | |||
27 | endTime |
|
27 | endTime | |
28 | ''' |
|
28 | ''' | |
29 |
|
29 | |||
30 | ext = ".hdf5" |
|
30 | ext = ".hdf5" | |
31 |
|
31 | |||
32 | optchar = "D" |
|
32 | optchar = "D" | |
33 |
|
33 | |||
34 | timezone = None |
|
34 | timezone = None | |
35 |
|
35 | |||
36 | startTime = None |
|
36 | startTime = None | |
37 |
|
37 | |||
38 | endTime = None |
|
38 | endTime = None | |
39 |
|
39 | |||
40 | fileIndex = None |
|
40 | fileIndex = None | |
41 |
|
41 | |||
42 | utcList = None #To select data in the utctime list |
|
42 | utcList = None #To select data in the utctime list | |
43 |
|
43 | |||
44 | blockList = None #List to blocks to be read from the file |
|
44 | blockList = None #List to blocks to be read from the file | |
45 |
|
45 | |||
46 | blocksPerFile = None #Number of blocks to be read |
|
46 | blocksPerFile = None #Number of blocks to be read | |
47 |
|
47 | |||
48 | blockIndex = None |
|
48 | blockIndex = None | |
49 |
|
49 | |||
50 | path = None |
|
50 | path = None | |
51 |
|
51 | |||
52 | #List of Files |
|
52 | #List of Files | |
53 |
|
53 | |||
54 | filenameList = None |
|
54 | filenameList = None | |
55 |
|
55 | |||
56 | datetimeList = None |
|
56 | datetimeList = None | |
57 |
|
57 | |||
58 | #Hdf5 File |
|
58 | #Hdf5 File | |
59 |
|
59 | |||
60 | listMetaname = None |
|
60 | listMetaname = None | |
61 |
|
61 | |||
62 | listMeta = None |
|
62 | listMeta = None | |
63 |
|
63 | |||
64 | listDataname = None |
|
64 | listDataname = None | |
65 |
|
65 | |||
66 | listData = None |
|
66 | listData = None | |
67 |
|
67 | |||
68 | listShapes = None |
|
68 | listShapes = None | |
69 |
|
69 | |||
70 | fp = None |
|
70 | fp = None | |
71 |
|
71 | |||
72 | #dataOut reconstruction |
|
72 | #dataOut reconstruction | |
73 |
|
73 | |||
74 | dataOut = None |
|
74 | dataOut = None | |
75 |
|
75 | |||
76 |
|
76 | |||
77 | def __init__(self, **kwargs): |
|
77 | def __init__(self, **kwargs): | |
78 | ProcessingUnit.__init__(self, **kwargs) |
|
78 | ProcessingUnit.__init__(self, **kwargs) | |
79 | self.dataOut = Parameters() |
|
79 | self.dataOut = Parameters() | |
80 | return |
|
80 | return | |
81 |
|
81 | |||
82 | def setup(self, **kwargs): |
|
82 | def setup(self, **kwargs): | |
83 |
|
83 | |||
84 | path = kwargs['path'] |
|
84 | path = kwargs['path'] | |
85 | startDate = kwargs['startDate'] |
|
85 | startDate = kwargs['startDate'] | |
86 | endDate = kwargs['endDate'] |
|
86 | endDate = kwargs['endDate'] | |
87 | startTime = kwargs['startTime'] |
|
87 | startTime = kwargs['startTime'] | |
88 | endTime = kwargs['endTime'] |
|
88 | endTime = kwargs['endTime'] | |
89 | walk = kwargs['walk'] |
|
89 | walk = kwargs['walk'] | |
90 | if kwargs.has_key('ext'): |
|
90 | if kwargs.has_key('ext'): | |
91 | ext = kwargs['ext'] |
|
91 | ext = kwargs['ext'] | |
92 | else: |
|
92 | else: | |
93 | ext = '.hdf5' |
|
93 | ext = '.hdf5' | |
94 | if kwargs.has_key('timezone'): |
|
94 | if kwargs.has_key('timezone'): | |
95 | self.timezone = kwargs['timezone'] |
|
95 | self.timezone = kwargs['timezone'] | |
96 | else: |
|
96 | else: | |
97 | self.timezone = 'lt' |
|
97 | self.timezone = 'lt' | |
98 |
|
98 | |||
99 | print "[Reading] Searching files in offline mode ..." |
|
99 | print "[Reading] Searching files in offline mode ..." | |
100 | pathList, filenameList = self.__searchFilesOffLine(path, startDate=startDate, endDate=endDate, |
|
100 | pathList, filenameList = self.__searchFilesOffLine(path, startDate=startDate, endDate=endDate, | |
101 | startTime=startTime, endTime=endTime, |
|
101 | startTime=startTime, endTime=endTime, | |
102 | ext=ext, walk=walk) |
|
102 | ext=ext, walk=walk) | |
103 |
|
103 | |||
104 | if not(filenameList): |
|
104 | if not(filenameList): | |
105 | print "There is no files into the folder: %s"%(path) |
|
105 | print "There is no files into the folder: %s"%(path) | |
106 | sys.exit(-1) |
|
106 | sys.exit(-1) | |
107 |
|
107 | |||
108 | self.fileIndex = -1 |
|
108 | self.fileIndex = -1 | |
109 | self.startTime = startTime |
|
109 | self.startTime = startTime | |
110 | self.endTime = endTime |
|
110 | self.endTime = endTime | |
111 |
|
111 | |||
112 | self.__readMetadata() |
|
112 | self.__readMetadata() | |
113 |
|
113 | |||
114 | self.__setNextFileOffline() |
|
114 | self.__setNextFileOffline() | |
115 |
|
115 | |||
116 | return |
|
116 | return | |
117 |
|
117 | |||
118 | def __searchFilesOffLine(self, |
|
118 | def __searchFilesOffLine(self, | |
119 | path, |
|
119 | path, | |
120 | startDate=None, |
|
120 | startDate=None, | |
121 | endDate=None, |
|
121 | endDate=None, | |
122 | startTime=datetime.time(0,0,0), |
|
122 | startTime=datetime.time(0,0,0), | |
123 | endTime=datetime.time(23,59,59), |
|
123 | endTime=datetime.time(23,59,59), | |
124 | ext='.hdf5', |
|
124 | ext='.hdf5', | |
125 | walk=True): |
|
125 | walk=True): | |
126 |
|
126 | |||
127 | expLabel = '' |
|
127 | expLabel = '' | |
128 | self.filenameList = [] |
|
128 | self.filenameList = [] | |
129 | self.datetimeList = [] |
|
129 | self.datetimeList = [] | |
130 |
|
130 | |||
131 | pathList = [] |
|
131 | pathList = [] | |
132 |
|
132 | |||
133 | JRODataObj = JRODataReader() |
|
133 | JRODataObj = JRODataReader() | |
134 | dateList, pathList = JRODataObj.findDatafiles(path, startDate, endDate, expLabel, ext, walk, include_path=True) |
|
134 | dateList, pathList = JRODataObj.findDatafiles(path, startDate, endDate, expLabel, ext, walk, include_path=True) | |
135 |
|
135 | |||
136 | if dateList == []: |
|
136 | if dateList == []: | |
137 | print "[Reading] No *%s files in %s from %s to %s)"%(ext, path, |
|
137 | print "[Reading] No *%s files in %s from %s to %s)"%(ext, path, | |
138 | datetime.datetime.combine(startDate,startTime).ctime(), |
|
138 | datetime.datetime.combine(startDate,startTime).ctime(), | |
139 | datetime.datetime.combine(endDate,endTime).ctime()) |
|
139 | datetime.datetime.combine(endDate,endTime).ctime()) | |
140 |
|
140 | |||
141 | return None, None |
|
141 | return None, None | |
142 |
|
142 | |||
143 | if len(dateList) > 1: |
|
143 | if len(dateList) > 1: | |
144 | print "[Reading] %d days were found in date range: %s - %s" %(len(dateList), startDate, endDate) |
|
144 | print "[Reading] %d days were found in date range: %s - %s" %(len(dateList), startDate, endDate) | |
145 | else: |
|
145 | else: | |
146 | print "[Reading] data was found for the date %s" %(dateList[0]) |
|
146 | print "[Reading] data was found for the date %s" %(dateList[0]) | |
147 |
|
147 | |||
148 | filenameList = [] |
|
148 | filenameList = [] | |
149 | datetimeList = [] |
|
149 | datetimeList = [] | |
150 |
|
150 | |||
151 | #---------------------------------------------------------------------------------- |
|
151 | #---------------------------------------------------------------------------------- | |
152 |
|
152 | |||
153 | for thisPath in pathList: |
|
153 | for thisPath in pathList: | |
154 | # thisPath = pathList[pathDict[file]] |
|
154 | # thisPath = pathList[pathDict[file]] | |
155 |
|
155 | |||
156 | fileList = glob.glob1(thisPath, "*%s" %ext) |
|
156 | fileList = glob.glob1(thisPath, "*%s" %ext) | |
157 | fileList.sort() |
|
157 | fileList.sort() | |
158 |
|
158 | |||
159 | for file in fileList: |
|
159 | for file in fileList: | |
160 |
|
160 | |||
161 | filename = os.path.join(thisPath,file) |
|
161 | filename = os.path.join(thisPath,file) | |
162 |
|
162 | |||
163 | if not isFileInDateRange(filename, startDate, endDate): |
|
163 | if not isFileInDateRange(filename, startDate, endDate): | |
164 | continue |
|
164 | continue | |
165 |
|
165 | |||
166 | thisDatetime = self.__isFileInTimeRange(filename, startDate, endDate, startTime, endTime) |
|
166 | thisDatetime = self.__isFileInTimeRange(filename, startDate, endDate, startTime, endTime) | |
167 |
|
167 | |||
168 | if not(thisDatetime): |
|
168 | if not(thisDatetime): | |
169 | continue |
|
169 | continue | |
170 |
|
170 | |||
171 | filenameList.append(filename) |
|
171 | filenameList.append(filename) | |
172 | datetimeList.append(thisDatetime) |
|
172 | datetimeList.append(thisDatetime) | |
173 |
|
173 | |||
174 | if not(filenameList): |
|
174 | if not(filenameList): | |
175 | print "[Reading] Any file was found int time range %s - %s" %(datetime.datetime.combine(startDate,startTime).ctime(), datetime.datetime.combine(endDate,endTime).ctime()) |
|
175 | print "[Reading] Any file was found int time range %s - %s" %(datetime.datetime.combine(startDate,startTime).ctime(), datetime.datetime.combine(endDate,endTime).ctime()) | |
176 | return None, None |
|
176 | return None, None | |
177 |
|
177 | |||
178 | print "[Reading] %d file(s) was(were) found in time range: %s - %s" %(len(filenameList), startTime, endTime) |
|
178 | print "[Reading] %d file(s) was(were) found in time range: %s - %s" %(len(filenameList), startTime, endTime) | |
179 |
|
179 | |||
180 |
|
180 | |||
181 | for i in range(len(filenameList)): |
|
181 | for i in range(len(filenameList)): | |
182 | print "[Reading] %s -> [%s]" %(filenameList[i], datetimeList[i].ctime()) |
|
182 | print "[Reading] %s -> [%s]" %(filenameList[i], datetimeList[i].ctime()) | |
183 |
|
183 | |||
184 | self.filenameList = filenameList |
|
184 | self.filenameList = filenameList | |
185 | self.datetimeList = datetimeList |
|
185 | self.datetimeList = datetimeList | |
186 |
|
186 | |||
187 | return pathList, filenameList |
|
187 | return pathList, filenameList | |
188 |
|
188 | |||
189 | def __isFileInTimeRange(self,filename, startDate, endDate, startTime, endTime): |
|
189 | def __isFileInTimeRange(self,filename, startDate, endDate, startTime, endTime): | |
190 |
|
190 | |||
191 | """ |
|
191 | """ | |
192 | Retorna 1 si el archivo de datos se encuentra dentro del rango de horas especificado. |
|
192 | Retorna 1 si el archivo de datos se encuentra dentro del rango de horas especificado. | |
193 |
|
193 | |||
194 | Inputs: |
|
194 | Inputs: | |
195 | filename : nombre completo del archivo de datos en formato Jicamarca (.r) |
|
195 | filename : nombre completo del archivo de datos en formato Jicamarca (.r) | |
196 |
|
196 | |||
197 | startDate : fecha inicial del rango seleccionado en formato datetime.date |
|
197 | startDate : fecha inicial del rango seleccionado en formato datetime.date | |
198 |
|
198 | |||
199 | endDate : fecha final del rango seleccionado en formato datetime.date |
|
199 | endDate : fecha final del rango seleccionado en formato datetime.date | |
200 |
|
200 | |||
201 | startTime : tiempo inicial del rango seleccionado en formato datetime.time |
|
201 | startTime : tiempo inicial del rango seleccionado en formato datetime.time | |
202 |
|
202 | |||
203 | endTime : tiempo final del rango seleccionado en formato datetime.time |
|
203 | endTime : tiempo final del rango seleccionado en formato datetime.time | |
204 |
|
204 | |||
205 | Return: |
|
205 | Return: | |
206 | Boolean : Retorna True si el archivo de datos contiene datos en el rango de |
|
206 | Boolean : Retorna True si el archivo de datos contiene datos en el rango de | |
207 | fecha especificado, de lo contrario retorna False. |
|
207 | fecha especificado, de lo contrario retorna False. | |
208 |
|
208 | |||
209 | Excepciones: |
|
209 | Excepciones: | |
210 | Si el archivo no existe o no puede ser abierto |
|
210 | Si el archivo no existe o no puede ser abierto | |
211 | Si la cabecera no puede ser leida. |
|
211 | Si la cabecera no puede ser leida. | |
212 |
|
212 | |||
213 | """ |
|
213 | """ | |
214 |
|
214 | |||
215 | try: |
|
215 | try: | |
216 | fp = h5py.File(filename,'r') |
|
216 | fp = h5py.File(filename,'r') | |
217 | grp1 = fp['Data'] |
|
217 | grp1 = fp['Data'] | |
218 |
|
218 | |||
219 | except IOError: |
|
219 | except IOError: | |
220 | traceback.print_exc() |
|
220 | traceback.print_exc() | |
221 | raise IOError, "The file %s can't be opened" %(filename) |
|
221 | raise IOError, "The file %s can't be opened" %(filename) | |
222 | #chino rata |
|
222 | #chino rata | |
223 | #In case has utctime attribute |
|
223 | #In case has utctime attribute | |
224 | grp2 = grp1['utctime'] |
|
224 | grp2 = grp1['utctime'] | |
225 | # thisUtcTime = grp2.value[0] - 5*3600 #To convert to local time |
|
225 | # thisUtcTime = grp2.value[0] - 5*3600 #To convert to local time | |
226 | thisUtcTime = grp2.value[0] |
|
226 | thisUtcTime = grp2.value[0] | |
227 |
|
227 | |||
228 | fp.close() |
|
228 | fp.close() | |
229 |
|
229 | |||
230 | if self.timezone == 'lt': |
|
230 | if self.timezone == 'lt': | |
231 | thisUtcTime -= 5*3600 |
|
231 | thisUtcTime -= 5*3600 | |
232 |
|
232 | |||
233 | thisDatetime = datetime.datetime.fromtimestamp(thisUtcTime[0] + 5*3600) |
|
233 | thisDatetime = datetime.datetime.fromtimestamp(thisUtcTime[0] + 5*3600) | |
234 | # thisDatetime = datetime.datetime.fromtimestamp(thisUtcTime[0]) |
|
234 | # thisDatetime = datetime.datetime.fromtimestamp(thisUtcTime[0]) | |
235 | thisDate = thisDatetime.date() |
|
235 | thisDate = thisDatetime.date() | |
236 | thisTime = thisDatetime.time() |
|
236 | thisTime = thisDatetime.time() | |
237 |
|
237 | |||
238 | startUtcTime = (datetime.datetime.combine(thisDate,startTime)- datetime.datetime(1970, 1, 1)).total_seconds() |
|
238 | startUtcTime = (datetime.datetime.combine(thisDate,startTime)- datetime.datetime(1970, 1, 1)).total_seconds() | |
239 | endUtcTime = (datetime.datetime.combine(thisDate,endTime)- datetime.datetime(1970, 1, 1)).total_seconds() |
|
239 | endUtcTime = (datetime.datetime.combine(thisDate,endTime)- datetime.datetime(1970, 1, 1)).total_seconds() | |
240 |
|
240 | |||
241 | #General case |
|
241 | #General case | |
242 | # o>>>>>>>>>>>>>><<<<<<<<<<<<<<o |
|
242 | # o>>>>>>>>>>>>>><<<<<<<<<<<<<<o | |
243 | #-----------o----------------------------o----------- |
|
243 | #-----------o----------------------------o----------- | |
244 | # startTime endTime |
|
244 | # startTime endTime | |
245 |
|
245 | |||
246 | if endTime >= startTime: |
|
246 | if endTime >= startTime: | |
247 | thisUtcLog = numpy.logical_and(thisUtcTime > startUtcTime, thisUtcTime < endUtcTime) |
|
247 | thisUtcLog = numpy.logical_and(thisUtcTime > startUtcTime, thisUtcTime < endUtcTime) | |
248 | if numpy.any(thisUtcLog): #If there is one block between the hours mentioned |
|
248 | if numpy.any(thisUtcLog): #If there is one block between the hours mentioned | |
249 | return thisDatetime |
|
249 | return thisDatetime | |
250 | return None |
|
250 | return None | |
251 |
|
251 | |||
252 | #If endTime < startTime then endTime belongs to the next day |
|
252 | #If endTime < startTime then endTime belongs to the next day | |
253 | #<<<<<<<<<<<o o>>>>>>>>>>> |
|
253 | #<<<<<<<<<<<o o>>>>>>>>>>> | |
254 | #-----------o----------------------------o----------- |
|
254 | #-----------o----------------------------o----------- | |
255 | # endTime startTime |
|
255 | # endTime startTime | |
256 |
|
256 | |||
257 | if (thisDate == startDate) and numpy.all(thisUtcTime < startUtcTime): |
|
257 | if (thisDate == startDate) and numpy.all(thisUtcTime < startUtcTime): | |
258 | return None |
|
258 | return None | |
259 |
|
259 | |||
260 | if (thisDate == endDate) and numpy.all(thisUtcTime > endUtcTime): |
|
260 | if (thisDate == endDate) and numpy.all(thisUtcTime > endUtcTime): | |
261 | return None |
|
261 | return None | |
262 |
|
262 | |||
263 | if numpy.all(thisUtcTime < startUtcTime) and numpy.all(thisUtcTime > endUtcTime): |
|
263 | if numpy.all(thisUtcTime < startUtcTime) and numpy.all(thisUtcTime > endUtcTime): | |
264 | return None |
|
264 | return None | |
265 |
|
265 | |||
266 | return thisDatetime |
|
266 | return thisDatetime | |
267 |
|
267 | |||
268 | def __setNextFileOffline(self): |
|
268 | def __setNextFileOffline(self): | |
269 |
|
269 | |||
270 | self.fileIndex += 1 |
|
270 | self.fileIndex += 1 | |
271 | idFile = self.fileIndex |
|
271 | idFile = self.fileIndex | |
272 |
|
272 | |||
273 | if not(idFile < len(self.filenameList)): |
|
273 | if not(idFile < len(self.filenameList)): | |
274 | print "No more Files" |
|
274 | print "No more Files" | |
275 | return 0 |
|
275 | return 0 | |
276 |
|
276 | |||
277 | filename = self.filenameList[idFile] |
|
277 | filename = self.filenameList[idFile] | |
278 |
|
278 | |||
279 | filePointer = h5py.File(filename,'r') |
|
279 | filePointer = h5py.File(filename,'r') | |
280 |
|
280 | |||
281 | self.filename = filename |
|
281 | self.filename = filename | |
282 |
|
282 | |||
283 | self.fp = filePointer |
|
283 | self.fp = filePointer | |
284 |
|
284 | |||
285 | print "Setting the file: %s"%self.filename |
|
285 | print "Setting the file: %s"%self.filename | |
286 |
|
286 | |||
287 | # self.__readMetadata() |
|
287 | # self.__readMetadata() | |
288 | self.__setBlockList() |
|
288 | self.__setBlockList() | |
289 | self.__readData() |
|
289 | self.__readData() | |
290 | # self.nRecords = self.fp['Data'].attrs['blocksPerFile'] |
|
290 | # self.nRecords = self.fp['Data'].attrs['blocksPerFile'] | |
291 | # self.nRecords = self.fp['Data'].attrs['nRecords'] |
|
291 | # self.nRecords = self.fp['Data'].attrs['nRecords'] | |
292 | self.blockIndex = 0 |
|
292 | self.blockIndex = 0 | |
293 | return 1 |
|
293 | return 1 | |
294 |
|
294 | |||
295 | def __setBlockList(self): |
|
295 | def __setBlockList(self): | |
296 | ''' |
|
296 | ''' | |
297 | Selects the data within the times defined |
|
297 | Selects the data within the times defined | |
298 |
|
298 | |||
299 | self.fp |
|
299 | self.fp | |
300 | self.startTime |
|
300 | self.startTime | |
301 | self.endTime |
|
301 | self.endTime | |
302 |
|
302 | |||
303 | self.blockList |
|
303 | self.blockList | |
304 | self.blocksPerFile |
|
304 | self.blocksPerFile | |
305 |
|
305 | |||
306 | ''' |
|
306 | ''' | |
307 | fp = self.fp |
|
307 | fp = self.fp | |
308 | startTime = self.startTime |
|
308 | startTime = self.startTime | |
309 | endTime = self.endTime |
|
309 | endTime = self.endTime | |
310 |
|
310 | |||
311 | grp = fp['Data'] |
|
311 | grp = fp['Data'] | |
312 | thisUtcTime = grp['utctime'].value.astype(numpy.float)[0] |
|
312 | thisUtcTime = grp['utctime'].value.astype(numpy.float)[0] | |
313 |
|
313 | |||
314 | #ERROOOOR |
|
314 | #ERROOOOR | |
315 | if self.timezone == 'lt': |
|
315 | if self.timezone == 'lt': | |
316 | thisUtcTime -= 5*3600 |
|
316 | thisUtcTime -= 5*3600 | |
317 |
|
317 | |||
318 | thisDatetime = datetime.datetime.fromtimestamp(thisUtcTime[0] + 5*3600) |
|
318 | thisDatetime = datetime.datetime.fromtimestamp(thisUtcTime[0] + 5*3600) | |
319 |
|
319 | |||
320 | thisDate = thisDatetime.date() |
|
320 | thisDate = thisDatetime.date() | |
321 | thisTime = thisDatetime.time() |
|
321 | thisTime = thisDatetime.time() | |
322 |
|
322 | |||
323 | startUtcTime = (datetime.datetime.combine(thisDate,startTime) - datetime.datetime(1970, 1, 1)).total_seconds() |
|
323 | startUtcTime = (datetime.datetime.combine(thisDate,startTime) - datetime.datetime(1970, 1, 1)).total_seconds() | |
324 | endUtcTime = (datetime.datetime.combine(thisDate,endTime) - datetime.datetime(1970, 1, 1)).total_seconds() |
|
324 | endUtcTime = (datetime.datetime.combine(thisDate,endTime) - datetime.datetime(1970, 1, 1)).total_seconds() | |
325 |
|
325 | |||
326 | ind = numpy.where(numpy.logical_and(thisUtcTime >= startUtcTime, thisUtcTime < endUtcTime))[0] |
|
326 | ind = numpy.where(numpy.logical_and(thisUtcTime >= startUtcTime, thisUtcTime < endUtcTime))[0] | |
327 |
|
327 | |||
328 | self.blockList = ind |
|
328 | self.blockList = ind | |
329 | self.blocksPerFile = len(ind) |
|
329 | self.blocksPerFile = len(ind) | |
330 |
|
330 | |||
331 | return |
|
331 | return | |
332 |
|
332 | |||
333 | def __readMetadata(self): |
|
333 | def __readMetadata(self): | |
334 | ''' |
|
334 | ''' | |
335 | Reads Metadata |
|
335 | Reads Metadata | |
336 |
|
336 | |||
337 | self.pathMeta |
|
337 | self.pathMeta | |
338 |
|
338 | |||
339 | self.listShapes |
|
339 | self.listShapes | |
340 | self.listMetaname |
|
340 | self.listMetaname | |
341 | self.listMeta |
|
341 | self.listMeta | |
342 |
|
342 | |||
343 | ''' |
|
343 | ''' | |
344 |
|
344 | |||
345 | # grp = self.fp['Data'] |
|
345 | # grp = self.fp['Data'] | |
346 | # pathMeta = os.path.join(self.path, grp.attrs['metadata']) |
|
346 | # pathMeta = os.path.join(self.path, grp.attrs['metadata']) | |
347 | # |
|
347 | # | |
348 | # if pathMeta == self.pathMeta: |
|
348 | # if pathMeta == self.pathMeta: | |
349 | # return |
|
349 | # return | |
350 | # else: |
|
350 | # else: | |
351 | # self.pathMeta = pathMeta |
|
351 | # self.pathMeta = pathMeta | |
352 | # |
|
352 | # | |
353 | # filePointer = h5py.File(self.pathMeta,'r') |
|
353 | # filePointer = h5py.File(self.pathMeta,'r') | |
354 | # groupPointer = filePointer['Metadata'] |
|
354 | # groupPointer = filePointer['Metadata'] | |
355 |
|
355 | |||
356 | filename = self.filenameList[0] |
|
356 | filename = self.filenameList[0] | |
357 |
|
357 | |||
358 | fp = h5py.File(filename,'r') |
|
358 | fp = h5py.File(filename,'r') | |
359 |
|
359 | |||
360 | gp = fp['Metadata'] |
|
360 | gp = fp['Metadata'] | |
361 |
|
361 | |||
362 | listMetaname = [] |
|
362 | listMetaname = [] | |
363 | listMetadata = [] |
|
363 | listMetadata = [] | |
364 | for item in gp.items(): |
|
364 | for item in gp.items(): | |
365 | name = item[0] |
|
365 | name = item[0] | |
366 |
|
366 | |||
367 | if name=='array dimensions': |
|
367 | if name=='array dimensions': | |
368 | table = gp[name][:] |
|
368 | table = gp[name][:] | |
369 | listShapes = {} |
|
369 | listShapes = {} | |
370 | for shapes in table: |
|
370 | for shapes in table: | |
371 | listShapes[shapes[0]] = numpy.array([shapes[1],shapes[2],shapes[3],shapes[4],shapes[5]]) |
|
371 | listShapes[shapes[0]] = numpy.array([shapes[1],shapes[2],shapes[3],shapes[4],shapes[5]]) | |
372 | else: |
|
372 | else: | |
373 | data = gp[name].value |
|
373 | data = gp[name].value | |
374 | listMetaname.append(name) |
|
374 | listMetaname.append(name) | |
375 | listMetadata.append(data) |
|
375 | listMetadata.append(data) | |
376 |
|
376 | |||
377 | # if name=='type': |
|
377 | # if name=='type': | |
378 | # self.__initDataOut(data) |
|
378 | # self.__initDataOut(data) | |
379 |
|
379 | |||
380 | self.listShapes = listShapes |
|
380 | self.listShapes = listShapes | |
381 | self.listMetaname = listMetaname |
|
381 | self.listMetaname = listMetaname | |
382 | self.listMeta = listMetadata |
|
382 | self.listMeta = listMetadata | |
383 |
|
383 | |||
384 | fp.close() |
|
384 | fp.close() | |
385 | return |
|
385 | return | |
386 |
|
386 | |||
387 | def __readData(self): |
|
387 | def __readData(self): | |
388 | grp = self.fp['Data'] |
|
388 | grp = self.fp['Data'] | |
389 | listdataname = [] |
|
389 | listdataname = [] | |
390 | listdata = [] |
|
390 | listdata = [] | |
391 |
|
391 | |||
392 | for item in grp.items(): |
|
392 | for item in grp.items(): | |
393 | name = item[0] |
|
393 | name = item[0] | |
394 | listdataname.append(name) |
|
394 | listdataname.append(name) | |
395 |
|
395 | |||
396 | array = self.__setDataArray(grp[name],self.listShapes[name]) |
|
396 | array = self.__setDataArray(grp[name],self.listShapes[name]) | |
397 | listdata.append(array) |
|
397 | listdata.append(array) | |
398 |
|
398 | |||
399 | self.listDataname = listdataname |
|
399 | self.listDataname = listdataname | |
400 | self.listData = listdata |
|
400 | self.listData = listdata | |
401 | return |
|
401 | return | |
402 |
|
402 | |||
403 | def __setDataArray(self, dataset, shapes): |
|
403 | def __setDataArray(self, dataset, shapes): | |
404 |
|
404 | |||
405 | nDims = shapes[0] |
|
405 | nDims = shapes[0] | |
406 |
|
406 | |||
407 | nDim2 = shapes[1] #Dimension 0 |
|
407 | nDim2 = shapes[1] #Dimension 0 | |
408 |
|
408 | |||
409 | nDim1 = shapes[2] #Dimension 1, number of Points or Parameters |
|
409 | nDim1 = shapes[2] #Dimension 1, number of Points or Parameters | |
410 |
|
410 | |||
411 | nDim0 = shapes[3] #Dimension 2, number of samples or ranges |
|
411 | nDim0 = shapes[3] #Dimension 2, number of samples or ranges | |
412 |
|
412 | |||
413 | mode = shapes[4] #Mode of storing |
|
413 | mode = shapes[4] #Mode of storing | |
414 |
|
414 | |||
415 | blockList = self.blockList |
|
415 | blockList = self.blockList | |
416 |
|
416 | |||
417 | blocksPerFile = self.blocksPerFile |
|
417 | blocksPerFile = self.blocksPerFile | |
418 |
|
418 | |||
419 | #Depending on what mode the data was stored |
|
419 | #Depending on what mode the data was stored | |
420 | if mode == 0: #Divided in channels |
|
420 | if mode == 0: #Divided in channels | |
421 | arrayData = dataset.value.astype(numpy.float)[0][blockList] |
|
421 | arrayData = dataset.value.astype(numpy.float)[0][blockList] | |
422 | if mode == 1: #Divided in parameter |
|
422 | if mode == 1: #Divided in parameter | |
423 | strds = 'table' |
|
423 | strds = 'table' | |
424 | nDatas = nDim1 |
|
424 | nDatas = nDim1 | |
425 | newShapes = (blocksPerFile,nDim2,nDim0) |
|
425 | newShapes = (blocksPerFile,nDim2,nDim0) | |
426 | elif mode==2: #Concatenated in a table |
|
426 | elif mode==2: #Concatenated in a table | |
427 | strds = 'table0' |
|
427 | strds = 'table0' | |
428 | arrayData = dataset[strds].value |
|
428 | arrayData = dataset[strds].value | |
429 | #Selecting part of the dataset |
|
429 | #Selecting part of the dataset | |
430 | utctime = arrayData[:,0] |
|
430 | utctime = arrayData[:,0] | |
431 | u, indices = numpy.unique(utctime, return_index=True) |
|
431 | u, indices = numpy.unique(utctime, return_index=True) | |
432 |
|
432 | |||
433 | if blockList.size != indices.size: |
|
433 | if blockList.size != indices.size: | |
434 | indMin = indices[blockList[0]] |
|
434 | indMin = indices[blockList[0]] | |
435 | if blockList[1] + 1 >= indices.size: |
|
435 | if blockList[1] + 1 >= indices.size: | |
436 | arrayData = arrayData[indMin:,:] |
|
436 | arrayData = arrayData[indMin:,:] | |
437 | else: |
|
437 | else: | |
438 | indMax = indices[blockList[1] + 1] |
|
438 | indMax = indices[blockList[1] + 1] | |
439 | arrayData = arrayData[indMin:indMax,:] |
|
439 | arrayData = arrayData[indMin:indMax,:] | |
440 | return arrayData |
|
440 | return arrayData | |
441 |
|
441 | |||
442 | # One dimension |
|
442 | # One dimension | |
443 | if nDims == 0: |
|
443 | if nDims == 0: | |
444 | arrayData = dataset.value.astype(numpy.float)[0][blockList] |
|
444 | arrayData = dataset.value.astype(numpy.float)[0][blockList] | |
445 |
|
445 | |||
446 | # Two dimensions |
|
446 | # Two dimensions | |
447 | elif nDims == 2: |
|
447 | elif nDims == 2: | |
448 | arrayData = numpy.zeros((blocksPerFile,nDim1,nDim0)) |
|
448 | arrayData = numpy.zeros((blocksPerFile,nDim1,nDim0)) | |
449 | newShapes = (blocksPerFile,nDim0) |
|
449 | newShapes = (blocksPerFile,nDim0) | |
450 | nDatas = nDim1 |
|
450 | nDatas = nDim1 | |
451 |
|
451 | |||
452 | for i in range(nDatas): |
|
452 | for i in range(nDatas): | |
453 | data = dataset[strds + str(i)].value |
|
453 | data = dataset[strds + str(i)].value | |
454 | arrayData[:,i,:] = data[blockList,:] |
|
454 | arrayData[:,i,:] = data[blockList,:] | |
455 |
|
455 | |||
456 | # Three dimensions |
|
456 | # Three dimensions | |
457 | else: |
|
457 | else: | |
458 | arrayData = numpy.zeros((blocksPerFile,nDim2,nDim1,nDim0)) |
|
458 | arrayData = numpy.zeros((blocksPerFile,nDim2,nDim1,nDim0)) | |
459 | for i in range(nDatas): |
|
459 | for i in range(nDatas): | |
460 |
|
460 | |||
461 | data = dataset[strds + str(i)].value |
|
461 | data = dataset[strds + str(i)].value | |
462 |
|
462 | |||
463 | for b in range(blockList.size): |
|
463 | for b in range(blockList.size): | |
464 | arrayData[b,:,i,:] = data[:,:,blockList[b]] |
|
464 | arrayData[b,:,i,:] = data[:,:,blockList[b]] | |
465 |
|
465 | |||
466 | return arrayData |
|
466 | return arrayData | |
467 |
|
467 | |||
468 | def __setDataOut(self): |
|
468 | def __setDataOut(self): | |
469 | listMeta = self.listMeta |
|
469 | listMeta = self.listMeta | |
470 | listMetaname = self.listMetaname |
|
470 | listMetaname = self.listMetaname | |
471 | listDataname = self.listDataname |
|
471 | listDataname = self.listDataname | |
472 | listData = self.listData |
|
472 | listData = self.listData | |
473 | listShapes = self.listShapes |
|
473 | listShapes = self.listShapes | |
474 |
|
474 | |||
475 | blockIndex = self.blockIndex |
|
475 | blockIndex = self.blockIndex | |
476 | # blockList = self.blockList |
|
476 | # blockList = self.blockList | |
477 |
|
477 | |||
478 | for i in range(len(listMeta)): |
|
478 | for i in range(len(listMeta)): | |
479 | setattr(self.dataOut,listMetaname[i],listMeta[i]) |
|
479 | setattr(self.dataOut,listMetaname[i],listMeta[i]) | |
480 |
|
480 | |||
481 | for j in range(len(listData)): |
|
481 | for j in range(len(listData)): | |
482 | nShapes = listShapes[listDataname[j]][0] |
|
482 | nShapes = listShapes[listDataname[j]][0] | |
483 | mode = listShapes[listDataname[j]][4] |
|
483 | mode = listShapes[listDataname[j]][4] | |
484 | if nShapes == 1: |
|
484 | if nShapes == 1: | |
485 | setattr(self.dataOut,listDataname[j],listData[j][blockIndex]) |
|
485 | setattr(self.dataOut,listDataname[j],listData[j][blockIndex]) | |
486 | elif nShapes > 1: |
|
486 | elif nShapes > 1: | |
487 | setattr(self.dataOut,listDataname[j],listData[j][blockIndex,:]) |
|
487 | setattr(self.dataOut,listDataname[j],listData[j][blockIndex,:]) | |
488 | elif mode==0: |
|
488 | elif mode==0: | |
489 | setattr(self.dataOut,listDataname[j],listData[j][blockIndex]) |
|
489 | setattr(self.dataOut,listDataname[j],listData[j][blockIndex]) | |
490 | #Mode Meteors |
|
490 | #Mode Meteors | |
491 | elif mode ==2: |
|
491 | elif mode ==2: | |
492 | selectedData = self.__selectDataMode2(listData[j], blockIndex) |
|
492 | selectedData = self.__selectDataMode2(listData[j], blockIndex) | |
493 | setattr(self.dataOut, listDataname[j], selectedData) |
|
493 | setattr(self.dataOut, listDataname[j], selectedData) | |
494 | return |
|
494 | return | |
495 |
|
495 | |||
496 | def __selectDataMode2(self, data, blockIndex): |
|
496 | def __selectDataMode2(self, data, blockIndex): | |
497 | utctime = data[:,0] |
|
497 | utctime = data[:,0] | |
498 | aux, indices = numpy.unique(utctime, return_inverse=True) |
|
498 | aux, indices = numpy.unique(utctime, return_inverse=True) | |
499 | selInd = numpy.where(indices == blockIndex)[0] |
|
499 | selInd = numpy.where(indices == blockIndex)[0] | |
500 | selData = data[selInd,:] |
|
500 | selData = data[selInd,:] | |
501 |
|
501 | |||
502 | return selData |
|
502 | return selData | |
503 |
|
503 | |||
504 | def getData(self): |
|
504 | def getData(self): | |
505 |
|
505 | |||
506 | # if self.flagNoMoreFiles: |
|
506 | # if self.flagNoMoreFiles: | |
507 | # self.dataOut.flagNoData = True |
|
507 | # self.dataOut.flagNoData = True | |
508 | # print 'Process finished' |
|
508 | # print 'Process finished' | |
509 | # return 0 |
|
509 | # return 0 | |
510 | # |
|
510 | # | |
511 | if self.blockIndex==self.blocksPerFile: |
|
511 | if self.blockIndex==self.blocksPerFile: | |
512 | if not( self.__setNextFileOffline() ): |
|
512 | if not( self.__setNextFileOffline() ): | |
513 | self.dataOut.flagNoData = True |
|
513 | self.dataOut.flagNoData = True | |
514 | return 0 |
|
514 | return 0 | |
515 |
|
515 | |||
516 | # if self.datablock == None: # setear esta condicion cuando no hayan datos por leers |
|
516 | # if self.datablock == None: # setear esta condicion cuando no hayan datos por leers | |
517 | # self.dataOut.flagNoData = True |
|
517 | # self.dataOut.flagNoData = True | |
518 | # return 0 |
|
518 | # return 0 | |
519 | # self.__readData() |
|
519 | # self.__readData() | |
520 | self.__setDataOut() |
|
520 | self.__setDataOut() | |
521 | self.dataOut.flagNoData = False |
|
521 | self.dataOut.flagNoData = False | |
522 |
|
522 | |||
523 | self.blockIndex += 1 |
|
523 | self.blockIndex += 1 | |
524 |
|
524 | |||
525 | return |
|
525 | return | |
526 |
|
526 | |||
527 | def run(self, **kwargs): |
|
527 | def run(self, **kwargs): | |
528 |
|
528 | |||
529 | if not(self.isConfig): |
|
529 | if not(self.isConfig): | |
530 | self.setup(**kwargs) |
|
530 | self.setup(**kwargs) | |
531 | # self.setObjProperties() |
|
531 | # self.setObjProperties() | |
532 | self.isConfig = True |
|
532 | self.isConfig = True | |
533 |
|
533 | |||
534 | self.getData() |
|
534 | self.getData() | |
535 |
|
535 | |||
536 | return |
|
536 | return | |
537 |
|
537 | |||
538 | class ParamWriter(Operation): |
|
538 | class ParamWriter(Operation): | |
539 | ''' |
|
539 | ''' | |
540 | HDF5 Writer, stores parameters data in HDF5 format files |
|
540 | HDF5 Writer, stores parameters data in HDF5 format files | |
541 |
|
541 | |||
542 | path: path where the files will be stored |
|
542 | path: path where the files will be stored | |
543 |
|
543 | |||
544 | blocksPerFile: number of blocks that will be saved in per HDF5 format file |
|
544 | blocksPerFile: number of blocks that will be saved in per HDF5 format file | |
545 |
|
545 | |||
546 | mode: selects the data stacking mode: '0' channels, '1' parameters, '3' table (for meteors) |
|
546 | mode: selects the data stacking mode: '0' channels, '1' parameters, '3' table (for meteors) | |
547 |
|
547 | |||
548 | metadataList: list of attributes that will be stored as metadata |
|
548 | metadataList: list of attributes that will be stored as metadata | |
549 |
|
549 | |||
550 | dataList: list of attributes that will be stores as data |
|
550 | dataList: list of attributes that will be stores as data | |
551 |
|
551 | |||
552 | ''' |
|
552 | ''' | |
553 |
|
553 | |||
554 |
|
554 | |||
555 | ext = ".hdf5" |
|
555 | ext = ".hdf5" | |
556 |
|
556 | |||
557 | optchar = "D" |
|
557 | optchar = "D" | |
558 |
|
558 | |||
559 | metaoptchar = "M" |
|
559 | metaoptchar = "M" | |
560 |
|
560 | |||
561 | metaFile = None |
|
561 | metaFile = None | |
562 |
|
562 | |||
563 | filename = None |
|
563 | filename = None | |
564 |
|
564 | |||
565 | path = None |
|
565 | path = None | |
566 |
|
566 | |||
567 | setFile = None |
|
567 | setFile = None | |
568 |
|
568 | |||
569 | fp = None |
|
569 | fp = None | |
570 |
|
570 | |||
571 | grp = None |
|
571 | grp = None | |
572 |
|
572 | |||
573 | ds = None |
|
573 | ds = None | |
574 |
|
574 | |||
575 | firsttime = True |
|
575 | firsttime = True | |
576 |
|
576 | |||
577 | #Configurations |
|
577 | #Configurations | |
578 |
|
578 | |||
579 | blocksPerFile = None |
|
579 | blocksPerFile = None | |
580 |
|
580 | |||
581 | blockIndex = None |
|
581 | blockIndex = None | |
582 |
|
582 | |||
583 | dataOut = None |
|
583 | dataOut = None | |
584 |
|
584 | |||
585 | #Data Arrays |
|
585 | #Data Arrays | |
586 |
|
586 | |||
587 | dataList = None |
|
587 | dataList = None | |
588 |
|
588 | |||
589 | metadataList = None |
|
589 | metadataList = None | |
590 |
|
590 | |||
591 | # arrayDim = None |
|
591 | # arrayDim = None | |
592 |
|
592 | |||
593 | dsList = None #List of dictionaries with dataset properties |
|
593 | dsList = None #List of dictionaries with dataset properties | |
594 |
|
594 | |||
595 | tableDim = None |
|
595 | tableDim = None | |
596 |
|
596 | |||
597 | # dtype = [('arrayName', 'S20'),('nChannels', 'i'), ('nPoints', 'i'), ('nSamples', 'i'),('mode', 'b')] |
|
597 | # dtype = [('arrayName', 'S20'),('nChannels', 'i'), ('nPoints', 'i'), ('nSamples', 'i'),('mode', 'b')] | |
598 |
|
598 | |||
599 | dtype = [('arrayName', 'S20'),('nDimensions', 'i'), ('dim2', 'i'), ('dim1', 'i'),('dim0', 'i'),('mode', 'b')] |
|
599 | dtype = [('arrayName', 'S20'),('nDimensions', 'i'), ('dim2', 'i'), ('dim1', 'i'),('dim0', 'i'),('mode', 'b')] | |
600 |
|
600 | |||
601 | currentDay = None |
|
601 | currentDay = None | |
602 |
|
602 | |||
603 | lastTime = None |
|
603 | lastTime = None | |
604 |
|
604 | |||
|
605 | parameters = { | |||
|
606 | 'path': global_type_string, | |||
|
607 | 'blocksPerFile':global_type_integer, | |||
|
608 | 'metadataList': global_type_list, | |||
|
609 | 'dataList': global_type_list, | |||
|
610 | 'mode': global_type_integer, | |||
|
611 | } | |||
|
612 | ||||
605 | def __init__(self, **kwargs): |
|
613 | def __init__(self, **kwargs): | |
606 | Operation.__init__(self, **kwargs) |
|
614 | Operation.__init__(self, **kwargs) | |
607 | self.isConfig = False |
|
615 | self.isConfig = False | |
608 | return |
|
616 | return | |
609 |
|
617 | |||
610 | def setup(self, dataOut, **kwargs): |
|
618 | def setup(self, dataOut, path=None, blocksPerFile=10, metadataList=None, dataList=None, mode=None, **kwargs): | |
611 |
|
||||
612 | self.path = kwargs['path'] |
|
|||
613 |
|
619 | |||
614 | if kwargs.has_key('blocksPerFile'): |
|
620 | self.path = path | |
615 |
|
|
621 | self.blocksPerFile = blocksPerFile | |
616 | else: |
|
622 | self.metadataList = metadataList | |
617 | self.blocksPerFile = 10 |
|
623 | self.dataList = dataList | |
618 |
|
||||
619 | self.metadataList = kwargs['metadataList'] |
|
|||
620 | self.dataList = kwargs['dataList'] |
|
|||
621 | self.dataOut = dataOut |
|
624 | self.dataOut = dataOut | |
622 |
|
||||
623 | if kwargs.has_key('mode'): |
|
|||
624 | mode = kwargs['mode'] |
|
|||
625 |
|
||||
626 | if type(mode) == int: |
|
|||
627 | mode = numpy.zeros(len(self.dataList)) + mode |
|
|||
628 | else: |
|
|||
629 | mode = numpy.ones(len(self.dataList)) |
|
|||
630 |
|
||||
631 | self.mode = mode |
|
625 | self.mode = mode | |
|
626 | ||||
|
627 | if self.mode is not None: | |||
|
628 | self.mode = numpy.zeros(len(self.dataList)) + mode | |||
|
629 | else: | |||
|
630 | self.mode = numpy.ones(len(self.dataList)) | |||
632 |
|
631 | |||
633 | arrayDim = numpy.zeros((len(self.dataList),5)) |
|
632 | arrayDim = numpy.zeros((len(self.dataList),5)) | |
634 |
|
633 | |||
635 | #Table dimensions |
|
634 | #Table dimensions | |
636 | dtype0 = self.dtype |
|
635 | dtype0 = self.dtype | |
637 | tableList = [] |
|
636 | tableList = [] | |
638 |
|
637 | |||
639 | #Dictionary and list of tables |
|
638 | #Dictionary and list of tables | |
640 | dsList = [] |
|
639 | dsList = [] | |
641 |
|
640 | |||
642 | for i in range(len(self.dataList)): |
|
641 | for i in range(len(self.dataList)): | |
643 | dsDict = {} |
|
642 | dsDict = {} | |
644 | dataAux = getattr(self.dataOut, self.dataList[i]) |
|
643 | dataAux = getattr(self.dataOut, self.dataList[i]) | |
645 | dsDict['variable'] = self.dataList[i] |
|
644 | dsDict['variable'] = self.dataList[i] | |
646 | #--------------------- Conditionals ------------------------ |
|
645 | #--------------------- Conditionals ------------------------ | |
647 | #There is no data |
|
646 | #There is no data | |
648 | if dataAux is None: |
|
647 | if dataAux is None: | |
649 | return 0 |
|
648 | return 0 | |
650 |
|
649 | |||
651 | #Not array, just a number |
|
650 | #Not array, just a number | |
652 | #Mode 0 |
|
651 | #Mode 0 | |
653 | if type(dataAux)==float or type(dataAux)==int: |
|
652 | if type(dataAux)==float or type(dataAux)==int: | |
654 | dsDict['mode'] = 0 |
|
653 | dsDict['mode'] = 0 | |
655 | dsDict['nDim'] = 0 |
|
654 | dsDict['nDim'] = 0 | |
656 | arrayDim[i,0] = 0 |
|
655 | arrayDim[i,0] = 0 | |
657 | dsList.append(dsDict) |
|
656 | dsList.append(dsDict) | |
658 |
|
657 | |||
659 | #Mode 2: meteors |
|
658 | #Mode 2: meteors | |
660 | elif mode[i] == 2: |
|
659 | elif mode[i] == 2: | |
661 | # dsDict['nDim'] = 0 |
|
660 | # dsDict['nDim'] = 0 | |
662 | dsDict['dsName'] = 'table0' |
|
661 | dsDict['dsName'] = 'table0' | |
663 | dsDict['mode'] = 2 # Mode meteors |
|
662 | dsDict['mode'] = 2 # Mode meteors | |
664 | dsDict['shape'] = dataAux.shape[-1] |
|
663 | dsDict['shape'] = dataAux.shape[-1] | |
665 | dsDict['nDim'] = 0 |
|
664 | dsDict['nDim'] = 0 | |
666 | dsDict['dsNumber'] = 1 |
|
665 | dsDict['dsNumber'] = 1 | |
667 |
|
666 | |||
668 | arrayDim[i,3] = dataAux.shape[-1] |
|
667 | arrayDim[i,3] = dataAux.shape[-1] | |
669 | arrayDim[i,4] = mode[i] #Mode the data was stored |
|
668 | arrayDim[i,4] = mode[i] #Mode the data was stored | |
670 |
|
669 | |||
671 | dsList.append(dsDict) |
|
670 | dsList.append(dsDict) | |
672 |
|
671 | |||
673 | #Mode 1 |
|
672 | #Mode 1 | |
674 | else: |
|
673 | else: | |
675 | arrayDim0 = dataAux.shape #Data dimensions |
|
674 | arrayDim0 = dataAux.shape #Data dimensions | |
676 | arrayDim[i,0] = len(arrayDim0) #Number of array dimensions |
|
675 | arrayDim[i,0] = len(arrayDim0) #Number of array dimensions | |
677 | arrayDim[i,4] = mode[i] #Mode the data was stored |
|
676 | arrayDim[i,4] = mode[i] #Mode the data was stored | |
678 |
|
677 | |||
679 | strtable = 'table' |
|
678 | strtable = 'table' | |
680 | dsDict['mode'] = 1 # Mode parameters |
|
679 | dsDict['mode'] = 1 # Mode parameters | |
681 |
|
680 | |||
682 | # Three-dimension arrays |
|
681 | # Three-dimension arrays | |
683 | if len(arrayDim0) == 3: |
|
682 | if len(arrayDim0) == 3: | |
684 | arrayDim[i,1:-1] = numpy.array(arrayDim0) |
|
683 | arrayDim[i,1:-1] = numpy.array(arrayDim0) | |
685 | nTables = int(arrayDim[i,2]) |
|
684 | nTables = int(arrayDim[i,2]) | |
686 | dsDict['dsNumber'] = nTables |
|
685 | dsDict['dsNumber'] = nTables | |
687 | dsDict['shape'] = arrayDim[i,2:4] |
|
686 | dsDict['shape'] = arrayDim[i,2:4] | |
688 | dsDict['nDim'] = 3 |
|
687 | dsDict['nDim'] = 3 | |
689 |
|
688 | |||
690 | for j in range(nTables): |
|
689 | for j in range(nTables): | |
691 | dsDict = dsDict.copy() |
|
690 | dsDict = dsDict.copy() | |
692 | dsDict['dsName'] = strtable + str(j) |
|
691 | dsDict['dsName'] = strtable + str(j) | |
693 | dsList.append(dsDict) |
|
692 | dsList.append(dsDict) | |
694 |
|
693 | |||
695 | # Two-dimension arrays |
|
694 | # Two-dimension arrays | |
696 | elif len(arrayDim0) == 2: |
|
695 | elif len(arrayDim0) == 2: | |
697 | arrayDim[i,2:-1] = numpy.array(arrayDim0) |
|
696 | arrayDim[i,2:-1] = numpy.array(arrayDim0) | |
698 | nTables = int(arrayDim[i,2]) |
|
697 | nTables = int(arrayDim[i,2]) | |
699 | dsDict['dsNumber'] = nTables |
|
698 | dsDict['dsNumber'] = nTables | |
700 | dsDict['shape'] = arrayDim[i,3] |
|
699 | dsDict['shape'] = arrayDim[i,3] | |
701 | dsDict['nDim'] = 2 |
|
700 | dsDict['nDim'] = 2 | |
702 |
|
701 | |||
703 | for j in range(nTables): |
|
702 | for j in range(nTables): | |
704 | dsDict = dsDict.copy() |
|
703 | dsDict = dsDict.copy() | |
705 | dsDict['dsName'] = strtable + str(j) |
|
704 | dsDict['dsName'] = strtable + str(j) | |
706 | dsList.append(dsDict) |
|
705 | dsList.append(dsDict) | |
707 |
|
706 | |||
708 | # One-dimension arrays |
|
707 | # One-dimension arrays | |
709 | elif len(arrayDim0) == 1: |
|
708 | elif len(arrayDim0) == 1: | |
710 | arrayDim[i,3] = arrayDim0[0] |
|
709 | arrayDim[i,3] = arrayDim0[0] | |
711 | dsDict['shape'] = arrayDim0[0] |
|
710 | dsDict['shape'] = arrayDim0[0] | |
712 | dsDict['dsNumber'] = 1 |
|
711 | dsDict['dsNumber'] = 1 | |
713 | dsDict['dsName'] = strtable + str(0) |
|
712 | dsDict['dsName'] = strtable + str(0) | |
714 | dsDict['nDim'] = 1 |
|
713 | dsDict['nDim'] = 1 | |
715 | dsList.append(dsDict) |
|
714 | dsList.append(dsDict) | |
716 |
|
715 | |||
717 | table = numpy.array((self.dataList[i],) + tuple(arrayDim[i,:]),dtype = dtype0) |
|
716 | table = numpy.array((self.dataList[i],) + tuple(arrayDim[i,:]),dtype = dtype0) | |
718 | tableList.append(table) |
|
717 | tableList.append(table) | |
719 |
|
718 | |||
720 | # self.arrayDim = arrayDim |
|
719 | # self.arrayDim = arrayDim | |
721 | self.dsList = dsList |
|
720 | self.dsList = dsList | |
722 | self.tableDim = numpy.array(tableList, dtype = dtype0) |
|
721 | self.tableDim = numpy.array(tableList, dtype = dtype0) | |
723 | self.blockIndex = 0 |
|
722 | self.blockIndex = 0 | |
724 |
|
723 | |||
725 | timeTuple = time.localtime(dataOut.utctime) |
|
724 | timeTuple = time.localtime(dataOut.utctime) | |
726 | self.currentDay = timeTuple.tm_yday |
|
725 | self.currentDay = timeTuple.tm_yday | |
727 | return 1 |
|
726 | return 1 | |
728 |
|
727 | |||
729 | def putMetadata(self): |
|
728 | def putMetadata(self): | |
730 |
|
729 | |||
731 | fp = self.createMetadataFile() |
|
730 | fp = self.createMetadataFile() | |
732 | self.writeMetadata(fp) |
|
731 | self.writeMetadata(fp) | |
733 | fp.close() |
|
732 | fp.close() | |
734 | return |
|
733 | return | |
735 |
|
734 | |||
736 | def createMetadataFile(self): |
|
735 | def createMetadataFile(self): | |
737 | ext = self.ext |
|
736 | ext = self.ext | |
738 | path = self.path |
|
737 | path = self.path | |
739 | setFile = self.setFile |
|
738 | setFile = self.setFile | |
740 |
|
739 | |||
741 | timeTuple = time.localtime(self.dataOut.utctime) |
|
740 | timeTuple = time.localtime(self.dataOut.utctime) | |
742 |
|
741 | |||
743 | subfolder = '' |
|
742 | subfolder = '' | |
744 | fullpath = os.path.join( path, subfolder ) |
|
743 | fullpath = os.path.join( path, subfolder ) | |
745 |
|
744 | |||
746 | if not( os.path.exists(fullpath) ): |
|
745 | if not( os.path.exists(fullpath) ): | |
747 | os.mkdir(fullpath) |
|
746 | os.mkdir(fullpath) | |
748 | setFile = -1 #inicializo mi contador de seteo |
|
747 | setFile = -1 #inicializo mi contador de seteo | |
749 |
|
748 | |||
750 | subfolder = 'd%4.4d%3.3d' % (timeTuple.tm_year,timeTuple.tm_yday) |
|
749 | subfolder = 'd%4.4d%3.3d' % (timeTuple.tm_year,timeTuple.tm_yday) | |
751 | fullpath = os.path.join( path, subfolder ) |
|
750 | fullpath = os.path.join( path, subfolder ) | |
752 |
|
751 | |||
753 | if not( os.path.exists(fullpath) ): |
|
752 | if not( os.path.exists(fullpath) ): | |
754 | os.mkdir(fullpath) |
|
753 | os.mkdir(fullpath) | |
755 | setFile = -1 #inicializo mi contador de seteo |
|
754 | setFile = -1 #inicializo mi contador de seteo | |
756 |
|
755 | |||
757 | else: |
|
756 | else: | |
758 | filesList = os.listdir( fullpath ) |
|
757 | filesList = os.listdir( fullpath ) | |
759 | filesList = sorted( filesList, key=str.lower ) |
|
758 | filesList = sorted( filesList, key=str.lower ) | |
760 | if len( filesList ) > 0: |
|
759 | if len( filesList ) > 0: | |
761 | filesList = [k for k in filesList if 'M' in k] |
|
760 | filesList = [k for k in filesList if 'M' in k] | |
762 | filen = filesList[-1] |
|
761 | filen = filesList[-1] | |
763 | # el filename debera tener el siguiente formato |
|
762 | # el filename debera tener el siguiente formato | |
764 | # 0 1234 567 89A BCDE (hex) |
|
763 | # 0 1234 567 89A BCDE (hex) | |
765 | # x YYYY DDD SSS .ext |
|
764 | # x YYYY DDD SSS .ext | |
766 | if isNumber( filen[8:11] ): |
|
765 | if isNumber( filen[8:11] ): | |
767 | setFile = int( filen[8:11] ) #inicializo mi contador de seteo al seteo del ultimo file |
|
766 | setFile = int( filen[8:11] ) #inicializo mi contador de seteo al seteo del ultimo file | |
768 | else: |
|
767 | else: | |
769 | setFile = -1 |
|
768 | setFile = -1 | |
770 | else: |
|
769 | else: | |
771 | setFile = -1 #inicializo mi contador de seteo |
|
770 | setFile = -1 #inicializo mi contador de seteo | |
772 |
|
771 | |||
773 | setFile += 1 |
|
772 | setFile += 1 | |
774 |
|
773 | |||
775 | file = '%s%4.4d%3.3d%3.3d%s' % (self.metaoptchar, |
|
774 | file = '%s%4.4d%3.3d%3.3d%s' % (self.metaoptchar, | |
776 | timeTuple.tm_year, |
|
775 | timeTuple.tm_year, | |
777 | timeTuple.tm_yday, |
|
776 | timeTuple.tm_yday, | |
778 | setFile, |
|
777 | setFile, | |
779 | ext ) |
|
778 | ext ) | |
780 |
|
779 | |||
781 | filename = os.path.join( path, subfolder, file ) |
|
780 | filename = os.path.join( path, subfolder, file ) | |
782 | self.metaFile = file |
|
781 | self.metaFile = file | |
783 | #Setting HDF5 File |
|
782 | #Setting HDF5 File | |
784 | fp = h5py.File(filename,'w') |
|
783 | fp = h5py.File(filename,'w') | |
785 |
|
784 | |||
786 | return fp |
|
785 | return fp | |
787 |
|
786 | |||
788 | def writeMetadata(self, fp): |
|
787 | def writeMetadata(self, fp): | |
789 |
|
788 | |||
790 | grp = fp.create_group("Metadata") |
|
789 | grp = fp.create_group("Metadata") | |
791 | grp.create_dataset('array dimensions', data = self.tableDim, dtype = self.dtype) |
|
790 | grp.create_dataset('array dimensions', data = self.tableDim, dtype = self.dtype) | |
792 |
|
791 | |||
793 | for i in range(len(self.metadataList)): |
|
792 | for i in range(len(self.metadataList)): | |
794 | grp.create_dataset(self.metadataList[i], data=getattr(self.dataOut, self.metadataList[i])) |
|
793 | grp.create_dataset(self.metadataList[i], data=getattr(self.dataOut, self.metadataList[i])) | |
795 | return |
|
794 | return | |
796 |
|
795 | |||
797 | def timeFlag(self): |
|
796 | def timeFlag(self): | |
798 | currentTime = self.dataOut.utctime |
|
797 | currentTime = self.dataOut.utctime | |
799 |
|
798 | |||
800 | if self.lastTime is None: |
|
799 | if self.lastTime is None: | |
801 | self.lastTime = currentTime |
|
800 | self.lastTime = currentTime | |
802 |
|
801 | |||
803 | #Day |
|
802 | #Day | |
804 | timeTuple = time.localtime(currentTime) |
|
803 | timeTuple = time.localtime(currentTime) | |
805 | dataDay = timeTuple.tm_yday |
|
804 | dataDay = timeTuple.tm_yday | |
806 |
|
805 | |||
807 | #Time |
|
806 | #Time | |
808 | timeDiff = currentTime - self.lastTime |
|
807 | timeDiff = currentTime - self.lastTime | |
809 |
|
808 | |||
810 | #Si el dia es diferente o si la diferencia entre un dato y otro supera la hora |
|
809 | #Si el dia es diferente o si la diferencia entre un dato y otro supera la hora | |
811 | if dataDay != self.currentDay: |
|
810 | if dataDay != self.currentDay: | |
812 | self.currentDay = dataDay |
|
811 | self.currentDay = dataDay | |
813 | return True |
|
812 | return True | |
814 | elif timeDiff > 3*60*60: |
|
813 | elif timeDiff > 3*60*60: | |
815 | self.lastTime = currentTime |
|
814 | self.lastTime = currentTime | |
816 | return True |
|
815 | return True | |
817 | else: |
|
816 | else: | |
818 | self.lastTime = currentTime |
|
817 | self.lastTime = currentTime | |
819 | return False |
|
818 | return False | |
820 |
|
819 | |||
821 | def setNextFile(self): |
|
820 | def setNextFile(self): | |
822 |
|
821 | |||
823 | ext = self.ext |
|
822 | ext = self.ext | |
824 | path = self.path |
|
823 | path = self.path | |
825 | setFile = self.setFile |
|
824 | setFile = self.setFile | |
826 | mode = self.mode |
|
825 | mode = self.mode | |
827 |
|
826 | |||
828 | timeTuple = time.localtime(self.dataOut.utctime) |
|
827 | timeTuple = time.localtime(self.dataOut.utctime) | |
829 | subfolder = 'd%4.4d%3.3d' % (timeTuple.tm_year,timeTuple.tm_yday) |
|
828 | subfolder = 'd%4.4d%3.3d' % (timeTuple.tm_year,timeTuple.tm_yday) | |
830 |
|
829 | |||
831 | fullpath = os.path.join( path, subfolder ) |
|
830 | fullpath = os.path.join( path, subfolder ) | |
832 |
|
831 | |||
833 | if os.path.exists(fullpath): |
|
832 | if os.path.exists(fullpath): | |
834 | filesList = os.listdir( fullpath ) |
|
833 | filesList = os.listdir( fullpath ) | |
835 | filesList = [k for k in filesList if 'D' in k] |
|
834 | filesList = [k for k in filesList if 'D' in k] | |
836 | if len( filesList ) > 0: |
|
835 | if len( filesList ) > 0: | |
837 | filesList = sorted( filesList, key=str.lower ) |
|
836 | filesList = sorted( filesList, key=str.lower ) | |
838 | filen = filesList[-1] |
|
837 | filen = filesList[-1] | |
839 | # el filename debera tener el siguiente formato |
|
838 | # el filename debera tener el siguiente formato | |
840 | # 0 1234 567 89A BCDE (hex) |
|
839 | # 0 1234 567 89A BCDE (hex) | |
841 | # x YYYY DDD SSS .ext |
|
840 | # x YYYY DDD SSS .ext | |
842 | if isNumber( filen[8:11] ): |
|
841 | if isNumber( filen[8:11] ): | |
843 | setFile = int( filen[8:11] ) #inicializo mi contador de seteo al seteo del ultimo file |
|
842 | setFile = int( filen[8:11] ) #inicializo mi contador de seteo al seteo del ultimo file | |
844 | else: |
|
843 | else: | |
845 | setFile = -1 |
|
844 | setFile = -1 | |
846 | else: |
|
845 | else: | |
847 | setFile = -1 #inicializo mi contador de seteo |
|
846 | setFile = -1 #inicializo mi contador de seteo | |
848 | else: |
|
847 | else: | |
849 | os.makedirs(fullpath) |
|
848 | os.makedirs(fullpath) | |
850 | setFile = -1 #inicializo mi contador de seteo |
|
849 | setFile = -1 #inicializo mi contador de seteo | |
851 |
|
850 | |||
852 | setFile += 1 |
|
851 | setFile += 1 | |
853 |
|
852 | |||
854 | file = '%s%4.4d%3.3d%3.3d%s' % (self.optchar, |
|
853 | file = '%s%4.4d%3.3d%3.3d%s' % (self.optchar, | |
855 | timeTuple.tm_year, |
|
854 | timeTuple.tm_year, | |
856 | timeTuple.tm_yday, |
|
855 | timeTuple.tm_yday, | |
857 | setFile, |
|
856 | setFile, | |
858 | ext ) |
|
857 | ext ) | |
859 |
|
858 | |||
860 | filename = os.path.join( path, subfolder, file ) |
|
859 | filename = os.path.join( path, subfolder, file ) | |
861 |
|
860 | |||
862 | #Setting HDF5 File |
|
861 | #Setting HDF5 File | |
863 | fp = h5py.File(filename,'w') |
|
862 | fp = h5py.File(filename,'w') | |
864 | #write metadata |
|
863 | #write metadata | |
865 | self.writeMetadata(fp) |
|
864 | self.writeMetadata(fp) | |
866 | #Write data |
|
865 | #Write data | |
867 | grp = fp.create_group("Data") |
|
866 | grp = fp.create_group("Data") | |
868 | # grp.attrs['metadata'] = self.metaFile |
|
867 | # grp.attrs['metadata'] = self.metaFile | |
869 |
|
868 | |||
870 | # grp.attrs['blocksPerFile'] = 0 |
|
869 | # grp.attrs['blocksPerFile'] = 0 | |
871 | ds = [] |
|
870 | ds = [] | |
872 | data = [] |
|
871 | data = [] | |
873 | dsList = self.dsList |
|
872 | dsList = self.dsList | |
874 | i = 0 |
|
873 | i = 0 | |
875 | while i < len(dsList): |
|
874 | while i < len(dsList): | |
876 | dsInfo = dsList[i] |
|
875 | dsInfo = dsList[i] | |
877 | #One-dimension data |
|
876 | #One-dimension data | |
878 | if dsInfo['mode'] == 0: |
|
877 | if dsInfo['mode'] == 0: | |
879 | # ds0 = grp.create_dataset(self.dataList[i], (1,1), maxshape=(1,self.blocksPerFile) , chunks = True, dtype='S20') |
|
878 | # ds0 = grp.create_dataset(self.dataList[i], (1,1), maxshape=(1,self.blocksPerFile) , chunks = True, dtype='S20') | |
880 | ds0 = grp.create_dataset(dsInfo['variable'], (1,1), maxshape=(1,self.blocksPerFile) , chunks = True, dtype=numpy.float64) |
|
879 | ds0 = grp.create_dataset(dsInfo['variable'], (1,1), maxshape=(1,self.blocksPerFile) , chunks = True, dtype=numpy.float64) | |
881 | ds.append(ds0) |
|
880 | ds.append(ds0) | |
882 | data.append([]) |
|
881 | data.append([]) | |
883 | i += 1 |
|
882 | i += 1 | |
884 | continue |
|
883 | continue | |
885 | # nDimsForDs.append(nDims[i]) |
|
884 | # nDimsForDs.append(nDims[i]) | |
886 |
|
885 | |||
887 | elif dsInfo['mode'] == 2: |
|
886 | elif dsInfo['mode'] == 2: | |
888 | grp0 = grp.create_group(dsInfo['variable']) |
|
887 | grp0 = grp.create_group(dsInfo['variable']) | |
889 | ds0 = grp0.create_dataset(dsInfo['dsName'], (1,dsInfo['shape']), data = numpy.zeros((1,dsInfo['shape'])) , maxshape=(None,dsInfo['shape']), chunks=True) |
|
888 | ds0 = grp0.create_dataset(dsInfo['dsName'], (1,dsInfo['shape']), data = numpy.zeros((1,dsInfo['shape'])) , maxshape=(None,dsInfo['shape']), chunks=True) | |
890 | ds.append(ds0) |
|
889 | ds.append(ds0) | |
891 | data.append([]) |
|
890 | data.append([]) | |
892 | i += 1 |
|
891 | i += 1 | |
893 | continue |
|
892 | continue | |
894 |
|
893 | |||
895 | elif dsInfo['mode'] == 1: |
|
894 | elif dsInfo['mode'] == 1: | |
896 | grp0 = grp.create_group(dsInfo['variable']) |
|
895 | grp0 = grp.create_group(dsInfo['variable']) | |
897 |
|
896 | |||
898 | for j in range(dsInfo['dsNumber']): |
|
897 | for j in range(dsInfo['dsNumber']): | |
899 | dsInfo = dsList[i] |
|
898 | dsInfo = dsList[i] | |
900 | tableName = dsInfo['dsName'] |
|
899 | tableName = dsInfo['dsName'] | |
901 | shape = int(dsInfo['shape']) |
|
900 | shape = int(dsInfo['shape']) | |
902 |
|
901 | |||
903 | if dsInfo['nDim'] == 3: |
|
902 | if dsInfo['nDim'] == 3: | |
904 | ds0 = grp0.create_dataset(tableName, (shape[0],shape[1],1) , data = numpy.zeros((shape[0],shape[1],1)), maxshape = (None,shape[1],None), chunks=True) |
|
903 | ds0 = grp0.create_dataset(tableName, (shape[0],shape[1],1) , data = numpy.zeros((shape[0],shape[1],1)), maxshape = (None,shape[1],None), chunks=True) | |
905 | else: |
|
904 | else: | |
906 | ds0 = grp0.create_dataset(tableName, (1,shape), data = numpy.zeros((1,shape)) , maxshape=(None,shape), chunks=True) |
|
905 | ds0 = grp0.create_dataset(tableName, (1,shape), data = numpy.zeros((1,shape)) , maxshape=(None,shape), chunks=True) | |
907 |
|
906 | |||
908 | ds.append(ds0) |
|
907 | ds.append(ds0) | |
909 | data.append([]) |
|
908 | data.append([]) | |
910 | i += 1 |
|
909 | i += 1 | |
911 | # nDimsForDs.append(nDims[i]) |
|
910 | # nDimsForDs.append(nDims[i]) | |
912 |
|
911 | |||
913 | fp.flush() |
|
912 | fp.flush() | |
914 | fp.close() |
|
913 | fp.close() | |
915 |
|
914 | |||
916 | # self.nDatas = nDatas |
|
915 | # self.nDatas = nDatas | |
917 | # self.nDims = nDims |
|
916 | # self.nDims = nDims | |
918 | # self.nDimsForDs = nDimsForDs |
|
917 | # self.nDimsForDs = nDimsForDs | |
919 | #Saving variables |
|
918 | #Saving variables | |
920 | print 'Writing the file: %s'%filename |
|
919 | print 'Writing the file: %s'%filename | |
921 | self.filename = filename |
|
920 | self.filename = filename | |
922 | # self.fp = fp |
|
921 | # self.fp = fp | |
923 | # self.grp = grp |
|
922 | # self.grp = grp | |
924 | # self.grp.attrs.modify('nRecords', 1) |
|
923 | # self.grp.attrs.modify('nRecords', 1) | |
925 | self.ds = ds |
|
924 | self.ds = ds | |
926 | self.data = data |
|
925 | self.data = data | |
927 | # self.setFile = setFile |
|
926 | # self.setFile = setFile | |
928 | self.firsttime = True |
|
927 | self.firsttime = True | |
929 | self.blockIndex = 0 |
|
928 | self.blockIndex = 0 | |
930 | return |
|
929 | return | |
931 |
|
930 | |||
932 | def putData(self): |
|
931 | def putData(self): | |
933 |
|
932 | |||
934 | if self.blockIndex == self.blocksPerFile or self.timeFlag(): |
|
933 | if self.blockIndex == self.blocksPerFile or self.timeFlag(): | |
935 | self.setNextFile() |
|
934 | self.setNextFile() | |
936 |
|
935 | |||
937 | # if not self.firsttime: |
|
936 | # if not self.firsttime: | |
938 | self.readBlock() |
|
937 | self.readBlock() | |
939 | self.setBlock() #Prepare data to be written |
|
938 | self.setBlock() #Prepare data to be written | |
940 | self.writeBlock() #Write data |
|
939 | self.writeBlock() #Write data | |
941 |
|
940 | |||
942 | return |
|
941 | return | |
943 |
|
942 | |||
944 | def readBlock(self): |
|
943 | def readBlock(self): | |
945 |
|
944 | |||
946 | ''' |
|
945 | ''' | |
947 | data Array configured |
|
946 | data Array configured | |
948 |
|
947 | |||
949 |
|
948 | |||
950 | self.data |
|
949 | self.data | |
951 | ''' |
|
950 | ''' | |
952 | dsList = self.dsList |
|
951 | dsList = self.dsList | |
953 | ds = self.ds |
|
952 | ds = self.ds | |
954 | #Setting HDF5 File |
|
953 | #Setting HDF5 File | |
955 | fp = h5py.File(self.filename,'r+') |
|
954 | fp = h5py.File(self.filename,'r+') | |
956 | grp = fp["Data"] |
|
955 | grp = fp["Data"] | |
957 | ind = 0 |
|
956 | ind = 0 | |
958 |
|
957 | |||
959 | # grp.attrs['blocksPerFile'] = 0 |
|
958 | # grp.attrs['blocksPerFile'] = 0 | |
960 | while ind < len(dsList): |
|
959 | while ind < len(dsList): | |
961 | dsInfo = dsList[ind] |
|
960 | dsInfo = dsList[ind] | |
962 |
|
961 | |||
963 | if dsInfo['mode'] == 0: |
|
962 | if dsInfo['mode'] == 0: | |
964 | ds0 = grp[dsInfo['variable']] |
|
963 | ds0 = grp[dsInfo['variable']] | |
965 | ds[ind] = ds0 |
|
964 | ds[ind] = ds0 | |
966 | ind += 1 |
|
965 | ind += 1 | |
967 | else: |
|
966 | else: | |
968 |
|
967 | |||
969 | grp0 = grp[dsInfo['variable']] |
|
968 | grp0 = grp[dsInfo['variable']] | |
970 |
|
969 | |||
971 | for j in range(dsInfo['dsNumber']): |
|
970 | for j in range(dsInfo['dsNumber']): | |
972 | dsInfo = dsList[ind] |
|
971 | dsInfo = dsList[ind] | |
973 | ds0 = grp0[dsInfo['dsName']] |
|
972 | ds0 = grp0[dsInfo['dsName']] | |
974 | ds[ind] = ds0 |
|
973 | ds[ind] = ds0 | |
975 | ind += 1 |
|
974 | ind += 1 | |
976 |
|
975 | |||
977 | self.fp = fp |
|
976 | self.fp = fp | |
978 | self.grp = grp |
|
977 | self.grp = grp | |
979 | self.ds = ds |
|
978 | self.ds = ds | |
980 |
|
979 | |||
981 | return |
|
980 | return | |
982 |
|
981 | |||
983 | def setBlock(self): |
|
982 | def setBlock(self): | |
984 | ''' |
|
983 | ''' | |
985 | data Array configured |
|
984 | data Array configured | |
986 |
|
985 | |||
987 |
|
986 | |||
988 | self.data |
|
987 | self.data | |
989 | ''' |
|
988 | ''' | |
990 | #Creating Arrays |
|
989 | #Creating Arrays | |
991 | dsList = self.dsList |
|
990 | dsList = self.dsList | |
992 | data = self.data |
|
991 | data = self.data | |
993 | ind = 0 |
|
992 | ind = 0 | |
994 |
|
993 | |||
995 | while ind < len(dsList): |
|
994 | while ind < len(dsList): | |
996 | dsInfo = dsList[ind] |
|
995 | dsInfo = dsList[ind] | |
997 | dataAux = getattr(self.dataOut, dsInfo['variable']) |
|
996 | dataAux = getattr(self.dataOut, dsInfo['variable']) | |
998 |
|
997 | |||
999 | mode = dsInfo['mode'] |
|
998 | mode = dsInfo['mode'] | |
1000 | nDim = dsInfo['nDim'] |
|
999 | nDim = dsInfo['nDim'] | |
1001 |
|
1000 | |||
1002 | if mode == 0 or mode == 2 or nDim == 1: |
|
1001 | if mode == 0 or mode == 2 or nDim == 1: | |
1003 | data[ind] = dataAux |
|
1002 | data[ind] = dataAux | |
1004 | ind += 1 |
|
1003 | ind += 1 | |
1005 | # elif nDim == 1: |
|
1004 | # elif nDim == 1: | |
1006 | # data[ind] = numpy.reshape(dataAux,(numpy.size(dataAux),1)) |
|
1005 | # data[ind] = numpy.reshape(dataAux,(numpy.size(dataAux),1)) | |
1007 | # ind += 1 |
|
1006 | # ind += 1 | |
1008 | elif nDim == 2: |
|
1007 | elif nDim == 2: | |
1009 | for j in range(dsInfo['dsNumber']): |
|
1008 | for j in range(dsInfo['dsNumber']): | |
1010 | data[ind] = dataAux[j,:] |
|
1009 | data[ind] = dataAux[j,:] | |
1011 | ind += 1 |
|
1010 | ind += 1 | |
1012 | elif nDim == 3: |
|
1011 | elif nDim == 3: | |
1013 | for j in range(dsInfo['dsNumber']): |
|
1012 | for j in range(dsInfo['dsNumber']): | |
1014 | data[ind] = dataAux[:,j,:] |
|
1013 | data[ind] = dataAux[:,j,:] | |
1015 | ind += 1 |
|
1014 | ind += 1 | |
1016 |
|
1015 | |||
1017 | self.data = data |
|
1016 | self.data = data | |
1018 | return |
|
1017 | return | |
1019 |
|
1018 | |||
1020 | def writeBlock(self): |
|
1019 | def writeBlock(self): | |
1021 | ''' |
|
1020 | ''' | |
1022 | Saves the block in the HDF5 file |
|
1021 | Saves the block in the HDF5 file | |
1023 | ''' |
|
1022 | ''' | |
1024 | dsList = self.dsList |
|
1023 | dsList = self.dsList | |
1025 |
|
1024 | |||
1026 | for i in range(len(self.ds)): |
|
1025 | for i in range(len(self.ds)): | |
1027 | dsInfo = dsList[i] |
|
1026 | dsInfo = dsList[i] | |
1028 | nDim = dsInfo['nDim'] |
|
1027 | nDim = dsInfo['nDim'] | |
1029 | mode = dsInfo['mode'] |
|
1028 | mode = dsInfo['mode'] | |
1030 |
|
1029 | |||
1031 | # First time |
|
1030 | # First time | |
1032 | if self.firsttime: |
|
1031 | if self.firsttime: | |
1033 | # self.ds[i].resize(self.data[i].shape) |
|
1032 | # self.ds[i].resize(self.data[i].shape) | |
1034 | # self.ds[i][self.blockIndex,:] = self.data[i] |
|
1033 | # self.ds[i][self.blockIndex,:] = self.data[i] | |
1035 | if type(self.data[i]) == numpy.ndarray: |
|
1034 | if type(self.data[i]) == numpy.ndarray: | |
1036 |
|
1035 | |||
1037 | if nDim == 3: |
|
1036 | if nDim == 3: | |
1038 | self.data[i] = self.data[i].reshape((self.data[i].shape[0],self.data[i].shape[1],1)) |
|
1037 | self.data[i] = self.data[i].reshape((self.data[i].shape[0],self.data[i].shape[1],1)) | |
1039 | self.ds[i].resize(self.data[i].shape) |
|
1038 | self.ds[i].resize(self.data[i].shape) | |
1040 | if mode == 2: |
|
1039 | if mode == 2: | |
1041 | self.ds[i].resize(self.data[i].shape) |
|
1040 | self.ds[i].resize(self.data[i].shape) | |
1042 | self.ds[i][:] = self.data[i] |
|
1041 | self.ds[i][:] = self.data[i] | |
1043 | else: |
|
1042 | else: | |
1044 |
|
1043 | |||
1045 | # From second time |
|
1044 | # From second time | |
1046 | # Meteors! |
|
1045 | # Meteors! | |
1047 | if mode == 2: |
|
1046 | if mode == 2: | |
1048 | dataShape = self.data[i].shape |
|
1047 | dataShape = self.data[i].shape | |
1049 | dsShape = self.ds[i].shape |
|
1048 | dsShape = self.ds[i].shape | |
1050 | self.ds[i].resize((self.ds[i].shape[0] + dataShape[0],self.ds[i].shape[1])) |
|
1049 | self.ds[i].resize((self.ds[i].shape[0] + dataShape[0],self.ds[i].shape[1])) | |
1051 | self.ds[i][dsShape[0]:,:] = self.data[i] |
|
1050 | self.ds[i][dsShape[0]:,:] = self.data[i] | |
1052 | # No dimension |
|
1051 | # No dimension | |
1053 | elif mode == 0: |
|
1052 | elif mode == 0: | |
1054 | self.ds[i].resize((self.ds[i].shape[0], self.ds[i].shape[1] + 1)) |
|
1053 | self.ds[i].resize((self.ds[i].shape[0], self.ds[i].shape[1] + 1)) | |
1055 | self.ds[i][0,-1] = self.data[i] |
|
1054 | self.ds[i][0,-1] = self.data[i] | |
1056 | # One dimension |
|
1055 | # One dimension | |
1057 | elif nDim == 1: |
|
1056 | elif nDim == 1: | |
1058 | self.ds[i].resize((self.ds[i].shape[0] + 1, self.ds[i].shape[1])) |
|
1057 | self.ds[i].resize((self.ds[i].shape[0] + 1, self.ds[i].shape[1])) | |
1059 | self.ds[i][-1,:] = self.data[i] |
|
1058 | self.ds[i][-1,:] = self.data[i] | |
1060 | # Two dimension |
|
1059 | # Two dimension | |
1061 | elif nDim == 2: |
|
1060 | elif nDim == 2: | |
1062 | self.ds[i].resize((self.ds[i].shape[0] + 1,self.ds[i].shape[1])) |
|
1061 | self.ds[i].resize((self.ds[i].shape[0] + 1,self.ds[i].shape[1])) | |
1063 | self.ds[i][self.blockIndex,:] = self.data[i] |
|
1062 | self.ds[i][self.blockIndex,:] = self.data[i] | |
1064 | # Three dimensions |
|
1063 | # Three dimensions | |
1065 | elif nDim == 3: |
|
1064 | elif nDim == 3: | |
1066 | self.ds[i].resize((self.ds[i].shape[0],self.ds[i].shape[1],self.ds[i].shape[2]+1)) |
|
1065 | self.ds[i].resize((self.ds[i].shape[0],self.ds[i].shape[1],self.ds[i].shape[2]+1)) | |
1067 | self.ds[i][:,:,-1] = self.data[i] |
|
1066 | self.ds[i][:,:,-1] = self.data[i] | |
1068 |
|
1067 | |||
1069 | self.firsttime = False |
|
1068 | self.firsttime = False | |
1070 | self.blockIndex += 1 |
|
1069 | self.blockIndex += 1 | |
1071 |
|
1070 | |||
1072 | #Close to save changes |
|
1071 | #Close to save changes | |
1073 | self.fp.flush() |
|
1072 | self.fp.flush() | |
1074 | self.fp.close() |
|
1073 | self.fp.close() | |
1075 | return |
|
1074 | return | |
1076 |
|
1075 | |||
1077 | def run(self, dataOut, **kwargs): |
|
1076 | def run(self, dataOut, path=None, blocksPerFile=10, metadataList=None, dataList=None, mode=None, **kwargs): | |
1078 |
|
1077 | |||
1079 | if not(self.isConfig): |
|
1078 | if not(self.isConfig): | |
1080 |
flagdata = self.setup(dataOut, |
|
1079 | flagdata = self.setup(dataOut, path=path, blocksPerFile=blocksPerFile, | |
|
1080 | metadataList=metadataList, dataList=dataList, mode=mode, **kwargs) | |||
1081 |
|
1081 | |||
1082 | if not(flagdata): |
|
1082 | if not(flagdata): | |
1083 | return |
|
1083 | return | |
1084 |
|
1084 | |||
1085 | self.isConfig = True |
|
1085 | self.isConfig = True | |
1086 | # self.putMetadata() |
|
1086 | # self.putMetadata() | |
1087 | self.setNextFile() |
|
1087 | self.setNextFile() | |
1088 |
|
1088 | |||
1089 | self.putData() |
|
1089 | self.putData() | |
1090 | return |
|
1090 | return |
@@ -1,1172 +1,1177 | |||||
1 |
|
1 | |||
2 | global_type_string = 'string' |
|
2 | global_type_string = 'string' | |
3 | global_type_integer = 'int' |
|
3 | global_type_integer = 'int' | |
4 | global_type_floatList = 'floatList' |
|
4 | global_type_floatList = 'floatList' | |
5 | global_type_pairsList = 'pairsList' |
|
5 | global_type_pairsList = 'pairsList' | |
6 | global_type_boolean = 'bolean' |
|
6 | global_type_boolean = 'bolean' | |
7 | global_type_float = 'float' |
|
7 | global_type_float = 'float' | |
8 | global_type_colormap = 'colormap' |
|
8 | global_type_colormap = 'colormap' | |
9 | global_type_list = 'list' |
|
9 | global_type_list = 'list' | |
|
10 | global_type_integer_or_list = 'integer_or_list' | |||
10 |
|
11 | |||
11 | #BeaconPhase |
|
12 | #BeaconPhase | |
12 | parameters = { |
|
13 | parameters = { | |
13 | 'id': global_type_string, |
|
14 | 'id': global_type_string, | |
14 | 'wintitle': global_type_string, |
|
15 | 'wintitle': global_type_string, | |
15 | 'pairsList': global_type_pairsList, |
|
16 | 'pairsList': global_type_pairsList, | |
16 | 'showprofile': global_type_boolean, |
|
17 | 'showprofile': global_type_boolean, | |
17 | 'xmin': global_type_float, |
|
18 | 'xmin': global_type_float, | |
18 | 'xmax': global_type_float, |
|
19 | 'xmax': global_type_float, | |
19 | 'ymin': global_type_float, |
|
20 | 'ymin': global_type_float, | |
20 | 'ymax': global_type_float, |
|
21 | 'ymax': global_type_float, | |
21 | 'hmin': global_type_float, |
|
22 | 'hmin': global_type_float, | |
22 | 'hmax': global_type_float, |
|
23 | 'hmax': global_type_float, | |
23 | 'timerange': global_type_float, |
|
24 | 'timerange': global_type_float, | |
24 | 'save': global_type_boolean, |
|
25 | 'save': global_type_boolean, | |
25 | 'figpath': global_type_string, |
|
26 | 'figpath': global_type_string, | |
26 | 'figfile': global_type_string, |
|
27 | 'figfile': global_type_string, | |
27 | 'show': global_type_boolean, |
|
28 | 'show': global_type_boolean, | |
28 | 'ftp': global_type_boolean, |
|
29 | 'ftp': global_type_boolean, | |
29 | 'wr_period': global_type_integer, |
|
30 | 'wr_period': global_type_integer, | |
30 | 'server': global_type_string, |
|
31 | 'server': global_type_string, | |
31 | 'folder': global_type_string, |
|
32 | 'folder': global_type_string, | |
32 | 'username': global_type_string, |
|
33 | 'username': global_type_string, | |
33 | 'password': global_type_string, |
|
34 | 'password': global_type_string, | |
34 | 'ftp_wei': global_type_integer, |
|
35 | 'ftp_wei': global_type_integer, | |
35 | 'exp_code': global_type_integer, |
|
36 | 'exp_code': global_type_integer, | |
36 | 'sub_exp_code': global_type_integer, |
|
37 | 'sub_exp_code': global_type_integer, | |
37 | 'plot_pos': global_type_integer, |
|
38 | 'plot_pos': global_type_integer, | |
38 | } |
|
39 | } | |
39 |
|
40 | |||
40 |
|
41 | |||
41 | #BeamSelector |
|
42 | #BeamSelector | |
42 | parameters = { |
|
43 | parameters = { | |
43 | 'beam': global_type_string, |
|
44 | 'beam': global_type_string, | |
44 | } |
|
45 | } | |
45 |
|
46 | |||
46 |
|
47 | |||
47 | #CohInt |
|
48 | #CohInt | |
48 | parameters = { |
|
49 | parameters = { | |
49 | 'n': global_type_integer, |
|
50 | 'n': global_type_integer, | |
50 | 'timeInterval': global_type_float, |
|
51 | 'timeInterval': global_type_float, | |
51 | 'overlapping': global_type_boolean, |
|
52 | 'overlapping': global_type_boolean, | |
52 | 'byblock': global_type_boolean |
|
53 | 'byblock': global_type_boolean | |
53 | } |
|
54 | } | |
54 |
|
55 | |||
55 |
|
56 | |||
56 | #CoherenceMap |
|
57 | #CoherenceMap | |
57 | parameters = { |
|
58 | parameters = { | |
58 | 'id': global_type_string, |
|
59 | 'id': global_type_string, | |
59 | 'wintitle': global_type_string, |
|
60 | 'wintitle': global_type_string, | |
60 | 'pairsList': global_type_pairsList, |
|
61 | 'pairsList': global_type_pairsList, | |
61 | 'showprofile': global_type_boolean, |
|
62 | 'showprofile': global_type_boolean, | |
62 | 'xmin': global_type_float, |
|
63 | 'xmin': global_type_float, | |
63 | 'xmax': global_type_float, |
|
64 | 'xmax': global_type_float, | |
64 | 'ymin': global_type_float, |
|
65 | 'ymin': global_type_float, | |
65 | 'ymax': global_type_float, |
|
66 | 'ymax': global_type_float, | |
66 | 'zmin': global_type_float, |
|
67 | 'zmin': global_type_float, | |
67 | 'zmax': global_type_float, |
|
68 | 'zmax': global_type_float, | |
68 | 'timerange': global_type_float, |
|
69 | 'timerange': global_type_float, | |
69 | 'phase_min': global_type_float, |
|
70 | 'phase_min': global_type_float, | |
70 | 'phase_max': global_type_float, |
|
71 | 'phase_max': global_type_float, | |
71 | 'save': global_type_boolean, |
|
72 | 'save': global_type_boolean, | |
72 | 'figpath': global_type_string, |
|
73 | 'figpath': global_type_string, | |
73 | 'figfile': global_type_string, |
|
74 | 'figfile': global_type_string, | |
74 | 'ftp': global_type_boolean, |
|
75 | 'ftp': global_type_boolean, | |
75 | 'wr_period': global_type_integer, |
|
76 | 'wr_period': global_type_integer, | |
76 | 'coherence_cmap': global_type_colormap, |
|
77 | 'coherence_cmap': global_type_colormap, | |
77 | 'phase_cmap': global_type_colormap, |
|
78 | 'phase_cmap': global_type_colormap, | |
78 | 'show': global_type_boolean, |
|
79 | 'show': global_type_boolean, | |
79 | 'server': global_type_string, |
|
80 | 'server': global_type_string, | |
80 | 'folder': global_type_string, |
|
81 | 'folder': global_type_string, | |
81 | 'username': global_type_string, |
|
82 | 'username': global_type_string, | |
82 | 'password': global_type_string, |
|
83 | 'password': global_type_string, | |
83 | 'ftp_wei': global_type_integer, |
|
84 | 'ftp_wei': global_type_integer, | |
84 | 'exp_code': global_type_integer, |
|
85 | 'exp_code': global_type_integer, | |
85 | 'sub_exp_code': global_type_integer, |
|
86 | 'sub_exp_code': global_type_integer, | |
86 | 'plot_pos': global_type_integer, |
|
87 | 'plot_pos': global_type_integer, | |
87 | } |
|
88 | } | |
88 |
|
89 | |||
89 |
|
90 | |||
90 | #CombineProfiles |
|
91 | #CombineProfiles | |
91 | parameters = { |
|
92 | parameters = { | |
92 | 'n': global_type_integer, |
|
93 | 'n': global_type_integer, | |
93 | } |
|
94 | } | |
94 |
|
95 | |||
95 |
|
96 | |||
96 | #CorrectSMPhases |
|
97 | #CorrectSMPhases | |
97 | parameters = { |
|
98 | parameters = { | |
98 | 'phaseOffsets': global_type_pairsList, |
|
99 | 'phaseOffsets': global_type_pairsList, | |
99 | 'hmin': global_type_float, |
|
100 | 'hmin': global_type_float, | |
100 | 'hmax': global_type_float, |
|
101 | 'hmax': global_type_float, | |
101 | 'azimuth': global_type_float, |
|
102 | 'azimuth': global_type_float, | |
102 | 'channelPositions': global_type_pairsList, |
|
103 | 'channelPositions': global_type_pairsList, | |
103 | } |
|
104 | } | |
104 |
|
105 | |||
105 |
|
106 | |||
106 | #CorrelationPlot |
|
107 | #CorrelationPlot | |
107 | parameters = { |
|
108 | parameters = { | |
108 | 'id': global_type_string, |
|
109 | 'id': global_type_string, | |
109 | 'wintitle': global_type_string, |
|
110 | 'wintitle': global_type_string, | |
110 | 'channelList': global_type_list, |
|
111 | 'channelList': global_type_list, | |
111 | 'showprofile': global_type_boolean, |
|
112 | 'showprofile': global_type_boolean, | |
112 | 'xmin': global_type_float, |
|
113 | 'xmin': global_type_float, | |
113 | 'xmax': global_type_float, |
|
114 | 'xmax': global_type_float, | |
114 | 'ymin': global_type_float, |
|
115 | 'ymin': global_type_float, | |
115 | 'ymax': global_type_float, |
|
116 | 'ymax': global_type_float, | |
116 | 'zmin': global_type_float, |
|
117 | 'zmin': global_type_float, | |
117 | 'zmax': global_type_float, |
|
118 | 'zmax': global_type_float, | |
118 | 'save': global_type_boolean, |
|
119 | 'save': global_type_boolean, | |
119 | 'figpath': global_type_string, |
|
120 | 'figpath': global_type_string, | |
120 | 'figfile': global_type_string, |
|
121 | 'figfile': global_type_string, | |
121 | 'show': global_type_boolean, |
|
122 | 'show': global_type_boolean, | |
122 | 'ftp': global_type_boolean, |
|
123 | 'ftp': global_type_boolean, | |
123 | 'wr_period': global_type_integer, |
|
124 | 'wr_period': global_type_integer, | |
124 | 'server': global_type_string, |
|
125 | 'server': global_type_string, | |
125 | 'folder': global_type_string, |
|
126 | 'folder': global_type_string, | |
126 | 'username': global_type_string, |
|
127 | 'username': global_type_string, | |
127 | 'password': global_type_string, |
|
128 | 'password': global_type_string, | |
128 | 'ftp_wei': global_type_integer, |
|
129 | 'ftp_wei': global_type_integer, | |
129 | 'exp_code': global_type_integer, |
|
130 | 'exp_code': global_type_integer, | |
130 | 'sub_exp_code': global_type_integer, |
|
131 | 'sub_exp_code': global_type_integer, | |
131 | 'plot_pos': global_type_integer, |
|
132 | 'plot_pos': global_type_integer, | |
132 | 'realtime': global_type_boolean, |
|
133 | 'realtime': global_type_boolean, | |
133 | } |
|
134 | } | |
134 |
|
135 | |||
135 |
|
136 | |||
136 | #CrossSpectraPlot |
|
137 | #CrossSpectraPlot | |
137 | parameters = { |
|
138 | parameters = { | |
138 | 'id': global_type_string, |
|
139 | 'id': global_type_string, | |
139 | 'wintitle': global_type_string, |
|
140 | 'wintitle': global_type_string, | |
140 | 'pairsList': global_type_pairsList, |
|
141 | 'pairsList': global_type_pairsList, | |
141 | 'xmin': global_type_float, |
|
142 | 'xmin': global_type_float, | |
142 | 'xmax': global_type_float, |
|
143 | 'xmax': global_type_float, | |
143 | 'ymin': global_type_float, |
|
144 | 'ymin': global_type_float, | |
144 | 'ymax': global_type_float, |
|
145 | 'ymax': global_type_float, | |
145 | 'zmin': global_type_float, |
|
146 | 'zmin': global_type_float, | |
146 | 'zmax': global_type_float, |
|
147 | 'zmax': global_type_float, | |
147 | 'coh_min': global_type_float, |
|
148 | 'coh_min': global_type_float, | |
148 | 'coh_max': global_type_float, |
|
149 | 'coh_max': global_type_float, | |
149 | 'phase_min': global_type_float, |
|
150 | 'phase_min': global_type_float, | |
150 | 'phase_max': global_type_float, |
|
151 | 'phase_max': global_type_float, | |
151 | 'save': global_type_boolean, |
|
152 | 'save': global_type_boolean, | |
152 | 'figpath': global_type_string, |
|
153 | 'figpath': global_type_string, | |
153 | 'figfile': global_type_string, |
|
154 | 'figfile': global_type_string, | |
154 | 'ftp': global_type_boolean, |
|
155 | 'ftp': global_type_boolean, | |
155 | 'wr_period': global_type_integer, |
|
156 | 'wr_period': global_type_integer, | |
156 | 'power_cmap': global_type_colormap, |
|
157 | 'power_cmap': global_type_colormap, | |
157 | 'coherence_cmap': global_type_colormap, |
|
158 | 'coherence_cmap': global_type_colormap, | |
158 | 'phase_cmap': global_type_colormap, |
|
159 | 'phase_cmap': global_type_colormap, | |
159 | 'show': global_type_boolean, |
|
160 | 'show': global_type_boolean, | |
160 | 'server': global_type_string, |
|
161 | 'server': global_type_string, | |
161 | 'folder': global_type_string, |
|
162 | 'folder': global_type_string, | |
162 | 'username': global_type_string, |
|
163 | 'username': global_type_string, | |
163 | 'password': global_type_string, |
|
164 | 'password': global_type_string, | |
164 | 'ftp_wei': global_type_integer, |
|
165 | 'ftp_wei': global_type_integer, | |
165 | 'exp_code': global_type_integer, |
|
166 | 'exp_code': global_type_integer, | |
166 | 'sub_exp_code': global_type_integer, |
|
167 | 'sub_exp_code': global_type_integer, | |
167 | 'plot_pos': global_type_integer, |
|
168 | 'plot_pos': global_type_integer, | |
168 | 'xaxis': global_type_string, |
|
169 | 'xaxis': global_type_string, | |
169 | } |
|
170 | } | |
170 |
|
171 | |||
171 |
|
172 | |||
172 | #Decoder |
|
173 | #Decoder | |
173 | parameters = { |
|
174 | parameters = { | |
174 | 'code': global_type_list, |
|
175 | 'code': global_type_list, | |
175 | 'nCode': global_type_integer, |
|
176 | 'nCode': global_type_integer, | |
176 | 'nBaud': global_type_integer, |
|
177 | 'nBaud': global_type_integer, | |
177 | 'mode': global_type_integer, |
|
178 | 'mode': global_type_integer, | |
178 | 'osamp': global_type_float, |
|
179 | 'osamp': global_type_float, | |
179 | } |
|
180 | } | |
180 |
|
181 | |||
181 |
|
182 | |||
182 | #EWDriftsEstimation |
|
183 | #EWDriftsEstimation | |
183 | parameters = { |
|
184 | parameters = { | |
184 | 'zenith': global_type_list, |
|
185 | 'zenith': global_type_list, | |
185 | 'zenithCorrection': global_type_float, |
|
186 | 'zenithCorrection': global_type_float, | |
186 | } |
|
187 | } | |
187 |
|
188 | |||
188 |
|
189 | |||
189 | #EWDriftsPlot |
|
190 | #EWDriftsPlot | |
190 | parameters = { |
|
191 | parameters = { | |
191 | 'id': global_type_string, |
|
192 | 'id': global_type_string, | |
192 | 'wintitle': global_type_string, |
|
193 | 'wintitle': global_type_string, | |
193 | 'channelList': global_type_list, |
|
194 | 'channelList': global_type_list, | |
194 | 'xmin': global_type_float, |
|
195 | 'xmin': global_type_float, | |
195 | 'xmax': global_type_float, |
|
196 | 'xmax': global_type_float, | |
196 | 'ymin': global_type_float, |
|
197 | 'ymin': global_type_float, | |
197 | 'ymax': global_type_float, |
|
198 | 'ymax': global_type_float, | |
198 | 'zmin': global_type_float, |
|
199 | 'zmin': global_type_float, | |
199 | 'zmax': global_type_float, |
|
200 | 'zmax': global_type_float, | |
200 | 'zmaxVertfloat': global_type_float, |
|
201 | 'zmaxVertfloat': global_type_float, | |
201 | 'zminVertfloat': global_type_float, |
|
202 | 'zminVertfloat': global_type_float, | |
202 | 'zmaxZonafloat': global_type_float, |
|
203 | 'zmaxZonafloat': global_type_float, | |
203 | 'zminZonafloat': global_type_float, |
|
204 | 'zminZonafloat': global_type_float, | |
204 | 'timerange': global_type_float, |
|
205 | 'timerange': global_type_float, | |
205 | 'SNRthresh': global_type_float, |
|
206 | 'SNRthresh': global_type_float, | |
206 | 'SNRmin': global_type_float, |
|
207 | 'SNRmin': global_type_float, | |
207 | 'SNRmax': global_type_float, |
|
208 | 'SNRmax': global_type_float, | |
208 | 'SNR_1': global_type_boolean, |
|
209 | 'SNR_1': global_type_boolean, | |
209 | 'save': global_type_boolean, |
|
210 | 'save': global_type_boolean, | |
210 | 'figpath': global_type_string, |
|
211 | 'figpath': global_type_string, | |
211 | 'lastone': global_type_float, |
|
212 | 'lastone': global_type_float, | |
212 | 'figfile': global_type_string, |
|
213 | 'figfile': global_type_string, | |
213 | 'ftp': global_type_string, |
|
214 | 'ftp': global_type_string, | |
214 | 'wr_period': global_type_integer, |
|
215 | 'wr_period': global_type_integer, | |
215 | 'show': global_type_string, |
|
216 | 'show': global_type_string, | |
216 | 'server': global_type_string, |
|
217 | 'server': global_type_string, | |
217 | 'folder': global_type_string, |
|
218 | 'folder': global_type_string, | |
218 | 'username': global_type_string, |
|
219 | 'username': global_type_string, | |
219 | 'password': global_type_string, |
|
220 | 'password': global_type_string, | |
220 | 'ftp_wei': global_type_integer, |
|
221 | 'ftp_wei': global_type_integer, | |
221 | 'exp_code': global_type_integer, |
|
222 | 'exp_code': global_type_integer, | |
222 | 'sub_exp_code': global_type_integer, |
|
223 | 'sub_exp_code': global_type_integer, | |
223 | 'plot_pos': global_type_integer, |
|
224 | 'plot_pos': global_type_integer, | |
224 | } |
|
225 | } | |
225 |
|
226 | |||
226 |
|
227 | |||
227 | Figure |
|
228 | Figure | |
228 | # parameters = { |
|
229 | # parameters = { | |
229 | # : global_type_string, |
|
230 | # : global_type_string, | |
230 | # } |
|
231 | # } | |
231 |
|
232 | |||
232 |
|
233 | |||
233 | #FitsWriter |
|
234 | #FitsWriter | |
234 | parameters = { |
|
235 | parameters = { | |
235 | 'path': global_type_string, |
|
236 | 'path': global_type_string, | |
236 | 'dataBlocksPerFile': global_type_integer, |
|
237 | 'dataBlocksPerFile': global_type_integer, | |
237 | 'metadatafile': global_type_string, |
|
238 | 'metadatafile': global_type_string, | |
238 | } |
|
239 | } | |
239 |
|
240 | |||
240 |
|
241 | |||
241 | #IncohInt |
|
242 | #IncohInt | |
242 | parameters = { |
|
243 | parameters = { | |
243 | 'n': global_type_float, |
|
244 | 'n': global_type_float, | |
244 | 'timeInterval': global_type_integer, |
|
245 | 'timeInterval': global_type_integer, | |
245 | 'overlapping': global_type_boolean, |
|
246 | 'overlapping': global_type_boolean, | |
246 | } |
|
247 | } | |
247 |
|
248 | |||
248 |
|
249 | |||
249 | #IncohInt4SpectraHeis |
|
250 | #IncohInt4SpectraHeis | |
250 | parameters = { |
|
251 | parameters = { | |
251 | 'n': global_type_float, |
|
252 | 'n': global_type_float, | |
252 | 'timeInterval': global_type_integer, |
|
253 | 'timeInterval': global_type_integer, | |
253 | 'overlapping': global_type_boolean, |
|
254 | 'overlapping': global_type_boolean, | |
254 | } |
|
255 | } | |
255 |
|
256 | |||
256 |
|
257 | |||
257 | #MomentsPlot |
|
258 | #MomentsPlot | |
258 | parameters = { |
|
259 | parameters = { | |
259 | 'id': global_type_string, |
|
260 | 'id': global_type_string, | |
260 | 'wintitle': global_type_string, |
|
261 | 'wintitle': global_type_string, | |
261 | 'channelList': global_type_list, |
|
262 | 'channelList': global_type_list, | |
262 | 'showprofile': global_type_boolean, |
|
263 | 'showprofile': global_type_boolean, | |
263 | 'xmin': global_type_float, |
|
264 | 'xmin': global_type_float, | |
264 | 'xmax': global_type_float, |
|
265 | 'xmax': global_type_float, | |
265 | 'ymin': global_type_float, |
|
266 | 'ymin': global_type_float, | |
266 | 'ymax': global_type_float, |
|
267 | 'ymax': global_type_float, | |
267 | 'zmin': global_type_float, |
|
268 | 'zmin': global_type_float, | |
268 | 'zmax': global_type_float, |
|
269 | 'zmax': global_type_float, | |
269 | 'save': global_type_boolean, |
|
270 | 'save': global_type_boolean, | |
270 | 'figpath': global_type_string, |
|
271 | 'figpath': global_type_string, | |
271 | 'figfile': global_type_string, |
|
272 | 'figfile': global_type_string, | |
272 | 'show': global_type_boolean, |
|
273 | 'show': global_type_boolean, | |
273 | 'ftp': global_type_boolean, |
|
274 | 'ftp': global_type_boolean, | |
274 | 'wr_period': global_type_integer, |
|
275 | 'wr_period': global_type_integer, | |
275 | 'server': global_type_string, |
|
276 | 'server': global_type_string, | |
276 | 'folder': global_type_string, |
|
277 | 'folder': global_type_string, | |
277 | 'username': global_type_string, |
|
278 | 'username': global_type_string, | |
278 | 'password': global_type_string, |
|
279 | 'password': global_type_string, | |
279 | 'ftp_wei': global_type_string, |
|
280 | 'ftp_wei': global_type_string, | |
280 | 'exp_code': global_type_integer, |
|
281 | 'exp_code': global_type_integer, | |
281 | 'sub_exp_code': global_type_integer, |
|
282 | 'sub_exp_code': global_type_integer, | |
282 | 'plot_pos': global_type_integer, |
|
283 | 'plot_pos': global_type_integer, | |
283 | 'realtime': global_type_boolean, |
|
284 | 'realtime': global_type_boolean, | |
284 | } |
|
285 | } | |
285 |
|
286 | |||
286 |
|
287 | |||
287 | #NSMeteorDetection1Plot |
|
288 | #NSMeteorDetection1Plot | |
288 | parameters = { |
|
289 | parameters = { | |
289 | 'id': global_type_string, |
|
290 | 'id': global_type_string, | |
290 | 'wintitle': global_type_string, |
|
291 | 'wintitle': global_type_string, | |
291 | 'channelList': global_type_list, |
|
292 | 'channelList': global_type_list, | |
292 | 'showprofile': global_type_boolean, |
|
293 | 'showprofile': global_type_boolean, | |
293 | 'xmin': global_type_float, |
|
294 | 'xmin': global_type_float, | |
294 | 'xmax': global_type_float, |
|
295 | 'xmax': global_type_float, | |
295 | 'ymin': global_type_float, |
|
296 | 'ymin': global_type_float, | |
296 | 'ymax': global_type_float, |
|
297 | 'ymax': global_type_float, | |
297 | 'SNRmin': global_type_float, |
|
298 | 'SNRmin': global_type_float, | |
298 | 'SNRmax': global_type_float, |
|
299 | 'SNRmax': global_type_float, | |
299 | 'vmin': global_type_float, |
|
300 | 'vmin': global_type_float, | |
300 | 'vmax': global_type_float, |
|
301 | 'vmax': global_type_float, | |
301 | 'wmin': global_type_float, |
|
302 | 'wmin': global_type_float, | |
302 | 'wmax': global_type_float, |
|
303 | 'wmax': global_type_float, | |
303 | 'mode': global_type_string, |
|
304 | 'mode': global_type_string, | |
304 | 'save': global_type_boolean, |
|
305 | 'save': global_type_boolean, | |
305 | 'figpath': global_type_string, |
|
306 | 'figpath': global_type_string, | |
306 | 'figfile': global_type_string, |
|
307 | 'figfile': global_type_string, | |
307 | 'show': global_type_boolean, |
|
308 | 'show': global_type_boolean, | |
308 | 'ftp': global_type_string, |
|
309 | 'ftp': global_type_string, | |
309 | 'wr_period': global_type_integer, |
|
310 | 'wr_period': global_type_integer, | |
310 | 'server': global_type_string, |
|
311 | 'server': global_type_string, | |
311 | 'folder': global_type_string, |
|
312 | 'folder': global_type_string, | |
312 | 'username': global_type_string, |
|
313 | 'username': global_type_string, | |
313 | 'password': global_type_string, |
|
314 | 'password': global_type_string, | |
314 | 'ftp_wei': global_type_integer, |
|
315 | 'ftp_wei': global_type_integer, | |
315 | 'exp_code': global_type_integer, |
|
316 | 'exp_code': global_type_integer, | |
316 | 'sub_exp_code': global_type_integer, |
|
317 | 'sub_exp_code': global_type_integer, | |
317 | 'plot_pos': global_type_integer, |
|
318 | 'plot_pos': global_type_integer, | |
318 | 'realtime': global_type_boolean, |
|
319 | 'realtime': global_type_boolean, | |
319 | 'xaxis': global_type_string, |
|
320 | 'xaxis': global_type_string, | |
320 | } |
|
321 | } | |
321 |
|
322 | |||
322 |
|
323 | |||
323 | #NSMeteorDetection2Plot |
|
324 | #NSMeteorDetection2Plot | |
324 | parameters = { |
|
325 | parameters = { | |
325 | 'id': global_type_string, |
|
326 | 'id': global_type_string, | |
326 | 'wintitle': global_type_string, |
|
327 | 'wintitle': global_type_string, | |
327 | 'channelList': global_type_list, |
|
328 | 'channelList': global_type_list, | |
328 | 'showprofile': global_type_boolean, |
|
329 | 'showprofile': global_type_boolean, | |
329 | 'xmin': global_type_float, |
|
330 | 'xmin': global_type_float, | |
330 | 'xmax': global_type_float, |
|
331 | 'xmax': global_type_float, | |
331 | 'ymin': global_type_float, |
|
332 | 'ymin': global_type_float, | |
332 | 'ymax': global_type_float, |
|
333 | 'ymax': global_type_float, | |
333 | 'SNRmin': global_type_float, |
|
334 | 'SNRmin': global_type_float, | |
334 | 'SNRmax': global_type_float, |
|
335 | 'SNRmax': global_type_float, | |
335 | 'vmin': global_type_float, |
|
336 | 'vmin': global_type_float, | |
336 | 'vmax': global_type_float, |
|
337 | 'vmax': global_type_float, | |
337 | 'wmin': global_type_float, |
|
338 | 'wmin': global_type_float, | |
338 | 'wmax': global_type_float, |
|
339 | 'wmax': global_type_float, | |
339 | 'mode': global_type_string, |
|
340 | 'mode': global_type_string, | |
340 | 'save': global_type_boolean, |
|
341 | 'save': global_type_boolean, | |
341 | 'figpath': global_type_string, |
|
342 | 'figpath': global_type_string, | |
342 | 'figfile': global_type_string, |
|
343 | 'figfile': global_type_string, | |
343 | 'show': global_type_string, |
|
344 | 'show': global_type_string, | |
344 | 'ftp': global_type_boolean, |
|
345 | 'ftp': global_type_boolean, | |
345 | 'wr_period': global_type_integer, |
|
346 | 'wr_period': global_type_integer, | |
346 | 'server': global_type_string, |
|
347 | 'server': global_type_string, | |
347 | 'folder': global_type_string, |
|
348 | 'folder': global_type_string, | |
348 | 'username': global_type_string, |
|
349 | 'username': global_type_string, | |
349 | 'password': global_type_string, |
|
350 | 'password': global_type_string, | |
350 | 'ftp_wei': global_type_integer, |
|
351 | 'ftp_wei': global_type_integer, | |
351 | 'exp_code': global_type_integer, |
|
352 | 'exp_code': global_type_integer, | |
352 | 'sub_exp_code': global_type_integer, |
|
353 | 'sub_exp_code': global_type_integer, | |
353 | 'plot_pos': global_type_integer, |
|
354 | 'plot_pos': global_type_integer, | |
354 | 'realtime': global_type_boolean, |
|
355 | 'realtime': global_type_boolean, | |
355 | 'xaxis': global_type_string, |
|
356 | 'xaxis': global_type_string, | |
356 | } |
|
357 | } | |
357 |
|
358 | |||
358 |
|
359 | |||
359 | #Noise |
|
360 | #Noise | |
360 | parameters = { |
|
361 | parameters = { | |
361 | 'id': global_type_string, |
|
362 | 'id': global_type_string, | |
362 | 'wintitle': global_type_string, |
|
363 | 'wintitle': global_type_string, | |
363 | 'channelList': global_type_list, |
|
364 | 'channelList': global_type_list, | |
364 | 'showprofile': global_type_boolean, |
|
365 | 'showprofile': global_type_boolean, | |
365 | 'xmin': global_type_float, |
|
366 | 'xmin': global_type_float, | |
366 | 'xmax': global_type_float, |
|
367 | 'xmax': global_type_float, | |
367 | 'ymin': global_type_float, |
|
368 | 'ymin': global_type_float, | |
368 | 'ymax': global_type_float, |
|
369 | 'ymax': global_type_float, | |
369 | 'timerange': global_type_float, |
|
370 | 'timerange': global_type_float, | |
370 | 'save': global_type_boolean, |
|
371 | 'save': global_type_boolean, | |
371 | 'figpath': global_type_string, |
|
372 | 'figpath': global_type_string, | |
372 | 'figfile': global_type_string, |
|
373 | 'figfile': global_type_string, | |
373 | 'show': global_type_boolean, |
|
374 | 'show': global_type_boolean, | |
374 | 'ftp': global_type_boolean, |
|
375 | 'ftp': global_type_boolean, | |
375 | 'wr_period': global_type_integer, |
|
376 | 'wr_period': global_type_integer, | |
376 | 'server': global_type_string, |
|
377 | 'server': global_type_string, | |
377 | 'folder': global_type_string, |
|
378 | 'folder': global_type_string, | |
378 | 'username': global_type_string, |
|
379 | 'username': global_type_string, | |
379 | 'password': global_type_string, |
|
380 | 'password': global_type_string, | |
380 | 'ftp_wei': global_type_integer, |
|
381 | 'ftp_wei': global_type_integer, | |
381 | 'exp_code': global_type_integer, |
|
382 | 'exp_code': global_type_integer, | |
382 | 'sub_exp_code': global_type_integer, |
|
383 | 'sub_exp_code': global_type_integer, | |
383 | 'plot_pos': global_type_integer, |
|
384 | 'plot_pos': global_type_integer, | |
384 | } |
|
385 | } | |
385 |
|
386 | |||
386 |
|
387 | |||
387 | #NonSpecularMeteorDetection |
|
388 | #NonSpecularMeteorDetection | |
388 | parameters = { |
|
389 | parameters = { | |
389 | 'mode': global_type_string, |
|
390 | 'mode': global_type_string, | |
390 | 'SNRthresh': global_type_float, |
|
391 | 'SNRthresh': global_type_float, | |
391 | 'phaseDerThresh': global_type_float, |
|
392 | 'phaseDerThresh': global_type_float, | |
392 | 'cohThresh': global_type_float, |
|
393 | 'cohThresh': global_type_float, | |
393 | 'allData': global_type_boolean, |
|
394 | 'allData': global_type_boolean, | |
394 | } |
|
395 | } | |
395 |
|
396 | |||
396 |
|
397 | |||
397 | Operation |
|
398 | Operation | |
398 | parameters = { |
|
399 | parameters = { | |
399 | 'dataIn': global_type_string, |
|
400 | 'dataIn': global_type_string, | |
400 | } |
|
401 | } | |
401 |
|
402 | |||
402 |
|
403 | |||
403 | ParamWriter |
|
404 | #ParamWriter | |
404 | parameters = { |
|
405 | parameters = { | |
405 | : global_type_string, |
|
406 | 'path': global_type_string, | |
406 | } |
|
407 | 'blocksPerFile':global_type_integer, | |
|
408 | 'metadataList': global_type_list, | |||
|
409 | 'dataList': global_type_list, | |||
|
410 | 'mode': global_type_integer, | |||
|
411 | } | |||
407 |
|
412 | |||
408 |
|
413 | |||
409 | Parameters1Plot |
|
414 | #Parameters1Plot | |
410 | parameters = { |
|
415 | parameters = { | |
411 | 'id': global_type_string, |
|
416 | 'id': global_type_string, | |
412 | 'wintitle': global_type_string, |
|
417 | 'wintitle': global_type_string, | |
413 | 'channelList': global_type_list, |
|
418 | 'channelList': global_type_list, | |
414 | 'showprofile': global_type_boolean, |
|
419 | 'showprofile': global_type_boolean, | |
415 | 'xmin': global_type_float, |
|
420 | 'xmin': global_type_float, | |
416 | 'xmax': global_type_float, |
|
421 | 'xmax': global_type_float, | |
417 | 'ymin': global_type_float, |
|
422 | 'ymin': global_type_float, | |
418 | 'ymax': global_type_float, |
|
423 | 'ymax': global_type_float, | |
419 | 'zmin': global_type_float, |
|
424 | 'zmin': global_type_float, | |
420 | 'zmax': global_type_float, |
|
425 | 'zmax': global_type_float, | |
421 | 'timerange': global_type_float, |
|
426 | 'timerange': global_type_float, | |
422 |
'parameterIndex': global_type_ |
|
427 | 'parameterIndex': global_type_float, | |
423 |
'onlyPositive': global_type_ |
|
428 | 'onlyPositive': global_type_boolean, | |
424 |
'SNRthresh': global_type_ |
|
429 | 'SNRthresh': global_type_float, | |
425 |
'SNR': global_type_ |
|
430 | 'SNR': global_type_boolean, | |
426 | 'SNRmin': global_type_float, |
|
431 | 'SNRmin': global_type_float, | |
427 | 'SNRmax': global_type_float, |
|
432 | 'SNRmax': global_type_float, | |
428 |
'onlySNR': global_type_ |
|
433 | 'onlySNR': global_type_boolean, | |
429 |
'DOP': global_type_ |
|
434 | 'DOP': global_type_boolean, | |
430 | 'zlabel': global_type_string, |
|
435 | 'zlabel': global_type_string, | |
431 | 'parameterName': global_type_string, |
|
436 | 'parameterName': global_type_string, | |
432 | 'parameterObject': global_type_string, |
|
437 | 'parameterObject': global_type_string, | |
433 | 'save': global_type_boolean, |
|
438 | 'save': global_type_boolean, | |
434 | 'figpath': global_type_string, |
|
439 | 'figpath': global_type_string, | |
435 |
'lastone': global_type_ |
|
440 | 'lastone': global_type_integer, | |
436 | 'figfile': global_type_string, |
|
441 | 'figfile': global_type_string, | |
437 |
'ftp': global_type_ |
|
442 | 'ftp': global_type_boolean, | |
438 | 'wr_period': global_type_integer, |
|
443 | 'wr_period': global_type_integer, | |
439 | 'show': global_type_string, |
|
444 | 'show': global_type_string, | |
440 | 'server': global_type_string, |
|
445 | 'server': global_type_string, | |
441 | 'folder': global_type_string, |
|
446 | 'folder': global_type_string, | |
442 | 'username': global_type_string, |
|
447 | 'username': global_type_string, | |
443 | 'password': global_type_string, |
|
448 | 'password': global_type_string, | |
444 | 'ftp_wei': global_type_integer, |
|
449 | 'ftp_wei': global_type_integer, | |
445 | 'exp_code': global_type_integer, |
|
450 | 'exp_code': global_type_integer, | |
446 | 'sub_exp_code': global_type_integer, |
|
451 | 'sub_exp_code': global_type_integer, | |
447 | 'plot_pos': global_type_integer, |
|
452 | 'plot_pos': global_type_integer, | |
448 | } |
|
453 | } | |
449 |
|
454 | |||
450 |
|
455 | |||
451 | ParametersPlot |
|
456 | #ParametersPlot | |
452 | parameters = { |
|
457 | parameters = { | |
453 | 'id': global_type_string, |
|
458 | 'id': global_type_string, | |
454 | 'wintitle': global_type_string, |
|
459 | 'wintitle': global_type_string, | |
455 | 'channelList': global_type_list, |
|
460 | 'channelList': global_type_list, | |
456 |
'paramIndex': global_type_ |
|
461 | 'paramIndex': global_type_integer, | |
457 |
'colormap': global_type_ |
|
462 | 'colormap': global_type_colormap, | |
458 | 'xmin': global_type_float, |
|
463 | 'xmin': global_type_float, | |
459 | 'xmax': global_type_float, |
|
464 | 'xmax': global_type_float, | |
460 | 'ymin': global_type_float, |
|
465 | 'ymin': global_type_float, | |
461 | 'ymax': global_type_float, |
|
466 | 'ymax': global_type_float, | |
462 | 'zmin': global_type_float, |
|
467 | 'zmin': global_type_float, | |
463 | 'zmax': global_type_float, |
|
468 | 'zmax': global_type_float, | |
464 | 'timerange': global_type_float, |
|
469 | 'timerange': global_type_float, | |
465 |
'showSNR': global_type_ |
|
470 | 'showSNR': global_type_boolean, | |
466 |
'SNRthresh': global_type_ |
|
471 | 'SNRthresh': global_type_float, | |
467 | 'SNRmin': global_type_float, |
|
472 | 'SNRmin': global_type_float, | |
468 | 'SNRmax': global_type_float, |
|
473 | 'SNRmax': global_type_float, | |
469 | 'save': global_type_boolean, |
|
474 | 'save': global_type_boolean, | |
470 | 'figpath': global_type_string, |
|
475 | 'figpath': global_type_string, | |
471 |
'lastone': global_type_ |
|
476 | 'lastone': global_type_integer, | |
472 | 'figfile': global_type_string, |
|
477 | 'figfile': global_type_string, | |
473 |
'ftp': global_type_ |
|
478 | 'ftp': global_type_boolean, | |
474 | 'wr_period': global_type_integer, |
|
479 | 'wr_period': global_type_integer, | |
475 |
'show': global_type_ |
|
480 | 'show': global_type_boolean, | |
476 | 'server': global_type_string, |
|
481 | 'server': global_type_string, | |
477 | 'folder': global_type_string, |
|
482 | 'folder': global_type_string, | |
478 | 'username': global_type_string, |
|
483 | 'username': global_type_string, | |
479 | 'password': global_type_string, |
|
484 | 'password': global_type_string, | |
480 | 'ftp_wei': global_type_integer, |
|
485 | 'ftp_wei': global_type_integer, | |
481 | 'exp_code': global_type_integer, |
|
486 | 'exp_code': global_type_integer, | |
482 | 'sub_exp_code': global_type_integer, |
|
487 | 'sub_exp_code': global_type_integer, | |
483 | 'plot_pos': global_type_integer, |
|
488 | 'plot_pos': global_type_integer, | |
484 | } |
|
489 | } | |
485 |
|
490 | |||
486 |
|
491 | |||
487 | PhasePlot |
|
492 | #PhasePlot | |
488 | parameters = { |
|
493 | parameters = { | |
489 | 'id': global_type_string, |
|
494 | 'id': global_type_string, | |
490 | 'wintitle': global_type_string, |
|
495 | 'wintitle': global_type_string, | |
491 |
'pairsList': |
|
496 | 'pairsList': global_type_pairsList, | |
492 | 'showprofile': global_type_boolean, |
|
497 | 'showprofile': global_type_boolean, | |
493 | 'xmin': global_type_float, |
|
498 | 'xmin': global_type_float, | |
494 | 'xmax': global_type_float, |
|
499 | 'xmax': global_type_float, | |
495 | 'ymin': global_type_float, |
|
500 | 'ymin': global_type_float, | |
496 | 'ymax': global_type_float, |
|
501 | 'ymax': global_type_float, | |
497 | 'timerange': global_type_float, |
|
502 | 'timerange': global_type_float, | |
498 | 'save': global_type_boolean, |
|
503 | 'save': global_type_boolean, | |
499 | 'figpath': global_type_string, |
|
504 | 'figpath': global_type_string, | |
500 | 'figfile': global_type_string, |
|
505 | 'figfile': global_type_string, | |
501 |
'show': global_type_ |
|
506 | 'show': global_type_boolean, | |
502 |
'ftp': global_type_ |
|
507 | 'ftp': global_type_boolean, | |
503 | 'wr_period': global_type_integer, |
|
508 | 'wr_period': global_type_integer, | |
504 | 'server': global_type_string, |
|
509 | 'server': global_type_string, | |
505 | 'folder': global_type_string, |
|
510 | 'folder': global_type_string, | |
506 | 'username': global_type_string, |
|
511 | 'username': global_type_string, | |
507 | 'password': global_type_string, |
|
512 | 'password': global_type_string, | |
508 | 'ftp_wei': global_type_integer, |
|
513 | 'ftp_wei': global_type_integer, | |
509 | 'exp_code': global_type_integer, |
|
514 | 'exp_code': global_type_integer, | |
510 | 'sub_exp_code': global_type_integer, |
|
515 | 'sub_exp_code': global_type_integer, | |
511 | 'plot_pos': global_type_integer, |
|
516 | 'plot_pos': global_type_integer, | |
512 | } |
|
517 | } | |
513 |
|
518 | |||
514 |
|
519 | |||
515 | PlotCOHData |
|
520 | PlotCOHData | |
516 | parameters = { |
|
521 | parameters = { | |
517 | : global_type_string, |
|
522 | : global_type_string, | |
518 | } |
|
523 | } | |
519 |
|
524 | |||
520 |
|
525 | |||
521 | PlotCrossSpectraData |
|
526 | PlotCrossSpectraData | |
522 | parameters = { |
|
527 | parameters = { | |
523 | : global_type_string, |
|
528 | : global_type_string, | |
524 | } |
|
529 | } | |
525 |
|
530 | |||
526 |
|
531 | |||
527 | PlotDOPData |
|
532 | PlotDOPData | |
528 | parameters = { |
|
533 | parameters = { | |
529 | : global_type_string, |
|
534 | : global_type_string, | |
530 | } |
|
535 | } | |
531 |
|
536 | |||
532 |
|
537 | |||
533 | PlotData |
|
538 | PlotData | |
534 | parameters = { |
|
539 | parameters = { | |
535 | : global_type_string, |
|
540 | : global_type_string, | |
536 | } |
|
541 | } | |
537 |
|
542 | |||
538 |
|
543 | |||
539 | PlotNoiseData |
|
544 | PlotNoiseData | |
540 | parameters = { |
|
545 | parameters = { | |
541 | : global_type_string, |
|
546 | : global_type_string, | |
542 | } |
|
547 | } | |
543 |
|
548 | |||
544 |
|
549 | |||
545 | PlotPHASEData |
|
550 | PlotPHASEData | |
546 | parameters = { |
|
551 | parameters = { | |
547 | : global_type_string, |
|
552 | : global_type_string, | |
548 | } |
|
553 | } | |
549 |
|
554 | |||
550 |
|
555 | |||
551 | PlotRTIData |
|
556 | PlotRTIData | |
552 | parameters = { |
|
557 | parameters = { | |
553 | : global_type_string, |
|
558 | : global_type_string, | |
554 | } |
|
559 | } | |
555 |
|
560 | |||
556 |
|
561 | |||
557 | PlotSNRData |
|
562 | PlotSNRData | |
558 | parameters = { |
|
563 | parameters = { | |
559 | : global_type_string, |
|
564 | : global_type_string, | |
560 | } |
|
565 | } | |
561 |
|
566 | |||
562 |
|
567 | |||
563 | PlotSpectraData |
|
568 | PlotSpectraData | |
564 | parameters = { |
|
569 | parameters = { | |
565 | : global_type_string, |
|
570 | : global_type_string, | |
566 | } |
|
571 | } | |
567 |
|
572 | |||
568 |
|
573 | |||
569 | PlotSpectraMeanData |
|
574 | PlotSpectraMeanData | |
570 | parameters = { |
|
575 | parameters = { | |
571 | : global_type_string, |
|
576 | : global_type_string, | |
572 | } |
|
577 | } | |
573 |
|
578 | |||
574 |
|
579 | |||
575 | PlotWindProfilerData |
|
580 | PlotWindProfilerData | |
576 | parameters = { |
|
581 | parameters = { | |
577 | : global_type_string, |
|
582 | : global_type_string, | |
578 | } |
|
583 | } | |
579 |
|
584 | |||
580 |
|
585 | |||
581 | PowerProfilePlot |
|
586 | PowerProfilePlot | |
582 | parameters = { |
|
587 | parameters = { | |
583 | 'id': global_type_string, |
|
588 | 'id': global_type_string, | |
584 | 'wintitle': global_type_string, |
|
589 | 'wintitle': global_type_string, | |
585 | 'channelList': global_type_list, |
|
590 | 'channelList': global_type_list, | |
586 | 'xmin': global_type_float, |
|
591 | 'xmin': global_type_float, | |
587 | 'xmax': global_type_float, |
|
592 | 'xmax': global_type_float, | |
588 | 'ymin': global_type_float, |
|
593 | 'ymin': global_type_float, | |
589 | 'ymax': global_type_float, |
|
594 | 'ymax': global_type_float, | |
590 | 'save': global_type_boolean, |
|
595 | 'save': global_type_boolean, | |
591 | 'figpath': global_type_string, |
|
596 | 'figpath': global_type_string, | |
592 | 'figfile': global_type_string, |
|
597 | 'figfile': global_type_string, | |
593 |
'show': global_type_ |
|
598 | 'show': global_type_boolean, | |
594 |
'ftp': global_type_ |
|
599 | 'ftp': global_type_boolean, | |
595 | 'wr_period': global_type_integer, |
|
600 | 'wr_period': global_type_integer, | |
596 | 'server': global_type_string, |
|
601 | 'server': global_type_string, | |
597 | 'folder': global_type_string, |
|
602 | 'folder': global_type_string, | |
598 | 'username': global_type_string, |
|
603 | 'username': global_type_string, | |
599 | 'password': global_type_string, |
|
604 | 'password': global_type_string, | |
600 | } |
|
605 | } | |
601 |
|
606 | |||
602 |
|
607 | |||
603 | PrintInfo |
|
608 | PrintInfo | |
604 | parameters = { |
|
609 | parameters = { | |
605 | : global_type_string, |
|
610 | : global_type_string, | |
606 | } |
|
611 | } | |
607 |
|
612 | |||
608 |
|
613 | |||
609 | ProfileConcat |
|
614 | ProfileConcat | |
610 | parameters = { |
|
615 | parameters = { | |
611 | 'm': global_type_string, |
|
616 | 'm': global_type_string, | |
612 | } |
|
617 | } | |
613 |
|
618 | |||
614 |
|
619 | |||
615 | ProfileSelector |
|
620 | ProfileSelector | |
616 | parameters = { |
|
621 | parameters = { | |
617 | 'profileList': global_type_string, |
|
622 | 'profileList': global_type_string, | |
618 | 'profileRangeList': global_type_string, |
|
623 | 'profileRangeList': global_type_string, | |
619 | 'beam': global_type_string, |
|
624 | 'beam': global_type_string, | |
620 | 'byblock': global_type_string, |
|
625 | 'byblock': global_type_string, | |
621 | 'rangeList': global_type_string, |
|
626 | 'rangeList': global_type_string, | |
622 | 'nProfiles': global_type_string, |
|
627 | 'nProfiles': global_type_string, | |
623 | } |
|
628 | } | |
624 |
|
629 | |||
625 |
|
630 | |||
626 | ProfileToChannels |
|
631 | ProfileToChannels | |
627 | parameters = { |
|
632 | parameters = { | |
628 | : global_type_string, |
|
633 | : global_type_string, | |
629 | } |
|
634 | } | |
630 |
|
635 | |||
631 |
|
636 | |||
632 | PublishData |
|
637 | PublishData | |
633 | parameters = { |
|
638 | parameters = { | |
634 | : global_type_string, |
|
639 | : global_type_string, | |
635 | } |
|
640 | } | |
636 |
|
641 | |||
637 |
|
642 | |||
638 | RTIPlot |
|
643 | RTIPlot | |
639 | parameters = { |
|
644 | parameters = { | |
640 | 'id': global_type_string, |
|
645 | 'id': global_type_string, | |
641 | 'wintitle': global_type_string, |
|
646 | 'wintitle': global_type_string, | |
642 | 'channelList': global_type_list, |
|
647 | 'channelList': global_type_list, | |
643 | 'showprofile': global_type_boolean, |
|
648 | 'showprofile': global_type_boolean, | |
644 | 'xmin': global_type_float, |
|
649 | 'xmin': global_type_float, | |
645 | 'xmax': global_type_float, |
|
650 | 'xmax': global_type_float, | |
646 | 'ymin': global_type_float, |
|
651 | 'ymin': global_type_float, | |
647 | 'ymax': global_type_float, |
|
652 | 'ymax': global_type_float, | |
648 | 'zmin': global_type_float, |
|
653 | 'zmin': global_type_float, | |
649 | 'zmax': global_type_float, |
|
654 | 'zmax': global_type_float, | |
650 | 'timerange': global_type_float, |
|
655 | 'timerange': global_type_float, | |
651 | 'save': global_type_boolean, |
|
656 | 'save': global_type_boolean, | |
652 | 'figpath': global_type_string, |
|
657 | 'figpath': global_type_string, | |
653 | 'lastone': global_type_string, |
|
658 | 'lastone': global_type_string, | |
654 | 'figfile': global_type_string, |
|
659 | 'figfile': global_type_string, | |
655 |
'ftp': global_type_ |
|
660 | 'ftp': global_type_boolean, | |
656 | 'wr_period': global_type_integer, |
|
661 | 'wr_period': global_type_integer, | |
657 |
'show': global_type_ |
|
662 | 'show': global_type_boolean, | |
658 | 'server': global_type_string, |
|
663 | 'server': global_type_string, | |
659 | 'folder': global_type_string, |
|
664 | 'folder': global_type_string, | |
660 | 'username': global_type_string, |
|
665 | 'username': global_type_string, | |
661 | 'password': global_type_string, |
|
666 | 'password': global_type_string, | |
662 | 'ftp_wei': global_type_integer, |
|
667 | 'ftp_wei': global_type_integer, | |
663 | 'exp_code': global_type_integer, |
|
668 | 'exp_code': global_type_integer, | |
664 | 'sub_exp_code': global_type_integer, |
|
669 | 'sub_exp_code': global_type_integer, | |
665 | 'plot_pos': global_type_integer, |
|
670 | 'plot_pos': global_type_integer, | |
666 | } |
|
671 | } | |
667 |
|
672 | |||
668 |
|
673 | |||
669 | RTIfromSpectraHeis |
|
674 | RTIfromSpectraHeis | |
670 | parameters = { |
|
675 | parameters = { | |
671 | 'id': global_type_string, |
|
676 | 'id': global_type_string, | |
672 | 'wintitle': global_type_string, |
|
677 | 'wintitle': global_type_string, | |
673 | 'channelList': global_type_list, |
|
678 | 'channelList': global_type_list, | |
674 | 'showprofile': global_type_boolean, |
|
679 | 'showprofile': global_type_boolean, | |
675 | 'xmin': global_type_float, |
|
680 | 'xmin': global_type_float, | |
676 | 'xmax': global_type_float, |
|
681 | 'xmax': global_type_float, | |
677 | 'ymin': global_type_float, |
|
682 | 'ymin': global_type_float, | |
678 | 'ymax': global_type_float, |
|
683 | 'ymax': global_type_float, | |
679 | 'timerange': global_type_float, |
|
684 | 'timerange': global_type_float, | |
680 | 'save': global_type_boolean, |
|
685 | 'save': global_type_boolean, | |
681 | 'figpath': global_type_string, |
|
686 | 'figpath': global_type_string, | |
682 | 'figfile': global_type_string, |
|
687 | 'figfile': global_type_string, | |
683 |
'ftp': global_type_ |
|
688 | 'ftp': global_type_boolean, | |
684 | 'wr_period': global_type_integer, |
|
689 | 'wr_period': global_type_integer, | |
685 |
'show': global_type_ |
|
690 | 'show': global_type_boolean, | |
686 | 'server': global_type_string, |
|
691 | 'server': global_type_string, | |
687 | 'folder': global_type_string, |
|
692 | 'folder': global_type_string, | |
688 | 'username': global_type_string, |
|
693 | 'username': global_type_string, | |
689 | 'password': global_type_string, |
|
694 | 'password': global_type_string, | |
690 | 'ftp_wei': global_type_integer, |
|
695 | 'ftp_wei': global_type_integer, | |
691 | 'exp_code': global_type_integer, |
|
696 | 'exp_code': global_type_integer, | |
692 | 'sub_exp_code': global_type_integer, |
|
697 | 'sub_exp_code': global_type_integer, | |
693 | 'plot_pos': global_type_integer, |
|
698 | 'plot_pos': global_type_integer, | |
694 | } |
|
699 | } | |
695 |
|
700 | |||
696 |
|
701 | |||
697 | Reshaper |
|
702 | Reshaper | |
698 | parameters = { |
|
703 | parameters = { | |
699 | 'shape': global_type_string, |
|
704 | 'shape': global_type_string, | |
700 | 'nTxs': global_type_string, |
|
705 | 'nTxs': global_type_string, | |
701 | } |
|
706 | } | |
702 |
|
707 | |||
703 |
|
708 | |||
704 | SALags |
|
709 | SALags | |
705 | parameters = { |
|
710 | parameters = { | |
706 | : global_type_string, |
|
711 | : global_type_string, | |
707 | } |
|
712 | } | |
708 |
|
713 | |||
709 |
|
714 | |||
710 | SMDetection |
|
715 | SMDetection | |
711 | parameters = { |
|
716 | parameters = { | |
712 | 'hei_ref': global_type_string, |
|
717 | 'hei_ref': global_type_string, | |
713 | 'tauindex': global_type_string, |
|
718 | 'tauindex': global_type_string, | |
714 | 'phaseOffsets': global_type_string, |
|
719 | 'phaseOffsets': global_type_string, | |
715 | 'cohDetection': global_type_string, |
|
720 | 'cohDetection': global_type_string, | |
716 | 'cohDet_timeStep': global_type_string, |
|
721 | 'cohDet_timeStep': global_type_string, | |
717 | 'cohDet_thresh': global_type_string, |
|
722 | 'cohDet_thresh': global_type_string, | |
718 | 'noise_timeStep': global_type_string, |
|
723 | 'noise_timeStep': global_type_string, | |
719 | 'noise_multiple': global_type_string, |
|
724 | 'noise_multiple': global_type_string, | |
720 | 'multDet_timeLimit': global_type_string, |
|
725 | 'multDet_timeLimit': global_type_string, | |
721 | 'multDet_rangeLimit': global_type_string, |
|
726 | 'multDet_rangeLimit': global_type_string, | |
722 | 'phaseThresh': global_type_string, |
|
727 | 'phaseThresh': global_type_string, | |
723 | 'SNRThresh': global_type_string, |
|
728 | 'SNRThresh': global_type_string, | |
724 | 'hmin': global_type_string, |
|
729 | 'hmin': global_type_string, | |
725 | 'hmax': global_type_string, |
|
730 | 'hmax': global_type_string, | |
726 | 'azimuth': global_type_string, |
|
731 | 'azimuth': global_type_string, | |
727 | 'channelPositions': global_type_string, |
|
732 | 'channelPositions': global_type_string, | |
728 | } |
|
733 | } | |
729 |
|
734 | |||
730 |
|
735 | |||
731 | SMPhaseCalibration |
|
736 | SMPhaseCalibration | |
732 | parameters = { |
|
737 | parameters = { | |
733 | 'hmin': global_type_string, |
|
738 | 'hmin': global_type_string, | |
734 | 'hmax': global_type_string, |
|
739 | 'hmax': global_type_string, | |
735 | 'channelPositions': global_type_string, |
|
740 | 'channelPositions': global_type_string, | |
736 | 'nHours': global_type_string, |
|
741 | 'nHours': global_type_string, | |
737 | } |
|
742 | } | |
738 |
|
743 | |||
739 |
|
744 | |||
740 | Scope |
|
745 | Scope | |
741 | parameters = { |
|
746 | parameters = { | |
742 | 'id': global_type_string, |
|
747 | 'id': global_type_string, | |
743 | 'wintitle': global_type_string, |
|
748 | 'wintitle': global_type_string, | |
744 | 'channelList': global_type_list, |
|
749 | 'channelList': global_type_list, | |
745 | 'xmin': global_type_float, |
|
750 | 'xmin': global_type_float, | |
746 | 'xmax': global_type_float, |
|
751 | 'xmax': global_type_float, | |
747 | 'ymin': global_type_float, |
|
752 | 'ymin': global_type_float, | |
748 | 'ymax': global_type_float, |
|
753 | 'ymax': global_type_float, | |
749 | 'save': global_type_boolean, |
|
754 | 'save': global_type_boolean, | |
750 | 'figpath': global_type_string, |
|
755 | 'figpath': global_type_string, | |
751 | 'figfile': global_type_string, |
|
756 | 'figfile': global_type_string, | |
752 |
'show': global_type_ |
|
757 | 'show': global_type_boolean, | |
753 | 'wr_period': global_type_integer, |
|
758 | 'wr_period': global_type_integer, | |
754 |
'ftp': global_type_ |
|
759 | 'ftp': global_type_boolean, | |
755 | 'server': global_type_string, |
|
760 | 'server': global_type_string, | |
756 | 'folder': global_type_string, |
|
761 | 'folder': global_type_string, | |
757 | 'username': global_type_string, |
|
762 | 'username': global_type_string, | |
758 | 'password': global_type_string, |
|
763 | 'password': global_type_string, | |
759 | 'type': global_type_string, |
|
764 | 'type': global_type_string, | |
760 | } |
|
765 | } | |
761 |
|
766 | |||
762 |
|
767 | |||
763 | SendByFTP |
|
768 | SendByFTP | |
764 | parameters = { |
|
769 | parameters = { | |
765 | 'ext': global_type_string, |
|
770 | 'ext': global_type_string, | |
766 | 'localfolder': global_type_string, |
|
771 | 'localfolder': global_type_string, | |
767 | 'remotefolder': global_type_string, |
|
772 | 'remotefolder': global_type_string, | |
768 | 'server': global_type_string, |
|
773 | 'server': global_type_string, | |
769 | 'username': global_type_string, |
|
774 | 'username': global_type_string, | |
770 | 'password': global_type_string, |
|
775 | 'password': global_type_string, | |
771 | 'period': global_type_string, |
|
776 | 'period': global_type_string, | |
772 | } |
|
777 | } | |
773 |
|
778 | |||
774 |
|
779 | |||
775 | SkyMapPlot |
|
780 | SkyMapPlot | |
776 | parameters = { |
|
781 | parameters = { | |
777 | 'id': global_type_string, |
|
782 | 'id': global_type_string, | |
778 | 'wintitle': global_type_string, |
|
783 | 'wintitle': global_type_string, | |
779 | 'channelList': global_type_list, |
|
784 | 'channelList': global_type_list, | |
780 | 'showprofile': global_type_boolean, |
|
785 | 'showprofile': global_type_boolean, | |
781 | 'tmin': global_type_string, |
|
786 | 'tmin': global_type_string, | |
782 | 'tmax': global_type_string, |
|
787 | 'tmax': global_type_string, | |
783 | 'timerange': global_type_float, |
|
788 | 'timerange': global_type_float, | |
784 | 'save': global_type_boolean, |
|
789 | 'save': global_type_boolean, | |
785 | 'figpath': global_type_string, |
|
790 | 'figpath': global_type_string, | |
786 | 'figfile': global_type_string, |
|
791 | 'figfile': global_type_string, | |
787 |
'show': global_type_ |
|
792 | 'show': global_type_boolean, | |
788 |
'ftp': global_type_ |
|
793 | 'ftp': global_type_boolean, | |
789 | 'wr_period': global_type_integer, |
|
794 | 'wr_period': global_type_integer, | |
790 | 'server': global_type_string, |
|
795 | 'server': global_type_string, | |
791 | 'folder': global_type_string, |
|
796 | 'folder': global_type_string, | |
792 | 'username': global_type_string, |
|
797 | 'username': global_type_string, | |
793 | 'password': global_type_string, |
|
798 | 'password': global_type_string, | |
794 | 'ftp_wei': global_type_integer, |
|
799 | 'ftp_wei': global_type_integer, | |
795 | 'exp_code': global_type_integer, |
|
800 | 'exp_code': global_type_integer, | |
796 | 'sub_exp_code': global_type_integer, |
|
801 | 'sub_exp_code': global_type_integer, | |
797 | 'plot_pos': global_type_integer, |
|
802 | 'plot_pos': global_type_integer, | |
798 | 'realtime': global_type_boolean, |
|
803 | 'realtime': global_type_boolean, | |
799 | } |
|
804 | } | |
800 |
|
805 | |||
801 |
|
806 | |||
802 | SpectraCutPlot |
|
807 | SpectraCutPlot | |
803 | parameters = { |
|
808 | parameters = { | |
804 | 'id': global_type_string, |
|
809 | 'id': global_type_string, | |
805 | 'wintitle': global_type_string, |
|
810 | 'wintitle': global_type_string, | |
806 | 'channelList': global_type_list, |
|
811 | 'channelList': global_type_list, | |
807 | 'xmin': global_type_float, |
|
812 | 'xmin': global_type_float, | |
808 | 'xmax': global_type_float, |
|
813 | 'xmax': global_type_float, | |
809 | 'ymin': global_type_float, |
|
814 | 'ymin': global_type_float, | |
810 | 'ymax': global_type_float, |
|
815 | 'ymax': global_type_float, | |
811 | 'save': global_type_boolean, |
|
816 | 'save': global_type_boolean, | |
812 | 'figpath': global_type_string, |
|
817 | 'figpath': global_type_string, | |
813 | 'figfile': global_type_string, |
|
818 | 'figfile': global_type_string, | |
814 |
'show': global_type_ |
|
819 | 'show': global_type_boolean, | |
815 |
'ftp': global_type_ |
|
820 | 'ftp': global_type_boolean, | |
816 | 'wr_period': global_type_integer, |
|
821 | 'wr_period': global_type_integer, | |
817 | 'server': global_type_string, |
|
822 | 'server': global_type_string, | |
818 | 'folder': global_type_string, |
|
823 | 'folder': global_type_string, | |
819 | 'username': global_type_string, |
|
824 | 'username': global_type_string, | |
820 | 'password': global_type_string, |
|
825 | 'password': global_type_string, | |
821 | 'xaxis': global_type_string, |
|
826 | 'xaxis': global_type_string, | |
822 | } |
|
827 | } | |
823 |
|
828 | |||
824 |
|
829 | |||
825 | SpectraHeisScope |
|
830 | SpectraHeisScope | |
826 | parameters = { |
|
831 | parameters = { | |
827 | 'id': global_type_string, |
|
832 | 'id': global_type_string, | |
828 | 'wintitle': global_type_string, |
|
833 | 'wintitle': global_type_string, | |
829 | 'channelList': global_type_list, |
|
834 | 'channelList': global_type_list, | |
830 | 'xmin': global_type_float, |
|
835 | 'xmin': global_type_float, | |
831 | 'xmax': global_type_float, |
|
836 | 'xmax': global_type_float, | |
832 | 'ymin': global_type_float, |
|
837 | 'ymin': global_type_float, | |
833 | 'ymax': global_type_float, |
|
838 | 'ymax': global_type_float, | |
834 | 'save': global_type_boolean, |
|
839 | 'save': global_type_boolean, | |
835 | 'figpath': global_type_string, |
|
840 | 'figpath': global_type_string, | |
836 | 'figfile': global_type_string, |
|
841 | 'figfile': global_type_string, | |
837 |
'ftp': global_type_ |
|
842 | 'ftp': global_type_boolean, | |
838 | 'wr_period': global_type_integer, |
|
843 | 'wr_period': global_type_integer, | |
839 |
'show': global_type_ |
|
844 | 'show': global_type_boolean, | |
840 | 'server': global_type_string, |
|
845 | 'server': global_type_string, | |
841 | 'folder': global_type_string, |
|
846 | 'folder': global_type_string, | |
842 | 'username': global_type_string, |
|
847 | 'username': global_type_string, | |
843 | 'password': global_type_string, |
|
848 | 'password': global_type_string, | |
844 | 'ftp_wei': global_type_integer, |
|
849 | 'ftp_wei': global_type_integer, | |
845 | 'exp_code': global_type_integer, |
|
850 | 'exp_code': global_type_integer, | |
846 | 'sub_exp_code': global_type_integer, |
|
851 | 'sub_exp_code': global_type_integer, | |
847 | 'plot_pos': global_type_integer, |
|
852 | 'plot_pos': global_type_integer, | |
848 | } |
|
853 | } | |
849 |
|
854 | |||
850 |
|
855 | |||
851 | SpectraHeisWriter |
|
856 | SpectraHeisWriter | |
852 | parameters = { |
|
857 | parameters = { | |
853 | : global_type_string, |
|
858 | : global_type_string, | |
854 | } |
|
859 | } | |
855 |
|
860 | |||
856 |
|
861 | |||
857 | SpectraPlot |
|
862 | SpectraPlot | |
858 | parameters = { |
|
863 | parameters = { | |
859 | 'id': global_type_string, |
|
864 | 'id': global_type_string, | |
860 | 'wintitle': global_type_string, |
|
865 | 'wintitle': global_type_string, | |
861 | 'channelList': global_type_list, |
|
866 | 'channelList': global_type_list, | |
862 | 'showprofile': global_type_boolean, |
|
867 | 'showprofile': global_type_boolean, | |
863 | 'xmin': global_type_float, |
|
868 | 'xmin': global_type_float, | |
864 | 'xmax': global_type_float, |
|
869 | 'xmax': global_type_float, | |
865 | 'ymin': global_type_float, |
|
870 | 'ymin': global_type_float, | |
866 | 'ymax': global_type_float, |
|
871 | 'ymax': global_type_float, | |
867 | 'zmin': global_type_float, |
|
872 | 'zmin': global_type_float, | |
868 | 'zmax': global_type_float, |
|
873 | 'zmax': global_type_float, | |
869 | 'save': global_type_boolean, |
|
874 | 'save': global_type_boolean, | |
870 | 'figpath': global_type_string, |
|
875 | 'figpath': global_type_string, | |
871 | 'figfile': global_type_string, |
|
876 | 'figfile': global_type_string, | |
872 |
'show': global_type_ |
|
877 | 'show': global_type_boolean, | |
873 |
'ftp': global_type_ |
|
878 | 'ftp': global_type_boolean, | |
874 | 'wr_period': global_type_integer, |
|
879 | 'wr_period': global_type_integer, | |
875 | 'server': global_type_string, |
|
880 | 'server': global_type_string, | |
876 | 'folder': global_type_string, |
|
881 | 'folder': global_type_string, | |
877 | 'username': global_type_string, |
|
882 | 'username': global_type_string, | |
878 | 'password': global_type_string, |
|
883 | 'password': global_type_string, | |
879 | 'ftp_wei': global_type_integer, |
|
884 | 'ftp_wei': global_type_integer, | |
880 | 'exp_code': global_type_integer, |
|
885 | 'exp_code': global_type_integer, | |
881 | 'sub_exp_code': global_type_integer, |
|
886 | 'sub_exp_code': global_type_integer, | |
882 | 'plot_pos': global_type_integer, |
|
887 | 'plot_pos': global_type_integer, | |
883 | 'realtime': global_type_boolean, |
|
888 | 'realtime': global_type_boolean, | |
884 | 'xaxis': global_type_string, |
|
889 | 'xaxis': global_type_string, | |
885 | } |
|
890 | } | |
886 |
|
891 | |||
887 |
|
892 | |||
888 | SpectraWriter |
|
893 | SpectraWriter | |
889 | parameters = { |
|
894 | parameters = { | |
890 | 'path': global_type_string, |
|
895 | 'path': global_type_string, | |
891 | 'blocksPerFile': global_type_string, |
|
896 | 'blocksPerFile': global_type_string, | |
892 | 'profilesPerBlock': global_type_string, |
|
897 | 'profilesPerBlock': global_type_string, | |
893 | 'set': global_type_string, |
|
898 | 'set': global_type_string, | |
894 | 'ext': global_type_string, |
|
899 | 'ext': global_type_string, | |
895 | 'datatype': global_type_string, |
|
900 | 'datatype': global_type_string, | |
896 | } |
|
901 | } | |
897 |
|
902 | |||
898 |
|
903 | |||
899 | SpectralFitting |
|
904 | SpectralFitting | |
900 | parameters = { |
|
905 | parameters = { | |
901 | 'getSNR': global_type_string, |
|
906 | 'getSNR': global_type_string, | |
902 | 'path': global_type_string, |
|
907 | 'path': global_type_string, | |
903 | 'file': global_type_string, |
|
908 | 'file': global_type_string, | |
904 | 'groupList': global_type_string, |
|
909 | 'groupList': global_type_string, | |
905 | } |
|
910 | } | |
906 |
|
911 | |||
907 |
|
912 | |||
908 | SpectralFittingPlot |
|
913 | SpectralFittingPlot | |
909 | parameters = { |
|
914 | parameters = { | |
910 | 'id': global_type_string, |
|
915 | 'id': global_type_string, | |
911 | 'cutHeight': global_type_string, |
|
916 | 'cutHeight': global_type_string, | |
912 | 'fit': global_type_string, |
|
917 | 'fit': global_type_string, | |
913 | 'wintitle': global_type_string, |
|
918 | 'wintitle': global_type_string, | |
914 | 'channelList': global_type_list, |
|
919 | 'channelList': global_type_list, | |
915 | 'showprofile': global_type_boolean, |
|
920 | 'showprofile': global_type_boolean, | |
916 | 'xmin': global_type_float, |
|
921 | 'xmin': global_type_float, | |
917 | 'xmax': global_type_float, |
|
922 | 'xmax': global_type_float, | |
918 | 'ymin': global_type_float, |
|
923 | 'ymin': global_type_float, | |
919 | 'ymax': global_type_float, |
|
924 | 'ymax': global_type_float, | |
920 | 'save': global_type_boolean, |
|
925 | 'save': global_type_boolean, | |
921 | 'figpath': global_type_string, |
|
926 | 'figpath': global_type_string, | |
922 | 'figfile': global_type_string, |
|
927 | 'figfile': global_type_string, | |
923 |
'show': global_type_ |
|
928 | 'show': global_type_boolean, | |
924 | } |
|
929 | } | |
925 |
|
930 | |||
926 |
|
931 | |||
927 | SpectralMoments |
|
932 | SpectralMoments | |
928 | parameters = { |
|
933 | parameters = { | |
929 | : global_type_string, |
|
934 | : global_type_string, | |
930 | } |
|
935 | } | |
931 |
|
936 | |||
932 |
|
937 | |||
933 | SplitProfiles |
|
938 | SplitProfiles | |
934 | parameters = { |
|
939 | parameters = { | |
935 | 'n': global_type_string, |
|
940 | 'n': global_type_string, | |
936 | } |
|
941 | } | |
937 |
|
942 | |||
938 |
|
943 | |||
939 | USRPWriter |
|
944 | USRPWriter | |
940 | parameters = { |
|
945 | parameters = { | |
941 | 'dataIn': global_type_string, |
|
946 | 'dataIn': global_type_string, | |
942 | } |
|
947 | } | |
943 |
|
948 | |||
944 |
|
949 | |||
945 | VoltageWriter |
|
950 | VoltageWriter | |
946 | parameters = { |
|
951 | parameters = { | |
947 | 'path': global_type_string, |
|
952 | 'path': global_type_string, | |
948 | 'blocksPerFile': global_type_string, |
|
953 | 'blocksPerFile': global_type_string, | |
949 | 'profilesPerBlock': global_type_string, |
|
954 | 'profilesPerBlock': global_type_string, | |
950 | 'set': global_type_string, |
|
955 | 'set': global_type_string, | |
951 | 'ext': global_type_string, |
|
956 | 'ext': global_type_string, | |
952 | 'datatype': global_type_string, |
|
957 | 'datatype': global_type_string, | |
953 | } |
|
958 | } | |
954 |
|
959 | |||
955 |
|
960 | |||
956 | WindProfiler |
|
961 | WindProfiler | |
957 | parameters = { |
|
962 | parameters = { | |
958 | 'technique': global_type_string, |
|
963 | 'technique': global_type_string, | |
959 | } |
|
964 | } | |
960 |
|
965 | |||
961 |
|
966 | |||
962 | WindProfilerPlot |
|
967 | WindProfilerPlot | |
963 | parameters = { |
|
968 | parameters = { | |
964 | 'id': global_type_string, |
|
969 | 'id': global_type_string, | |
965 | 'wintitle': global_type_string, |
|
970 | 'wintitle': global_type_string, | |
966 | 'channelList': global_type_list, |
|
971 | 'channelList': global_type_list, | |
967 | 'showprofile': global_type_boolean, |
|
972 | 'showprofile': global_type_boolean, | |
968 | 'xmin': global_type_float, |
|
973 | 'xmin': global_type_float, | |
969 | 'xmax': global_type_float, |
|
974 | 'xmax': global_type_float, | |
970 | 'ymin': global_type_float, |
|
975 | 'ymin': global_type_float, | |
971 | 'ymax': global_type_float, |
|
976 | 'ymax': global_type_float, | |
972 | 'zmin': global_type_float, |
|
977 | 'zmin': global_type_float, | |
973 | 'zmax': global_type_float, |
|
978 | 'zmax': global_type_float, | |
974 | 'zmax_ver': global_type_string, |
|
979 | 'zmax_ver': global_type_string, | |
975 | 'zmin_ver': global_type_string, |
|
980 | 'zmin_ver': global_type_string, | |
976 | 'SNRmin': global_type_float, |
|
981 | 'SNRmin': global_type_float, | |
977 | 'SNRmax': global_type_float, |
|
982 | 'SNRmax': global_type_float, | |
978 | 'timerange': global_type_float, |
|
983 | 'timerange': global_type_float, | |
979 | 'SNRthresh': global_type_string, |
|
984 | 'SNRthresh': global_type_string, | |
980 | 'save': global_type_boolean, |
|
985 | 'save': global_type_boolean, | |
981 | 'figpath': global_type_string, |
|
986 | 'figpath': global_type_string, | |
982 | 'lastone': global_type_string, |
|
987 | 'lastone': global_type_string, | |
983 | 'figfile': global_type_string, |
|
988 | 'figfile': global_type_string, | |
984 |
'ftp': global_type_ |
|
989 | 'ftp': global_type_boolean, | |
985 | 'wr_period': global_type_integer, |
|
990 | 'wr_period': global_type_integer, | |
986 |
'show': global_type_ |
|
991 | 'show': global_type_boolean, | |
987 | 'server': global_type_string, |
|
992 | 'server': global_type_string, | |
988 | 'folder': global_type_string, |
|
993 | 'folder': global_type_string, | |
989 | 'username': global_type_string, |
|
994 | 'username': global_type_string, | |
990 | 'password': global_type_string, |
|
995 | 'password': global_type_string, | |
991 | 'ftp_wei': global_type_integer, |
|
996 | 'ftp_wei': global_type_integer, | |
992 | 'exp_code': global_type_integer, |
|
997 | 'exp_code': global_type_integer, | |
993 | 'sub_exp_code': global_type_integer, |
|
998 | 'sub_exp_code': global_type_integer, | |
994 | 'plot_pos': global_type_integer, |
|
999 | 'plot_pos': global_type_integer, | |
995 | } |
|
1000 | } | |
996 |
|
1001 | |||
997 |
|
1002 | |||
998 | Writer |
|
1003 | Writer | |
999 | parameters = { |
|
1004 | parameters = { | |
1000 | 'dataIn': global_type_string, |
|
1005 | 'dataIn': global_type_string, | |
1001 | } |
|
1006 | } | |
1002 |
|
1007 | |||
1003 |
|
1008 | |||
1004 | AMISRProc |
|
1009 | AMISRProc | |
1005 | parameters = { |
|
1010 | parameters = { | |
1006 | : global_type_string, |
|
1011 | : global_type_string, | |
1007 | } |
|
1012 | } | |
1008 |
|
1013 | |||
1009 |
|
1014 | |||
1010 | AMISRReader |
|
1015 | AMISRReader | |
1011 | parameters = { |
|
1016 | parameters = { | |
1012 | : global_type_string, |
|
1017 | : global_type_string, | |
1013 | } |
|
1018 | } | |
1014 |
|
1019 | |||
1015 |
|
1020 | |||
1016 | CorrelationProc |
|
1021 | CorrelationProc | |
1017 | parameters = { |
|
1022 | parameters = { | |
1018 | 'lags': global_type_string, |
|
1023 | 'lags': global_type_string, | |
1019 | 'mode': global_type_string, |
|
1024 | 'mode': global_type_string, | |
1020 | 'pairsList': 'pairsLists', |
|
1025 | 'pairsList': 'pairsLists', | |
1021 | 'fullBuffer': global_type_string, |
|
1026 | 'fullBuffer': global_type_string, | |
1022 | 'nAvg': global_type_string, |
|
1027 | 'nAvg': global_type_string, | |
1023 | 'removeDC': global_type_string, |
|
1028 | 'removeDC': global_type_string, | |
1024 | 'splitCF': global_type_string, |
|
1029 | 'splitCF': global_type_string, | |
1025 | } |
|
1030 | } | |
1026 |
|
1031 | |||
1027 |
|
1032 | |||
1028 | FitsReader |
|
1033 | FitsReader | |
1029 | parameters = { |
|
1034 | parameters = { | |
1030 | : global_type_string, |
|
1035 | : global_type_string, | |
1031 | } |
|
1036 | } | |
1032 |
|
1037 | |||
1033 |
|
1038 | |||
1034 | HFReader |
|
1039 | HFReader | |
1035 | parameters = { |
|
1040 | parameters = { | |
1036 | : global_type_string, |
|
1041 | : global_type_string, | |
1037 | } |
|
1042 | } | |
1038 |
|
1043 | |||
1039 |
|
1044 | |||
1040 | ParamReader |
|
1045 | ParamReader | |
1041 | parameters = { |
|
1046 | parameters = { | |
1042 | : global_type_string, |
|
1047 | : global_type_string, | |
1043 | } |
|
1048 | } | |
1044 |
|
1049 | |||
1045 |
|
1050 | |||
1046 | ParametersProc |
|
1051 | ParametersProc | |
1047 | parameters = { |
|
1052 | parameters = { | |
1048 | : global_type_string, |
|
1053 | : global_type_string, | |
1049 | } |
|
1054 | } | |
1050 |
|
1055 | |||
1051 |
|
1056 | |||
1052 | ProcessingUnit |
|
1057 | ProcessingUnit | |
1053 | parameters = { |
|
1058 | parameters = { | |
1054 | : global_type_string, |
|
1059 | : global_type_string, | |
1055 | } |
|
1060 | } | |
1056 |
|
1061 | |||
1057 |
|
1062 | |||
1058 | ReceiverData |
|
1063 | ReceiverData | |
1059 | parameters = { |
|
1064 | parameters = { | |
1060 | : global_type_string, |
|
1065 | : global_type_string, | |
1061 | } |
|
1066 | } | |
1062 |
|
1067 | |||
1063 |
|
1068 | |||
1064 | SendToServer |
|
1069 | SendToServer | |
1065 | parameters = { |
|
1070 | parameters = { | |
1066 | : global_type_string, |
|
1071 | : global_type_string, | |
1067 | } |
|
1072 | } | |
1068 |
|
1073 | |||
1069 |
|
1074 | |||
1070 | SpectraAFCProc |
|
1075 | SpectraAFCProc | |
1071 | parameters = { |
|
1076 | parameters = { | |
1072 | 'nProfiles': global_type_string, |
|
1077 | 'nProfiles': global_type_string, | |
1073 | 'nFFTPoints': global_type_string, |
|
1078 | 'nFFTPoints': global_type_string, | |
1074 | 'pairsList': 'pairsLists', |
|
1079 | 'pairsList': 'pairsLists', | |
1075 | 'code': global_type_string, |
|
1080 | 'code': global_type_string, | |
1076 | 'nCode': global_type_string, |
|
1081 | 'nCode': global_type_string, | |
1077 | 'nBaud': global_type_string, |
|
1082 | 'nBaud': global_type_string, | |
1078 | } |
|
1083 | } | |
1079 |
|
1084 | |||
1080 |
|
1085 | |||
1081 | SpectraHeisProc |
|
1086 | SpectraHeisProc | |
1082 | parameters = { |
|
1087 | parameters = { | |
1083 | : global_type_string, |
|
1088 | : global_type_string, | |
1084 | } |
|
1089 | } | |
1085 |
|
1090 | |||
1086 |
|
1091 | |||
1087 | SpectraLagsProc |
|
1092 | SpectraLagsProc | |
1088 | parameters = { |
|
1093 | parameters = { | |
1089 | 'nProfiles': global_type_string, |
|
1094 | 'nProfiles': global_type_string, | |
1090 | 'nFFTPoints': global_type_string, |
|
1095 | 'nFFTPoints': global_type_string, | |
1091 | 'pairsList': 'pairsLists', |
|
1096 | 'pairsList': 'pairsLists', | |
1092 | 'code': global_type_string, |
|
1097 | 'code': global_type_string, | |
1093 | 'nCode': global_type_string, |
|
1098 | 'nCode': global_type_string, | |
1094 | 'nBaud': global_type_string, |
|
1099 | 'nBaud': global_type_string, | |
1095 | 'codeFromHeader': global_type_string, |
|
1100 | 'codeFromHeader': global_type_string, | |
1096 | 'pulseIndex': global_type_string, |
|
1101 | 'pulseIndex': global_type_string, | |
1097 | } |
|
1102 | } | |
1098 |
|
1103 | |||
1099 |
|
1104 | |||
1100 | SpectraProc |
|
1105 | SpectraProc | |
1101 | parameters = { |
|
1106 | parameters = { | |
1102 | 'nProfiles': global_type_string, |
|
1107 | 'nProfiles': global_type_string, | |
1103 | 'nFFTPoints': global_type_string, |
|
1108 | 'nFFTPoints': global_type_string, | |
1104 | 'pairsList': 'pairsLists', |
|
1109 | 'pairsList': 'pairsLists', | |
1105 | 'ippFactor': global_type_string, |
|
1110 | 'ippFactor': global_type_string, | |
1106 | } |
|
1111 | } | |
1107 |
|
1112 | |||
1108 |
|
1113 | |||
1109 | SpectraReader |
|
1114 | SpectraReader | |
1110 | parameters = { |
|
1115 | parameters = { | |
1111 | 'path': global_type_string, |
|
1116 | 'path': global_type_string, | |
1112 | 'startDate': global_type_string, |
|
1117 | 'startDate': global_type_string, | |
1113 | 'endDate': global_type_string, |
|
1118 | 'endDate': global_type_string, | |
1114 | 'startTime': global_type_string, |
|
1119 | 'startTime': global_type_string, | |
1115 | 'endTime': global_type_string, |
|
1120 | 'endTime': global_type_string, | |
1116 | 'set': global_type_string, |
|
1121 | 'set': global_type_string, | |
1117 | 'expLabel': global_type_string, |
|
1122 | 'expLabel': global_type_string, | |
1118 | 'ext': global_type_string, |
|
1123 | 'ext': global_type_string, | |
1119 | 'online': global_type_string, |
|
1124 | 'online': global_type_string, | |
1120 | 'delay': global_type_string, |
|
1125 | 'delay': global_type_string, | |
1121 | 'walk': global_type_string, |
|
1126 | 'walk': global_type_string, | |
1122 | 'getblock': global_type_string, |
|
1127 | 'getblock': global_type_string, | |
1123 | 'nTxs': global_type_string, |
|
1128 | 'nTxs': global_type_string, | |
1124 | 'realtime': global_type_boolean, |
|
1129 | 'realtime': global_type_boolean, | |
1125 | 'blocksize': global_type_string, |
|
1130 | 'blocksize': global_type_string, | |
1126 | 'blocktime': global_type_string, |
|
1131 | 'blocktime': global_type_string, | |
1127 | 'queue': global_type_string, |
|
1132 | 'queue': global_type_string, | |
1128 | 'skip': global_type_string, |
|
1133 | 'skip': global_type_string, | |
1129 | 'cursor': global_type_string, |
|
1134 | 'cursor': global_type_string, | |
1130 | 'warnings': global_type_string, |
|
1135 | 'warnings': global_type_string, | |
1131 | 'verbose': global_type_string, |
|
1136 | 'verbose': global_type_string, | |
1132 | } |
|
1137 | } | |
1133 |
|
1138 | |||
1134 |
|
1139 | |||
1135 | USRPReader |
|
1140 | USRPReader | |
1136 | parameters = { |
|
1141 | parameters = { | |
1137 | : global_type_string, |
|
1142 | : global_type_string, | |
1138 | } |
|
1143 | } | |
1139 |
|
1144 | |||
1140 |
|
1145 | |||
1141 | VoltageProc |
|
1146 | VoltageProc | |
1142 | parameters = { |
|
1147 | parameters = { | |
1143 | : global_type_string, |
|
1148 | : global_type_string, | |
1144 | } |
|
1149 | } | |
1145 |
|
1150 | |||
1146 |
|
1151 | |||
1147 | VoltageReader |
|
1152 | VoltageReader | |
1148 | parameters = { |
|
1153 | parameters = { | |
1149 | 'path': global_type_string, |
|
1154 | 'path': global_type_string, | |
1150 | 'startDate': global_type_string, |
|
1155 | 'startDate': global_type_string, | |
1151 | 'endDate': global_type_string, |
|
1156 | 'endDate': global_type_string, | |
1152 | 'startTime': global_type_string, |
|
1157 | 'startTime': global_type_string, | |
1153 | 'endTime': global_type_string, |
|
1158 | 'endTime': global_type_string, | |
1154 | 'set': global_type_string, |
|
1159 | 'set': global_type_string, | |
1155 | 'expLabel': global_type_string, |
|
1160 | 'expLabel': global_type_string, | |
1156 | 'ext': global_type_string, |
|
1161 | 'ext': global_type_string, | |
1157 | 'online': global_type_string, |
|
1162 | 'online': global_type_string, | |
1158 | 'delay': global_type_string, |
|
1163 | 'delay': global_type_string, | |
1159 | 'walk': global_type_string, |
|
1164 | 'walk': global_type_string, | |
1160 | 'getblock': global_type_string, |
|
1165 | 'getblock': global_type_string, | |
1161 | 'nTxs': global_type_string, |
|
1166 | 'nTxs': global_type_string, | |
1162 | 'realtime': global_type_boolean, |
|
1167 | 'realtime': global_type_boolean, | |
1163 | 'blocksize': global_type_string, |
|
1168 | 'blocksize': global_type_string, | |
1164 | 'blocktime': global_type_string, |
|
1169 | 'blocktime': global_type_string, | |
1165 | 'queue': global_type_string, |
|
1170 | 'queue': global_type_string, | |
1166 | 'skip': global_type_string, |
|
1171 | 'skip': global_type_string, | |
1167 | 'cursor': global_type_string, |
|
1172 | 'cursor': global_type_string, | |
1168 | 'warnings': global_type_string, |
|
1173 | 'warnings': global_type_string, | |
1169 | 'verbose': global_type_string, |
|
1174 | 'verbose': global_type_string, | |
1170 | } |
|
1175 | } | |
1171 |
|
1176 | |||
1172 |
|
1177 |
General Comments 0
You need to be logged in to leave comments.
Login now