##// END OF EJS Templates
checking misspelled kwargs in operations/processing units
José Chávez -
r929:136584fbb1e2
parent child
Show More
@@ -1,1946 +1,1945
1 1 import os
2 2 import datetime
3 3 import numpy
4
4 import inspect
5 5 from figure import Figure, isRealtime, isTimeInHourRange
6 6 from plotting_codes import *
7 7
8 8
9 9 class MomentsPlot(Figure):
10 10
11 11 isConfig = None
12 12 __nsubplots = None
13 13
14 14 WIDTHPROF = None
15 15 HEIGHTPROF = None
16 16 PREFIX = 'prm'
17 17
18 18 def __init__(self, **kwargs):
19 19 Figure.__init__(self, **kwargs)
20 20 self.isConfig = False
21 21 self.__nsubplots = 1
22 22
23 23 self.WIDTH = 280
24 24 self.HEIGHT = 250
25 25 self.WIDTHPROF = 120
26 26 self.HEIGHTPROF = 0
27 27 self.counter_imagwr = 0
28 28
29 29 self.PLOT_CODE = MOMENTS_CODE
30 30
31 31 self.FTP_WEI = None
32 32 self.EXP_CODE = None
33 33 self.SUB_EXP_CODE = None
34 34 self.PLOT_POS = None
35 35
36 36 def getSubplots(self):
37 37
38 38 ncol = int(numpy.sqrt(self.nplots)+0.9)
39 39 nrow = int(self.nplots*1./ncol + 0.9)
40 40
41 41 return nrow, ncol
42 42
43 43 def setup(self, id, nplots, wintitle, showprofile=True, show=True):
44 44
45 45 self.__showprofile = showprofile
46 46 self.nplots = nplots
47 47
48 48 ncolspan = 1
49 49 colspan = 1
50 50 if showprofile:
51 51 ncolspan = 3
52 52 colspan = 2
53 53 self.__nsubplots = 2
54 54
55 55 self.createFigure(id = id,
56 56 wintitle = wintitle,
57 57 widthplot = self.WIDTH + self.WIDTHPROF,
58 58 heightplot = self.HEIGHT + self.HEIGHTPROF,
59 59 show=show)
60 60
61 61 nrow, ncol = self.getSubplots()
62 62
63 63 counter = 0
64 64 for y in range(nrow):
65 65 for x in range(ncol):
66 66
67 67 if counter >= self.nplots:
68 68 break
69 69
70 70 self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan, colspan, 1)
71 71
72 72 if showprofile:
73 73 self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan+colspan, 1, 1)
74 74
75 75 counter += 1
76 76
77 77 def run(self, dataOut, id, wintitle="", channelList=None, showprofile=True,
78 78 xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None,
79 79 save=False, figpath='./', figfile=None, show=True, ftp=False, wr_period=1,
80 80 server=None, folder=None, username=None, password=None,
81 81 ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0, realtime=False):
82 82
83 83 """
84 84
85 85 Input:
86 86 dataOut :
87 87 id :
88 88 wintitle :
89 89 channelList :
90 90 showProfile :
91 91 xmin : None,
92 92 xmax : None,
93 93 ymin : None,
94 94 ymax : None,
95 95 zmin : None,
96 96 zmax : None
97 97 """
98 98
99 99 if dataOut.flagNoData:
100 100 return None
101 101
102 102 if realtime:
103 103 if not(isRealtime(utcdatatime = dataOut.utctime)):
104 104 print 'Skipping this plot function'
105 105 return
106 106
107 107 if channelList == None:
108 108 channelIndexList = dataOut.channelIndexList
109 109 else:
110 110 channelIndexList = []
111 111 for channel in channelList:
112 112 if channel not in dataOut.channelList:
113 113 raise ValueError, "Channel %d is not in dataOut.channelList"
114 114 channelIndexList.append(dataOut.channelList.index(channel))
115 115
116 116 factor = dataOut.normFactor
117 117 x = dataOut.abscissaList
118 118 y = dataOut.heightList
119 119
120 120 z = dataOut.data_pre[channelIndexList,:,:]/factor
121 121 z = numpy.where(numpy.isfinite(z), z, numpy.NAN)
122 122 avg = numpy.average(z, axis=1)
123 123 noise = dataOut.noise/factor
124 124
125 125 zdB = 10*numpy.log10(z)
126 126 avgdB = 10*numpy.log10(avg)
127 127 noisedB = 10*numpy.log10(noise)
128 128
129 129 #thisDatetime = dataOut.datatime
130 130 thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.getTimeRange()[0])
131 131 title = wintitle + " Parameters"
132 132 xlabel = "Velocity (m/s)"
133 133 ylabel = "Range (Km)"
134 134
135 135 update_figfile = False
136 136
137 137 if not self.isConfig:
138 138
139 139 nplots = len(channelIndexList)
140 140
141 141 self.setup(id=id,
142 142 nplots=nplots,
143 143 wintitle=wintitle,
144 144 showprofile=showprofile,
145 145 show=show)
146 146
147 147 if xmin == None: xmin = numpy.nanmin(x)
148 148 if xmax == None: xmax = numpy.nanmax(x)
149 149 if ymin == None: ymin = numpy.nanmin(y)
150 150 if ymax == None: ymax = numpy.nanmax(y)
151 151 if zmin == None: zmin = numpy.nanmin(avgdB)*0.9
152 152 if zmax == None: zmax = numpy.nanmax(avgdB)*0.9
153 153
154 154 self.FTP_WEI = ftp_wei
155 155 self.EXP_CODE = exp_code
156 156 self.SUB_EXP_CODE = sub_exp_code
157 157 self.PLOT_POS = plot_pos
158 158
159 159 self.isConfig = True
160 160 update_figfile = True
161 161
162 162 self.setWinTitle(title)
163 163
164 164 for i in range(self.nplots):
165 165 str_datetime = '%s %s'%(thisDatetime.strftime("%Y/%m/%d"),thisDatetime.strftime("%H:%M:%S"))
166 166 title = "Channel %d: %4.2fdB: %s" %(dataOut.channelList[i], noisedB[i], str_datetime)
167 167 axes = self.axesList[i*self.__nsubplots]
168 168 axes.pcolor(x, y, zdB[i,:,:],
169 169 xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, zmin=zmin, zmax=zmax,
170 170 xlabel=xlabel, ylabel=ylabel, title=title,
171 171 ticksize=9, cblabel='')
172 172 #Mean Line
173 173 mean = dataOut.data_param[i, 1, :]
174 174 axes.addpline(mean, y, idline=0, color="black", linestyle="solid", lw=1)
175 175
176 176 if self.__showprofile:
177 177 axes = self.axesList[i*self.__nsubplots +1]
178 178 axes.pline(avgdB[i], y,
179 179 xmin=zmin, xmax=zmax, ymin=ymin, ymax=ymax,
180 180 xlabel='dB', ylabel='', title='',
181 181 ytick_visible=False,
182 182 grid='x')
183 183
184 184 noiseline = numpy.repeat(noisedB[i], len(y))
185 185 axes.addpline(noiseline, y, idline=1, color="black", linestyle="dashed", lw=2)
186 186
187 187 self.draw()
188 188
189 189 self.save(figpath=figpath,
190 190 figfile=figfile,
191 191 save=save,
192 192 ftp=ftp,
193 193 wr_period=wr_period,
194 194 thisDatetime=thisDatetime)
195 195
196 196
197 197
198 198 class SkyMapPlot(Figure):
199 199
200 200 __isConfig = None
201 201 __nsubplots = None
202 202
203 203 WIDTHPROF = None
204 204 HEIGHTPROF = None
205 205 PREFIX = 'mmap'
206 206
207 207 def __init__(self, **kwargs):
208 208 Figure.__init__(self, **kwargs)
209 209 self.isConfig = False
210 210 self.__nsubplots = 1
211 211
212 212 # self.WIDTH = 280
213 213 # self.HEIGHT = 250
214 214 self.WIDTH = 600
215 215 self.HEIGHT = 600
216 216 self.WIDTHPROF = 120
217 217 self.HEIGHTPROF = 0
218 218 self.counter_imagwr = 0
219 219
220 220 self.PLOT_CODE = MSKYMAP_CODE
221 221
222 222 self.FTP_WEI = None
223 223 self.EXP_CODE = None
224 224 self.SUB_EXP_CODE = None
225 225 self.PLOT_POS = None
226 226
227 227 def getSubplots(self):
228 228
229 229 ncol = int(numpy.sqrt(self.nplots)+0.9)
230 230 nrow = int(self.nplots*1./ncol + 0.9)
231 231
232 232 return nrow, ncol
233 233
234 234 def setup(self, id, nplots, wintitle, showprofile=False, show=True):
235 235
236 236 self.__showprofile = showprofile
237 237 self.nplots = nplots
238 238
239 239 ncolspan = 1
240 240 colspan = 1
241 241
242 242 self.createFigure(id = id,
243 243 wintitle = wintitle,
244 244 widthplot = self.WIDTH, #+ self.WIDTHPROF,
245 245 heightplot = self.HEIGHT,# + self.HEIGHTPROF,
246 246 show=show)
247 247
248 248 nrow, ncol = 1,1
249 249 counter = 0
250 250 x = 0
251 251 y = 0
252 252 self.addAxes(1, 1, 0, 0, 1, 1, True)
253 253
254 254 def run(self, dataOut, id, wintitle="", channelList=None, showprofile=False,
255 255 tmin=0, tmax=24, timerange=None,
256 256 save=False, figpath='./', figfile=None, show=True, ftp=False, wr_period=1,
257 257 server=None, folder=None, username=None, password=None,
258 258 ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0, realtime=False):
259 259
260 260 """
261 261
262 262 Input:
263 263 dataOut :
264 264 id :
265 265 wintitle :
266 266 channelList :
267 267 showProfile :
268 268 xmin : None,
269 269 xmax : None,
270 270 ymin : None,
271 271 ymax : None,
272 272 zmin : None,
273 273 zmax : None
274 274 """
275 275
276 276 arrayParameters = dataOut.data_param
277 277 error = arrayParameters[:,-1]
278 278 indValid = numpy.where(error == 0)[0]
279 279 finalMeteor = arrayParameters[indValid,:]
280 280 finalAzimuth = finalMeteor[:,3]
281 281 finalZenith = finalMeteor[:,4]
282 282
283 283 x = finalAzimuth*numpy.pi/180
284 284 y = finalZenith
285 285 x1 = [dataOut.ltctime, dataOut.ltctime]
286 286
287 287 #thisDatetime = dataOut.datatime
288 288 thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.ltctime)
289 289 title = wintitle + " Parameters"
290 290 xlabel = "Zonal Zenith Angle (deg) "
291 291 ylabel = "Meridional Zenith Angle (deg)"
292 292 update_figfile = False
293 293
294 294 if not self.isConfig:
295 295
296 296 nplots = 1
297 297
298 298 self.setup(id=id,
299 299 nplots=nplots,
300 300 wintitle=wintitle,
301 301 showprofile=showprofile,
302 302 show=show)
303 303
304 304 if self.xmin is None and self.xmax is None:
305 305 self.xmin, self.xmax = self.getTimeLim(x1, tmin, tmax, timerange)
306 306
307 307 if timerange != None:
308 308 self.timerange = timerange
309 309 else:
310 310 self.timerange = self.xmax - self.xmin
311 311
312 312 self.FTP_WEI = ftp_wei
313 313 self.EXP_CODE = exp_code
314 314 self.SUB_EXP_CODE = sub_exp_code
315 315 self.PLOT_POS = plot_pos
316 316 self.name = thisDatetime.strftime("%Y%m%d_%H%M%S")
317 317 self.firstdate = '%s %s'%(thisDatetime.strftime("%Y/%m/%d"),thisDatetime.strftime("%H:%M:%S"))
318 318 self.isConfig = True
319 319 update_figfile = True
320 320
321 321 self.setWinTitle(title)
322 322
323 323 i = 0
324 324 str_datetime = '%s %s'%(thisDatetime.strftime("%Y/%m/%d"),thisDatetime.strftime("%H:%M:%S"))
325 325
326 326 axes = self.axesList[i*self.__nsubplots]
327 327 nevents = axes.x_buffer.shape[0] + x.shape[0]
328 328 title = "Meteor Detection Sky Map\n %s - %s \n Number of events: %5.0f\n" %(self.firstdate,str_datetime,nevents)
329 329 axes.polar(x, y,
330 330 title=title, xlabel=xlabel, ylabel=ylabel,
331 331 ticksize=9, cblabel='')
332 332
333 333 self.draw()
334 334
335 335 self.save(figpath=figpath,
336 336 figfile=figfile,
337 337 save=save,
338 338 ftp=ftp,
339 339 wr_period=wr_period,
340 340 thisDatetime=thisDatetime,
341 341 update_figfile=update_figfile)
342 342
343 343 if dataOut.ltctime >= self.xmax:
344 344 self.isConfigmagwr = wr_period
345 345 self.isConfig = False
346 346 update_figfile = True
347 347 axes.__firsttime = True
348 348 self.xmin += self.timerange
349 349 self.xmax += self.timerange
350 350
351 351
352 352
353 353
354 354 class WindProfilerPlot(Figure):
355 355
356 356 __isConfig = None
357 357 __nsubplots = None
358 358
359 359 WIDTHPROF = None
360 360 HEIGHTPROF = None
361 361 PREFIX = 'wind'
362 362
363 363 def __init__(self, **kwargs):
364 364 Figure.__init__(self, **kwargs)
365 365 self.timerange = None
366 366 self.isConfig = False
367 367 self.__nsubplots = 1
368 368
369 369 self.WIDTH = 800
370 370 self.HEIGHT = 300
371 371 self.WIDTHPROF = 120
372 372 self.HEIGHTPROF = 0
373 373 self.counter_imagwr = 0
374 374
375 375 self.PLOT_CODE = WIND_CODE
376 376
377 377 self.FTP_WEI = None
378 378 self.EXP_CODE = None
379 379 self.SUB_EXP_CODE = None
380 380 self.PLOT_POS = None
381 381 self.tmin = None
382 382 self.tmax = None
383 383
384 384 self.xmin = None
385 385 self.xmax = None
386 386
387 387 self.figfile = None
388 388
389 389 def getSubplots(self):
390 390
391 391 ncol = 1
392 392 nrow = self.nplots
393 393
394 394 return nrow, ncol
395 395
396 396 def setup(self, id, nplots, wintitle, showprofile=True, show=True):
397 397
398 398 self.__showprofile = showprofile
399 399 self.nplots = nplots
400 400
401 401 ncolspan = 1
402 402 colspan = 1
403 403
404 404 self.createFigure(id = id,
405 405 wintitle = wintitle,
406 406 widthplot = self.WIDTH + self.WIDTHPROF,
407 407 heightplot = self.HEIGHT + self.HEIGHTPROF,
408 408 show=show)
409 409
410 410 nrow, ncol = self.getSubplots()
411 411
412 412 counter = 0
413 413 for y in range(nrow):
414 414 if counter >= self.nplots:
415 415 break
416 416
417 417 self.addAxes(nrow, ncol*ncolspan, y, 0, colspan, 1)
418 418 counter += 1
419 419
420 420 def run(self, dataOut, id, wintitle="", channelList=None, showprofile='False',
421 421 xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None,
422 422 zmax_ver = None, zmin_ver = None, SNRmin = None, SNRmax = None,
423 423 timerange=None, SNRthresh = None,
424 424 save=False, figpath='./', lastone=0,figfile=None, ftp=False, wr_period=1, show=True,
425 425 server=None, folder=None, username=None, password=None,
426 426 ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0):
427 427 """
428 428
429 429 Input:
430 430 dataOut :
431 431 id :
432 432 wintitle :
433 433 channelList :
434 434 showProfile :
435 435 xmin : None,
436 436 xmax : None,
437 437 ymin : None,
438 438 ymax : None,
439 439 zmin : None,
440 440 zmax : None
441 441 """
442 442
443 443 # if timerange is not None:
444 444 # self.timerange = timerange
445 445 #
446 446 # tmin = None
447 447 # tmax = None
448 448
449 449
450 450 x = dataOut.getTimeRange1(dataOut.outputInterval)
451 451 y = dataOut.heightList
452 452 z = dataOut.data_output.copy()
453 453 nplots = z.shape[0] #Number of wind dimensions estimated
454 454 nplotsw = nplots
455 455
456 456
457 457 #If there is a SNR function defined
458 458 if dataOut.data_SNR is not None:
459 459 nplots += 1
460 460 SNR = dataOut.data_SNR
461 461 SNRavg = numpy.average(SNR, axis=0)
462 462
463 463 SNRdB = 10*numpy.log10(SNR)
464 464 SNRavgdB = 10*numpy.log10(SNRavg)
465 465
466 466 if SNRthresh == None: SNRthresh = -5.0
467 467 ind = numpy.where(SNRavg < 10**(SNRthresh/10))[0]
468 468
469 469 for i in range(nplotsw):
470 470 z[i,ind] = numpy.nan
471 471
472 472 thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.ltctime)
473 473 #thisDatetime = datetime.datetime.now()
474 474 title = wintitle + "Wind"
475 475 xlabel = ""
476 476 ylabel = "Height (km)"
477 477 update_figfile = False
478 478
479 479 if not self.isConfig:
480 480
481 481 self.setup(id=id,
482 482 nplots=nplots,
483 483 wintitle=wintitle,
484 484 showprofile=showprofile,
485 485 show=show)
486 486
487 487 if timerange is not None:
488 488 self.timerange = timerange
489 489
490 490 self.xmin, self.xmax = self.getTimeLim(x, xmin, xmax, timerange)
491 491
492 492 if ymin == None: ymin = numpy.nanmin(y)
493 493 if ymax == None: ymax = numpy.nanmax(y)
494 494
495 495 if zmax == None: zmax = numpy.nanmax(abs(z[range(2),:]))
496 496 #if numpy.isnan(zmax): zmax = 50
497 497 if zmin == None: zmin = -zmax
498 498
499 499 if nplotsw == 3:
500 500 if zmax_ver == None: zmax_ver = numpy.nanmax(abs(z[2,:]))
501 501 if zmin_ver == None: zmin_ver = -zmax_ver
502 502
503 503 if dataOut.data_SNR is not None:
504 504 if SNRmin == None: SNRmin = numpy.nanmin(SNRavgdB)
505 505 if SNRmax == None: SNRmax = numpy.nanmax(SNRavgdB)
506 506
507 507
508 508 self.FTP_WEI = ftp_wei
509 509 self.EXP_CODE = exp_code
510 510 self.SUB_EXP_CODE = sub_exp_code
511 511 self.PLOT_POS = plot_pos
512 512
513 513 self.name = thisDatetime.strftime("%Y%m%d_%H%M%S")
514 514 self.isConfig = True
515 515 self.figfile = figfile
516 516 update_figfile = True
517 517
518 518 self.setWinTitle(title)
519 519
520 520 if ((self.xmax - x[1]) < (x[1]-x[0])):
521 521 x[1] = self.xmax
522 522
523 523 strWind = ['Zonal', 'Meridional', 'Vertical']
524 524 strCb = ['Velocity (m/s)','Velocity (m/s)','Velocity (cm/s)']
525 525 zmaxVector = [zmax, zmax, zmax_ver]
526 526 zminVector = [zmin, zmin, zmin_ver]
527 527 windFactor = [1,1,100]
528 528
529 529 for i in range(nplotsw):
530 530
531 531 title = "%s Wind: %s" %(strWind[i], thisDatetime.strftime("%Y/%m/%d %H:%M:%S"))
532 532 axes = self.axesList[i*self.__nsubplots]
533 533
534 534 z1 = z[i,:].reshape((1,-1))*windFactor[i]
535 535 #z1=numpy.ma.masked_where(z1==0.,z1)
536 536
537 537 axes.pcolorbuffer(x, y, z1,
538 538 xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=zminVector[i], zmax=zmaxVector[i],
539 539 xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True,
540 540 ticksize=9, cblabel=strCb[i], cbsize="1%", colormap="seismic" )
541 541
542 542 if dataOut.data_SNR is not None:
543 543 i += 1
544 544 title = "Signal Noise Ratio (SNR): %s" %(thisDatetime.strftime("%Y/%m/%d %H:%M:%S"))
545 545 axes = self.axesList[i*self.__nsubplots]
546 546 SNRavgdB = SNRavgdB.reshape((1,-1))
547 547 axes.pcolorbuffer(x, y, SNRavgdB,
548 548 xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=SNRmin, zmax=SNRmax,
549 549 xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True,
550 550 ticksize=9, cblabel='', cbsize="1%", colormap="jet")
551 551
552 552 self.draw()
553 553
554 554 self.save(figpath=figpath,
555 555 figfile=figfile,
556 556 save=save,
557 557 ftp=ftp,
558 558 wr_period=wr_period,
559 559 thisDatetime=thisDatetime,
560 560 update_figfile=update_figfile)
561 561
562 562 if dataOut.ltctime + dataOut.outputInterval >= self.xmax:
563 563 self.counter_imagwr = wr_period
564 564 self.isConfig = False
565 565 update_figfile = True
566 566
567 567
568 568 class ParametersPlot(Figure):
569 569
570 570 __isConfig = None
571 571 __nsubplots = None
572 572
573 573 WIDTHPROF = None
574 574 HEIGHTPROF = None
575 575 PREFIX = 'param'
576 576
577 577 nplots = None
578 578 nchan = None
579 579
580 580 def __init__(self, **kwargs):
581 581 Figure.__init__(self, **kwargs)
582 582 self.timerange = None
583 583 self.isConfig = False
584 584 self.__nsubplots = 1
585 585
586 586 self.WIDTH = 800
587 587 self.HEIGHT = 180
588 588 self.WIDTHPROF = 120
589 589 self.HEIGHTPROF = 0
590 590 self.counter_imagwr = 0
591 591
592 592 self.PLOT_CODE = RTI_CODE
593 593
594 594 self.FTP_WEI = None
595 595 self.EXP_CODE = None
596 596 self.SUB_EXP_CODE = None
597 597 self.PLOT_POS = None
598 598 self.tmin = None
599 599 self.tmax = None
600 600
601 601 self.xmin = None
602 602 self.xmax = None
603 603
604 604 self.figfile = None
605 605
606 606 def getSubplots(self):
607 607
608 608 ncol = 1
609 609 nrow = self.nplots
610 610
611 611 return nrow, ncol
612 612
613 613 def setup(self, id, nplots, wintitle, show=True):
614 614
615 615 self.nplots = nplots
616 616
617 617 ncolspan = 1
618 618 colspan = 1
619 619
620 620 self.createFigure(id = id,
621 621 wintitle = wintitle,
622 622 widthplot = self.WIDTH + self.WIDTHPROF,
623 623 heightplot = self.HEIGHT + self.HEIGHTPROF,
624 624 show=show)
625 625
626 626 nrow, ncol = self.getSubplots()
627 627
628 628 counter = 0
629 629 for y in range(nrow):
630 630 for x in range(ncol):
631 631
632 632 if counter >= self.nplots:
633 633 break
634 634
635 635 self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan, colspan, 1)
636 636
637 637 counter += 1
638 638
639 639 def run(self, dataOut, id, wintitle="", channelList=None, paramIndex = 0, colormap=True,
640 640 xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None, timerange=None,
641 641 showSNR=False, SNRthresh = -numpy.inf, SNRmin=None, SNRmax=None,
642 642 save=False, figpath='./', lastone=0,figfile=None, ftp=False, wr_period=1, show=True,
643 643 server=None, folder=None, username=None, password=None,
644 644 ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0):
645
646 645 """
647 646
648 647 Input:
649 648 dataOut :
650 649 id :
651 650 wintitle :
652 651 channelList :
653 652 showProfile :
654 653 xmin : None,
655 654 xmax : None,
656 655 ymin : None,
657 656 ymax : None,
658 657 zmin : None,
659 658 zmax : None
660 659 """
661 660
662 661 if colormap:
663 662 colormap="jet"
664 663 else:
665 664 colormap="RdBu_r"
666 665
667 666 if not isTimeInHourRange(dataOut.datatime, xmin, xmax):
668 667 return
669 668
670 669 if channelList == None:
671 670 channelIndexList = range(dataOut.data_param.shape[0])
672 671 else:
673 672 channelIndexList = []
674 673 for channel in channelList:
675 674 if channel not in dataOut.channelList:
676 675 raise ValueError, "Channel %d is not in dataOut.channelList"
677 676 channelIndexList.append(dataOut.channelList.index(channel))
678 677
679 678 x = dataOut.getTimeRange1(dataOut.paramInterval)
680 679 y = dataOut.getHeiRange()
681 680
682 681 if dataOut.data_param.ndim == 3:
683 682 z = dataOut.data_param[channelIndexList,paramIndex,:]
684 683 else:
685 684 z = dataOut.data_param[channelIndexList,:]
686 685
687 686 if showSNR:
688 687 #SNR data
689 688 SNRarray = dataOut.data_SNR[channelIndexList,:]
690 689 SNRdB = 10*numpy.log10(SNRarray)
691 690 ind = numpy.where(SNRdB < SNRthresh)
692 691 z[ind] = numpy.nan
693 692
694 693 thisDatetime = dataOut.datatime
695 694 # thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.getTimeRange()[0])
696 695 title = wintitle + " Parameters Plot" #: %s" %(thisDatetime.strftime("%d-%b-%Y"))
697 696 xlabel = ""
698 697 ylabel = "Range (Km)"
699 698
700 699 update_figfile = False
701 700
702 701 if not self.isConfig:
703 702
704 703 nchan = len(channelIndexList)
705 704 self.nchan = nchan
706 705 self.plotFact = 1
707 706 nplots = nchan
708 707
709 708 if showSNR:
710 709 nplots = nchan*2
711 710 self.plotFact = 2
712 711 if SNRmin == None: SNRmin = numpy.nanmin(SNRdB)
713 712 if SNRmax == None: SNRmax = numpy.nanmax(SNRdB)
714 713
715 714 self.setup(id=id,
716 715 nplots=nplots,
717 716 wintitle=wintitle,
718 717 show=show)
719 718
720 719 if timerange != None:
721 720 self.timerange = timerange
722 721
723 722 self.xmin, self.xmax = self.getTimeLim(x, xmin, xmax, timerange)
724 723
725 724 if ymin == None: ymin = numpy.nanmin(y)
726 725 if ymax == None: ymax = numpy.nanmax(y)
727 726 if zmin == None: zmin = numpy.nanmin(z)
728 727 if zmax == None: zmax = numpy.nanmax(z)
729 728
730 729 self.FTP_WEI = ftp_wei
731 730 self.EXP_CODE = exp_code
732 731 self.SUB_EXP_CODE = sub_exp_code
733 732 self.PLOT_POS = plot_pos
734 733
735 734 self.name = thisDatetime.strftime("%Y%m%d_%H%M%S")
736 735 self.isConfig = True
737 736 self.figfile = figfile
738 737 update_figfile = True
739 738
740 739 self.setWinTitle(title)
741 740
742 741 for i in range(self.nchan):
743 742 index = channelIndexList[i]
744 743 title = "Channel %d: %s" %(dataOut.channelList[index], thisDatetime.strftime("%Y/%m/%d %H:%M:%S"))
745 744 axes = self.axesList[i*self.plotFact]
746 745 z1 = z[i,:].reshape((1,-1))
747 746 axes.pcolorbuffer(x, y, z1,
748 747 xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=zmin, zmax=zmax,
749 748 xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True,
750 749 ticksize=9, cblabel='', cbsize="1%",colormap=colormap)
751 750
752 751 if showSNR:
753 752 title = "Channel %d SNR: %s" %(dataOut.channelList[index], thisDatetime.strftime("%Y/%m/%d %H:%M:%S"))
754 753 axes = self.axesList[i*self.plotFact + 1]
755 754 SNRdB1 = SNRdB[i,:].reshape((1,-1))
756 755 axes.pcolorbuffer(x, y, SNRdB1,
757 756 xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=SNRmin, zmax=SNRmax,
758 757 xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True,
759 758 ticksize=9, cblabel='', cbsize="1%",colormap='jet')
760 759
761 760
762 761 self.draw()
763 762
764 763 if dataOut.ltctime >= self.xmax:
765 764 self.counter_imagwr = wr_period
766 765 self.isConfig = False
767 766 update_figfile = True
768 767
769 768 self.save(figpath=figpath,
770 769 figfile=figfile,
771 770 save=save,
772 771 ftp=ftp,
773 772 wr_period=wr_period,
774 773 thisDatetime=thisDatetime,
775 774 update_figfile=update_figfile)
776 775
777 776
778 777
779 778 class Parameters1Plot(Figure):
780 779
781 780 __isConfig = None
782 781 __nsubplots = None
783 782
784 783 WIDTHPROF = None
785 784 HEIGHTPROF = None
786 785 PREFIX = 'prm'
787 786
788 787 def __init__(self, **kwargs):
789 788 Figure.__init__(self, **kwargs)
790 789 self.timerange = 2*60*60
791 790 self.isConfig = False
792 791 self.__nsubplots = 1
793 792
794 793 self.WIDTH = 800
795 self.HEIGHT = 150
794 self.HEIGHT = 180
796 795 self.WIDTHPROF = 120
797 796 self.HEIGHTPROF = 0
798 797 self.counter_imagwr = 0
799 798
800 799 self.PLOT_CODE = PARMS_CODE
801 800
802 801 self.FTP_WEI = None
803 802 self.EXP_CODE = None
804 803 self.SUB_EXP_CODE = None
805 804 self.PLOT_POS = None
806 805 self.tmin = None
807 806 self.tmax = None
808 807
809 808 self.xmin = None
810 809 self.xmax = None
811 810
812 811 self.figfile = None
813 812
814 813 def getSubplots(self):
815 814
816 815 ncol = 1
817 816 nrow = self.nplots
818 817
819 818 return nrow, ncol
820 819
821 820 def setup(self, id, nplots, wintitle, showprofile=True, show=True):
822 821
823 822 self.__showprofile = showprofile
824 823 self.nplots = nplots
825 824
826 825 ncolspan = 1
827 826 colspan = 1
828 827
829 828 self.createFigure(id = id,
830 829 wintitle = wintitle,
831 830 widthplot = self.WIDTH + self.WIDTHPROF,
832 831 heightplot = self.HEIGHT + self.HEIGHTPROF,
833 832 show=show)
834 833
835 834 nrow, ncol = self.getSubplots()
836 835
837 836 counter = 0
838 837 for y in range(nrow):
839 838 for x in range(ncol):
840 839
841 840 if counter >= self.nplots:
842 841 break
843 842
844 843 self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan, colspan, 1)
845 844
846 845 if showprofile:
847 846 self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan+colspan, 1, 1)
848 847
849 848 counter += 1
850 849
851 850 def run(self, dataOut, id, wintitle="", channelList=None, showprofile=False,
852 851 xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None,timerange=None,
853 852 parameterIndex = None, onlyPositive = False,
854 853 SNRthresh = -numpy.inf, SNR = True, SNRmin = None, SNRmax = None, onlySNR = False,
855 854 DOP = True,
856 855 zlabel = "", parameterName = "", parameterObject = "data_param",
857 856 save=False, figpath='./', lastone=0,figfile=None, ftp=False, wr_period=1, show=True,
858 857 server=None, folder=None, username=None, password=None,
859 858 ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0):
860
859 #print inspect.getargspec(self.run).args
861 860 """
862 861
863 862 Input:
864 863 dataOut :
865 864 id :
866 865 wintitle :
867 866 channelList :
868 867 showProfile :
869 868 xmin : None,
870 869 xmax : None,
871 870 ymin : None,
872 871 ymax : None,
873 872 zmin : None,
874 873 zmax : None
875 874 """
876 875
877 876 data_param = getattr(dataOut, parameterObject)
878 877
879 878 if channelList == None:
880 879 channelIndexList = numpy.arange(data_param.shape[0])
881 880 else:
882 881 channelIndexList = numpy.array(channelList)
883 882
884 883 nchan = len(channelIndexList) #Number of channels being plotted
885 884
886 885 if nchan < 1:
887 886 return
888 887
889 888 nGraphsByChannel = 0
890 889
891 890 if SNR:
892 891 nGraphsByChannel += 1
893 892 if DOP:
894 893 nGraphsByChannel += 1
895 894
896 895 if nGraphsByChannel < 1:
897 896 return
898 897
899 898 nplots = nGraphsByChannel*nchan
900 899
901 900 if timerange is not None:
902 901 self.timerange = timerange
903 902
904 903 #tmin = None
905 904 #tmax = None
906 905 if parameterIndex == None:
907 906 parameterIndex = 1
908 907
909 908 x = dataOut.getTimeRange1(dataOut.paramInterval)
910 909 y = dataOut.heightList
911 910 z = data_param[channelIndexList,parameterIndex,:].copy()
912 911
913 912 zRange = dataOut.abscissaList
914 913 # nChannels = z.shape[0] #Number of wind dimensions estimated
915 914 # thisDatetime = dataOut.datatime
916 915
917 916 if dataOut.data_SNR is not None:
918 917 SNRarray = dataOut.data_SNR[channelIndexList,:]
919 918 SNRdB = 10*numpy.log10(SNRarray)
920 919 # SNRavgdB = 10*numpy.log10(SNRavg)
921 920 ind = numpy.where(SNRdB < 10**(SNRthresh/10))
922 921 z[ind] = numpy.nan
923 922
924 923 thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.getTimeRange()[0])
925 924 title = wintitle + " Parameters Plot" #: %s" %(thisDatetime.strftime("%d-%b-%Y"))
926 925 xlabel = ""
927 926 ylabel = "Range (Km)"
928 927
929 928 if (SNR and not onlySNR): nplots = 2*nplots
930 929
931 930 if onlyPositive:
932 931 colormap = "jet"
933 932 zmin = 0
934 933 else: colormap = "RdBu_r"
935 934
936 935 if not self.isConfig:
937 936
938 937 self.setup(id=id,
939 938 nplots=nplots,
940 939 wintitle=wintitle,
941 940 showprofile=showprofile,
942 941 show=show)
943 942
944 943 self.xmin, self.xmax = self.getTimeLim(x, xmin, xmax, timerange)
945 944
946 945 if ymin == None: ymin = numpy.nanmin(y)
947 946 if ymax == None: ymax = numpy.nanmax(y)
948 947 if zmin == None: zmin = numpy.nanmin(zRange)
949 948 if zmax == None: zmax = numpy.nanmax(zRange)
950 949
951 950 if SNR:
952 951 if SNRmin == None: SNRmin = numpy.nanmin(SNRdB)
953 952 if SNRmax == None: SNRmax = numpy.nanmax(SNRdB)
954 953
955 954 self.FTP_WEI = ftp_wei
956 955 self.EXP_CODE = exp_code
957 956 self.SUB_EXP_CODE = sub_exp_code
958 957 self.PLOT_POS = plot_pos
959 958
960 959 self.name = thisDatetime.strftime("%Y%m%d_%H%M%S")
961 960 self.isConfig = True
962 961 self.figfile = figfile
963 962
964 963 self.setWinTitle(title)
965 964
966 965 if ((self.xmax - x[1]) < (x[1]-x[0])):
967 966 x[1] = self.xmax
968 967
969 968 for i in range(nchan):
970 969
971 970 if (SNR and not onlySNR): j = 2*i
972 971 else: j = i
973 972
974 973 j = nGraphsByChannel*i
975 974
976 975 if ((dataOut.azimuth!=None) and (dataOut.zenith!=None)):
977 976 title = title + '_' + 'azimuth,zenith=%2.2f,%2.2f'%(dataOut.azimuth, dataOut.zenith)
978 977
979 978 if not onlySNR:
980 979 axes = self.axesList[j*self.__nsubplots]
981 980 z1 = z[i,:].reshape((1,-1))
982 981 axes.pcolorbuffer(x, y, z1,
983 982 xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=zmin, zmax=zmax,
984 983 xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True,colormap=colormap,
985 984 ticksize=9, cblabel=zlabel, cbsize="1%")
986 985
987 986 if DOP:
988 987 title = "%s Channel %d: %s" %(parameterName, channelIndexList[i], thisDatetime.strftime("%Y/%m/%d %H:%M:%S"))
989 988
990 989 if ((dataOut.azimuth!=None) and (dataOut.zenith!=None)):
991 990 title = title + '_' + 'azimuth,zenith=%2.2f,%2.2f'%(dataOut.azimuth, dataOut.zenith)
992 991 axes = self.axesList[j]
993 992 z1 = z[i,:].reshape((1,-1))
994 993 axes.pcolorbuffer(x, y, z1,
995 994 xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=zmin, zmax=zmax,
996 995 xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True,colormap=colormap,
997 996 ticksize=9, cblabel=zlabel, cbsize="1%")
998 997
999 998 if SNR:
1000 999 title = "Channel %d Signal Noise Ratio (SNR): %s" %(channelIndexList[i], thisDatetime.strftime("%Y/%m/%d %H:%M:%S"))
1001 1000 axes = self.axesList[(j)*self.__nsubplots]
1002 1001 if not onlySNR:
1003 1002 axes = self.axesList[(j + 1)*self.__nsubplots]
1004 1003
1005 1004 axes = self.axesList[(j + nGraphsByChannel-1)]
1006 1005
1007 1006 z1 = SNRdB[i,:].reshape((1,-1))
1008 1007 axes.pcolorbuffer(x, y, z1,
1009 1008 xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=SNRmin, zmax=SNRmax,
1010 1009 xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True,colormap="jet",
1011 1010 ticksize=9, cblabel=zlabel, cbsize="1%")
1012 1011
1013 1012
1014 1013
1015 1014 self.draw()
1016 1015
1017 1016 if x[1] >= self.axesList[0].xmax:
1018 1017 self.counter_imagwr = wr_period
1019 1018 self.isConfig = False
1020 1019 self.figfile = None
1021 1020
1022 1021 self.save(figpath=figpath,
1023 1022 figfile=figfile,
1024 1023 save=save,
1025 1024 ftp=ftp,
1026 1025 wr_period=wr_period,
1027 1026 thisDatetime=thisDatetime,
1028 1027 update_figfile=False)
1029 1028
1030 1029 class SpectralFittingPlot(Figure):
1031 1030
1032 1031 __isConfig = None
1033 1032 __nsubplots = None
1034 1033
1035 1034 WIDTHPROF = None
1036 1035 HEIGHTPROF = None
1037 1036 PREFIX = 'prm'
1038 1037
1039 1038
1040 1039 N = None
1041 1040 ippSeconds = None
1042 1041
1043 1042 def __init__(self, **kwargs):
1044 1043 Figure.__init__(self, **kwargs)
1045 1044 self.isConfig = False
1046 1045 self.__nsubplots = 1
1047 1046
1048 1047 self.PLOT_CODE = SPECFIT_CODE
1049 1048
1050 1049 self.WIDTH = 450
1051 1050 self.HEIGHT = 250
1052 1051 self.WIDTHPROF = 0
1053 1052 self.HEIGHTPROF = 0
1054 1053
1055 1054 def getSubplots(self):
1056 1055
1057 1056 ncol = int(numpy.sqrt(self.nplots)+0.9)
1058 1057 nrow = int(self.nplots*1./ncol + 0.9)
1059 1058
1060 1059 return nrow, ncol
1061 1060
1062 1061 def setup(self, id, nplots, wintitle, showprofile=False, show=True):
1063 1062
1064 1063 showprofile = False
1065 1064 self.__showprofile = showprofile
1066 1065 self.nplots = nplots
1067 1066
1068 1067 ncolspan = 5
1069 1068 colspan = 4
1070 1069 if showprofile:
1071 1070 ncolspan = 5
1072 1071 colspan = 4
1073 1072 self.__nsubplots = 2
1074 1073
1075 1074 self.createFigure(id = id,
1076 1075 wintitle = wintitle,
1077 1076 widthplot = self.WIDTH + self.WIDTHPROF,
1078 1077 heightplot = self.HEIGHT + self.HEIGHTPROF,
1079 1078 show=show)
1080 1079
1081 1080 nrow, ncol = self.getSubplots()
1082 1081
1083 1082 counter = 0
1084 1083 for y in range(nrow):
1085 1084 for x in range(ncol):
1086 1085
1087 1086 if counter >= self.nplots:
1088 1087 break
1089 1088
1090 1089 self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan, colspan, 1)
1091 1090
1092 1091 if showprofile:
1093 1092 self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan+colspan, 1, 1)
1094 1093
1095 1094 counter += 1
1096 1095
1097 1096 def run(self, dataOut, id, cutHeight=None, fit=False, wintitle="", channelList=None, showprofile=True,
1098 1097 xmin=None, xmax=None, ymin=None, ymax=None,
1099 1098 save=False, figpath='./', figfile=None, show=True):
1100 1099
1101 1100 """
1102 1101
1103 1102 Input:
1104 1103 dataOut :
1105 1104 id :
1106 1105 wintitle :
1107 1106 channelList :
1108 1107 showProfile :
1109 1108 xmin : None,
1110 1109 xmax : None,
1111 1110 zmin : None,
1112 1111 zmax : None
1113 1112 """
1114 1113
1115 1114 if cutHeight==None:
1116 1115 h=270
1117 1116 heightindex = numpy.abs(cutHeight - dataOut.heightList).argmin()
1118 1117 cutHeight = dataOut.heightList[heightindex]
1119 1118
1120 1119 factor = dataOut.normFactor
1121 1120 x = dataOut.abscissaList[:-1]
1122 1121 #y = dataOut.getHeiRange()
1123 1122
1124 1123 z = dataOut.data_pre[:,:,heightindex]/factor
1125 1124 z = numpy.where(numpy.isfinite(z), z, numpy.NAN)
1126 1125 avg = numpy.average(z, axis=1)
1127 1126 listChannels = z.shape[0]
1128 1127
1129 1128 #Reconstruct Function
1130 1129 if fit==True:
1131 1130 groupArray = dataOut.groupList
1132 1131 listChannels = groupArray.reshape((groupArray.size))
1133 1132 listChannels.sort()
1134 1133 spcFitLine = numpy.zeros(z.shape)
1135 1134 constants = dataOut.constants
1136 1135
1137 1136 nGroups = groupArray.shape[0]
1138 1137 nChannels = groupArray.shape[1]
1139 1138 nProfiles = z.shape[1]
1140 1139
1141 1140 for f in range(nGroups):
1142 1141 groupChann = groupArray[f,:]
1143 1142 p = dataOut.data_param[f,:,heightindex]
1144 1143 # p = numpy.array([ 89.343967,0.14036615,0.17086219,18.89835291,1.58388365,1.55099167])
1145 1144 fitLineAux = dataOut.library.modelFunction(p, constants)*nProfiles
1146 1145 fitLineAux = fitLineAux.reshape((nChannels,nProfiles))
1147 1146 spcFitLine[groupChann,:] = fitLineAux
1148 1147 # spcFitLine = spcFitLine/factor
1149 1148
1150 1149 z = z[listChannels,:]
1151 1150 spcFitLine = spcFitLine[listChannels,:]
1152 1151 spcFitLinedB = 10*numpy.log10(spcFitLine)
1153 1152
1154 1153 zdB = 10*numpy.log10(z)
1155 1154 #thisDatetime = dataOut.datatime
1156 1155 thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.getTimeRange()[0])
1157 1156 title = wintitle + " Doppler Spectra: %s" %(thisDatetime.strftime("%d-%b-%Y %H:%M:%S"))
1158 1157 xlabel = "Velocity (m/s)"
1159 1158 ylabel = "Spectrum"
1160 1159
1161 1160 if not self.isConfig:
1162 1161
1163 1162 nplots = listChannels.size
1164 1163
1165 1164 self.setup(id=id,
1166 1165 nplots=nplots,
1167 1166 wintitle=wintitle,
1168 1167 showprofile=showprofile,
1169 1168 show=show)
1170 1169
1171 1170 if xmin == None: xmin = numpy.nanmin(x)
1172 1171 if xmax == None: xmax = numpy.nanmax(x)
1173 1172 if ymin == None: ymin = numpy.nanmin(zdB)
1174 1173 if ymax == None: ymax = numpy.nanmax(zdB)+2
1175 1174
1176 1175 self.isConfig = True
1177 1176
1178 1177 self.setWinTitle(title)
1179 1178 for i in range(self.nplots):
1180 1179 # title = "Channel %d: %4.2fdB" %(dataOut.channelList[i]+1, noisedB[i])
1181 1180 title = "Height %4.1f km\nChannel %d:" %(cutHeight, listChannels[i])
1182 1181 axes = self.axesList[i*self.__nsubplots]
1183 1182 if fit == False:
1184 1183 axes.pline(x, zdB[i,:],
1185 1184 xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax,
1186 1185 xlabel=xlabel, ylabel=ylabel, title=title
1187 1186 )
1188 1187 if fit == True:
1189 1188 fitline=spcFitLinedB[i,:]
1190 1189 y=numpy.vstack([zdB[i,:],fitline] )
1191 1190 legendlabels=['Data','Fitting']
1192 1191 axes.pmultilineyaxis(x, y,
1193 1192 xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax,
1194 1193 xlabel=xlabel, ylabel=ylabel, title=title,
1195 1194 legendlabels=legendlabels, marker=None,
1196 1195 linestyle='solid', grid='both')
1197 1196
1198 1197 self.draw()
1199 1198
1200 1199 self.save(figpath=figpath,
1201 1200 figfile=figfile,
1202 1201 save=save,
1203 1202 ftp=ftp,
1204 1203 wr_period=wr_period,
1205 1204 thisDatetime=thisDatetime)
1206 1205
1207 1206
1208 1207 class EWDriftsPlot(Figure):
1209 1208
1210 1209 __isConfig = None
1211 1210 __nsubplots = None
1212 1211
1213 1212 WIDTHPROF = None
1214 1213 HEIGHTPROF = None
1215 1214 PREFIX = 'drift'
1216 1215
1217 1216 def __init__(self, **kwargs):
1218 1217 Figure.__init__(self, **kwargs)
1219 1218 self.timerange = 2*60*60
1220 1219 self.isConfig = False
1221 1220 self.__nsubplots = 1
1222 1221
1223 1222 self.WIDTH = 800
1224 1223 self.HEIGHT = 150
1225 1224 self.WIDTHPROF = 120
1226 1225 self.HEIGHTPROF = 0
1227 1226 self.counter_imagwr = 0
1228 1227
1229 1228 self.PLOT_CODE = EWDRIFT_CODE
1230 1229
1231 1230 self.FTP_WEI = None
1232 1231 self.EXP_CODE = None
1233 1232 self.SUB_EXP_CODE = None
1234 1233 self.PLOT_POS = None
1235 1234 self.tmin = None
1236 1235 self.tmax = None
1237 1236
1238 1237 self.xmin = None
1239 1238 self.xmax = None
1240 1239
1241 1240 self.figfile = None
1242 1241
1243 1242 def getSubplots(self):
1244 1243
1245 1244 ncol = 1
1246 1245 nrow = self.nplots
1247 1246
1248 1247 return nrow, ncol
1249 1248
1250 1249 def setup(self, id, nplots, wintitle, showprofile=True, show=True):
1251 1250
1252 1251 self.__showprofile = showprofile
1253 1252 self.nplots = nplots
1254 1253
1255 1254 ncolspan = 1
1256 1255 colspan = 1
1257 1256
1258 1257 self.createFigure(id = id,
1259 1258 wintitle = wintitle,
1260 1259 widthplot = self.WIDTH + self.WIDTHPROF,
1261 1260 heightplot = self.HEIGHT + self.HEIGHTPROF,
1262 1261 show=show)
1263 1262
1264 1263 nrow, ncol = self.getSubplots()
1265 1264
1266 1265 counter = 0
1267 1266 for y in range(nrow):
1268 1267 if counter >= self.nplots:
1269 1268 break
1270 1269
1271 1270 self.addAxes(nrow, ncol*ncolspan, y, 0, colspan, 1)
1272 1271 counter += 1
1273 1272
1274 1273 def run(self, dataOut, id, wintitle="", channelList=None,
1275 1274 xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None,
1276 1275 zmaxVertical = None, zminVertical = None, zmaxZonal = None, zminZonal = None,
1277 1276 timerange=None, SNRthresh = -numpy.inf, SNRmin = None, SNRmax = None, SNR_1 = False,
1278 1277 save=False, figpath='./', lastone=0,figfile=None, ftp=False, wr_period=1, show=True,
1279 1278 server=None, folder=None, username=None, password=None,
1280 1279 ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0):
1281 1280 """
1282 1281
1283 1282 Input:
1284 1283 dataOut :
1285 1284 id :
1286 1285 wintitle :
1287 1286 channelList :
1288 1287 showProfile :
1289 1288 xmin : None,
1290 1289 xmax : None,
1291 1290 ymin : None,
1292 1291 ymax : None,
1293 1292 zmin : None,
1294 1293 zmax : None
1295 1294 """
1296 1295
1297 1296 if timerange is not None:
1298 1297 self.timerange = timerange
1299 1298
1300 1299 tmin = None
1301 1300 tmax = None
1302 1301
1303 1302 x = dataOut.getTimeRange1(dataOut.outputInterval)
1304 1303 # y = dataOut.heightList
1305 1304 y = dataOut.heightList
1306 1305
1307 1306 z = dataOut.data_output
1308 1307 nplots = z.shape[0] #Number of wind dimensions estimated
1309 1308 nplotsw = nplots
1310 1309
1311 1310 #If there is a SNR function defined
1312 1311 if dataOut.data_SNR is not None:
1313 1312 nplots += 1
1314 1313 SNR = dataOut.data_SNR
1315 1314
1316 1315 if SNR_1:
1317 1316 SNR += 1
1318 1317
1319 1318 SNRavg = numpy.average(SNR, axis=0)
1320 1319
1321 1320 SNRdB = 10*numpy.log10(SNR)
1322 1321 SNRavgdB = 10*numpy.log10(SNRavg)
1323 1322
1324 1323 ind = numpy.where(SNRavg < 10**(SNRthresh/10))[0]
1325 1324
1326 1325 for i in range(nplotsw):
1327 1326 z[i,ind] = numpy.nan
1328 1327
1329 1328
1330 1329 showprofile = False
1331 1330 # thisDatetime = dataOut.datatime
1332 1331 thisDatetime = datetime.datetime.utcfromtimestamp(x[1])
1333 1332 title = wintitle + " EW Drifts"
1334 1333 xlabel = ""
1335 1334 ylabel = "Height (Km)"
1336 1335
1337 1336 if not self.isConfig:
1338 1337
1339 1338 self.setup(id=id,
1340 1339 nplots=nplots,
1341 1340 wintitle=wintitle,
1342 1341 showprofile=showprofile,
1343 1342 show=show)
1344 1343
1345 1344 self.xmin, self.xmax = self.getTimeLim(x, xmin, xmax, timerange)
1346 1345
1347 1346 if ymin == None: ymin = numpy.nanmin(y)
1348 1347 if ymax == None: ymax = numpy.nanmax(y)
1349 1348
1350 1349 if zmaxZonal == None: zmaxZonal = numpy.nanmax(abs(z[0,:]))
1351 1350 if zminZonal == None: zminZonal = -zmaxZonal
1352 1351 if zmaxVertical == None: zmaxVertical = numpy.nanmax(abs(z[1,:]))
1353 1352 if zminVertical == None: zminVertical = -zmaxVertical
1354 1353
1355 1354 if dataOut.data_SNR is not None:
1356 1355 if SNRmin == None: SNRmin = numpy.nanmin(SNRavgdB)
1357 1356 if SNRmax == None: SNRmax = numpy.nanmax(SNRavgdB)
1358 1357
1359 1358 self.FTP_WEI = ftp_wei
1360 1359 self.EXP_CODE = exp_code
1361 1360 self.SUB_EXP_CODE = sub_exp_code
1362 1361 self.PLOT_POS = plot_pos
1363 1362
1364 1363 self.name = thisDatetime.strftime("%Y%m%d_%H%M%S")
1365 1364 self.isConfig = True
1366 1365
1367 1366
1368 1367 self.setWinTitle(title)
1369 1368
1370 1369 if ((self.xmax - x[1]) < (x[1]-x[0])):
1371 1370 x[1] = self.xmax
1372 1371
1373 1372 strWind = ['Zonal','Vertical']
1374 1373 strCb = 'Velocity (m/s)'
1375 1374 zmaxVector = [zmaxZonal, zmaxVertical]
1376 1375 zminVector = [zminZonal, zminVertical]
1377 1376
1378 1377 for i in range(nplotsw):
1379 1378
1380 1379 title = "%s Drifts: %s" %(strWind[i], thisDatetime.strftime("%Y/%m/%d %H:%M:%S"))
1381 1380 axes = self.axesList[i*self.__nsubplots]
1382 1381
1383 1382 z1 = z[i,:].reshape((1,-1))
1384 1383
1385 1384 axes.pcolorbuffer(x, y, z1,
1386 1385 xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=zminVector[i], zmax=zmaxVector[i],
1387 1386 xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True,
1388 1387 ticksize=9, cblabel=strCb, cbsize="1%", colormap="RdBu_r")
1389 1388
1390 1389 if dataOut.data_SNR is not None:
1391 1390 i += 1
1392 1391 if SNR_1:
1393 1392 title = "Signal Noise Ratio + 1 (SNR+1): %s" %(thisDatetime.strftime("%Y/%m/%d %H:%M:%S"))
1394 1393 else:
1395 1394 title = "Signal Noise Ratio (SNR): %s" %(thisDatetime.strftime("%Y/%m/%d %H:%M:%S"))
1396 1395 axes = self.axesList[i*self.__nsubplots]
1397 1396 SNRavgdB = SNRavgdB.reshape((1,-1))
1398 1397
1399 1398 axes.pcolorbuffer(x, y, SNRavgdB,
1400 1399 xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=SNRmin, zmax=SNRmax,
1401 1400 xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True,
1402 1401 ticksize=9, cblabel='', cbsize="1%", colormap="jet")
1403 1402
1404 1403 self.draw()
1405 1404
1406 1405 if x[1] >= self.axesList[0].xmax:
1407 1406 self.counter_imagwr = wr_period
1408 1407 self.isConfig = False
1409 1408 self.figfile = None
1410 1409
1411 1410
1412 1411
1413 1412
1414 1413 class PhasePlot(Figure):
1415 1414
1416 1415 __isConfig = None
1417 1416 __nsubplots = None
1418 1417
1419 1418 PREFIX = 'mphase'
1420 1419
1421 1420 def __init__(self, **kwargs):
1422 1421 Figure.__init__(self, **kwargs)
1423 1422 self.timerange = 24*60*60
1424 1423 self.isConfig = False
1425 1424 self.__nsubplots = 1
1426 1425 self.counter_imagwr = 0
1427 1426 self.WIDTH = 600
1428 1427 self.HEIGHT = 300
1429 1428 self.WIDTHPROF = 120
1430 1429 self.HEIGHTPROF = 0
1431 1430 self.xdata = None
1432 1431 self.ydata = None
1433 1432
1434 1433 self.PLOT_CODE = MPHASE_CODE
1435 1434
1436 1435 self.FTP_WEI = None
1437 1436 self.EXP_CODE = None
1438 1437 self.SUB_EXP_CODE = None
1439 1438 self.PLOT_POS = None
1440 1439
1441 1440
1442 1441 self.filename_phase = None
1443 1442
1444 1443 self.figfile = None
1445 1444
1446 1445 def getSubplots(self):
1447 1446
1448 1447 ncol = 1
1449 1448 nrow = 1
1450 1449
1451 1450 return nrow, ncol
1452 1451
1453 1452 def setup(self, id, nplots, wintitle, showprofile=True, show=True):
1454 1453
1455 1454 self.__showprofile = showprofile
1456 1455 self.nplots = nplots
1457 1456
1458 1457 ncolspan = 7
1459 1458 colspan = 6
1460 1459 self.__nsubplots = 2
1461 1460
1462 1461 self.createFigure(id = id,
1463 1462 wintitle = wintitle,
1464 1463 widthplot = self.WIDTH+self.WIDTHPROF,
1465 1464 heightplot = self.HEIGHT+self.HEIGHTPROF,
1466 1465 show=show)
1467 1466
1468 1467 nrow, ncol = self.getSubplots()
1469 1468
1470 1469 self.addAxes(nrow, ncol*ncolspan, 0, 0, colspan, 1)
1471 1470
1472 1471
1473 1472 def run(self, dataOut, id, wintitle="", pairsList=None, showprofile='True',
1474 1473 xmin=None, xmax=None, ymin=None, ymax=None,
1475 1474 timerange=None,
1476 1475 save=False, figpath='./', figfile=None, show=True, ftp=False, wr_period=1,
1477 1476 server=None, folder=None, username=None, password=None,
1478 1477 ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0):
1479 1478
1480 1479
1481 1480 tmin = None
1482 1481 tmax = None
1483 1482 x = dataOut.getTimeRange1(dataOut.outputInterval)
1484 1483 y = dataOut.getHeiRange()
1485 1484
1486 1485
1487 1486 #thisDatetime = dataOut.datatime
1488 1487 thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.ltctime)
1489 1488 title = wintitle + " Phase of Beacon Signal" # : %s" %(thisDatetime.strftime("%d-%b-%Y"))
1490 1489 xlabel = "Local Time"
1491 1490 ylabel = "Phase"
1492 1491
1493 1492
1494 1493 #phase = numpy.zeros((len(pairsIndexList),len(dataOut.beacon_heiIndexList)))
1495 1494 phase_beacon = dataOut.data_output
1496 1495 update_figfile = False
1497 1496
1498 1497 if not self.isConfig:
1499 1498
1500 1499 self.nplots = phase_beacon.size
1501 1500
1502 1501 self.setup(id=id,
1503 1502 nplots=self.nplots,
1504 1503 wintitle=wintitle,
1505 1504 showprofile=showprofile,
1506 1505 show=show)
1507 1506
1508 1507 if timerange is not None:
1509 1508 self.timerange = timerange
1510 1509
1511 1510 self.xmin, self.xmax = self.getTimeLim(x, xmin, xmax, timerange)
1512 1511
1513 1512 if ymin == None: ymin = numpy.nanmin(phase_beacon) - 10.0
1514 1513 if ymax == None: ymax = numpy.nanmax(phase_beacon) + 10.0
1515 1514
1516 1515 self.FTP_WEI = ftp_wei
1517 1516 self.EXP_CODE = exp_code
1518 1517 self.SUB_EXP_CODE = sub_exp_code
1519 1518 self.PLOT_POS = plot_pos
1520 1519
1521 1520 self.name = thisDatetime.strftime("%Y%m%d_%H%M%S")
1522 1521 self.isConfig = True
1523 1522 self.figfile = figfile
1524 1523 self.xdata = numpy.array([])
1525 1524 self.ydata = numpy.array([])
1526 1525
1527 1526 #open file beacon phase
1528 1527 path = '%s%03d' %(self.PREFIX, self.id)
1529 1528 beacon_file = os.path.join(path,'%s.txt'%self.name)
1530 1529 self.filename_phase = os.path.join(figpath,beacon_file)
1531 1530 update_figfile = True
1532 1531
1533 1532
1534 1533 #store data beacon phase
1535 1534 #self.save_data(self.filename_phase, phase_beacon, thisDatetime)
1536 1535
1537 1536 self.setWinTitle(title)
1538 1537
1539 1538
1540 1539 title = "Phase Offset %s" %(thisDatetime.strftime("%Y/%m/%d %H:%M:%S"))
1541 1540
1542 1541 legendlabels = ["phase %d"%(chan) for chan in numpy.arange(self.nplots)]
1543 1542
1544 1543 axes = self.axesList[0]
1545 1544
1546 1545 self.xdata = numpy.hstack((self.xdata, x[0:1]))
1547 1546
1548 1547 if len(self.ydata)==0:
1549 1548 self.ydata = phase_beacon.reshape(-1,1)
1550 1549 else:
1551 1550 self.ydata = numpy.hstack((self.ydata, phase_beacon.reshape(-1,1)))
1552 1551
1553 1552
1554 1553 axes.pmultilineyaxis(x=self.xdata, y=self.ydata,
1555 1554 xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax,
1556 1555 xlabel=xlabel, ylabel=ylabel, title=title, legendlabels=legendlabels, marker='x', markersize=8, linestyle="solid",
1557 1556 XAxisAsTime=True, grid='both'
1558 1557 )
1559 1558
1560 1559 self.draw()
1561 1560
1562 1561 self.save(figpath=figpath,
1563 1562 figfile=figfile,
1564 1563 save=save,
1565 1564 ftp=ftp,
1566 1565 wr_period=wr_period,
1567 1566 thisDatetime=thisDatetime,
1568 1567 update_figfile=update_figfile)
1569 1568
1570 1569 if dataOut.ltctime + dataOut.outputInterval >= self.xmax:
1571 1570 self.counter_imagwr = wr_period
1572 1571 self.isConfig = False
1573 1572 update_figfile = True
1574 1573
1575 1574
1576 1575
1577 1576 class NSMeteorDetection1Plot(Figure):
1578 1577
1579 1578 isConfig = None
1580 1579 __nsubplots = None
1581 1580
1582 1581 WIDTHPROF = None
1583 1582 HEIGHTPROF = None
1584 1583 PREFIX = 'nsm'
1585 1584
1586 1585 zminList = None
1587 1586 zmaxList = None
1588 1587 cmapList = None
1589 1588 titleList = None
1590 1589 nPairs = None
1591 1590 nChannels = None
1592 1591 nParam = None
1593 1592
1594 1593 def __init__(self, **kwargs):
1595 1594 Figure.__init__(self, **kwargs)
1596 1595 self.isConfig = False
1597 1596 self.__nsubplots = 1
1598 1597
1599 1598 self.WIDTH = 750
1600 1599 self.HEIGHT = 250
1601 1600 self.WIDTHPROF = 120
1602 1601 self.HEIGHTPROF = 0
1603 1602 self.counter_imagwr = 0
1604 1603
1605 1604 self.PLOT_CODE = SPEC_CODE
1606 1605
1607 1606 self.FTP_WEI = None
1608 1607 self.EXP_CODE = None
1609 1608 self.SUB_EXP_CODE = None
1610 1609 self.PLOT_POS = None
1611 1610
1612 1611 self.__xfilter_ena = False
1613 1612 self.__yfilter_ena = False
1614 1613
1615 1614 def getSubplots(self):
1616 1615
1617 1616 ncol = 3
1618 1617 nrow = int(numpy.ceil(self.nplots/3.0))
1619 1618
1620 1619 return nrow, ncol
1621 1620
1622 1621 def setup(self, id, nplots, wintitle, show=True):
1623 1622
1624 1623 self.nplots = nplots
1625 1624
1626 1625 ncolspan = 1
1627 1626 colspan = 1
1628 1627
1629 1628 self.createFigure(id = id,
1630 1629 wintitle = wintitle,
1631 1630 widthplot = self.WIDTH + self.WIDTHPROF,
1632 1631 heightplot = self.HEIGHT + self.HEIGHTPROF,
1633 1632 show=show)
1634 1633
1635 1634 nrow, ncol = self.getSubplots()
1636 1635
1637 1636 counter = 0
1638 1637 for y in range(nrow):
1639 1638 for x in range(ncol):
1640 1639
1641 1640 if counter >= self.nplots:
1642 1641 break
1643 1642
1644 1643 self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan, colspan, 1)
1645 1644
1646 1645 counter += 1
1647 1646
1648 1647 def run(self, dataOut, id, wintitle="", channelList=None, showprofile=True,
1649 1648 xmin=None, xmax=None, ymin=None, ymax=None, SNRmin=None, SNRmax=None,
1650 1649 vmin=None, vmax=None, wmin=None, wmax=None, mode = 'SA',
1651 1650 save=False, figpath='./', figfile=None, show=True, ftp=False, wr_period=1,
1652 1651 server=None, folder=None, username=None, password=None,
1653 1652 ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0, realtime=False,
1654 1653 xaxis="frequency"):
1655 1654
1656 1655 """
1657 1656
1658 1657 Input:
1659 1658 dataOut :
1660 1659 id :
1661 1660 wintitle :
1662 1661 channelList :
1663 1662 showProfile :
1664 1663 xmin : None,
1665 1664 xmax : None,
1666 1665 ymin : None,
1667 1666 ymax : None,
1668 1667 zmin : None,
1669 1668 zmax : None
1670 1669 """
1671 1670 #SEPARAR EN DOS PLOTS
1672 1671 nParam = dataOut.data_param.shape[1] - 3
1673 1672
1674 1673 utctime = dataOut.data_param[0,0]
1675 1674 tmet = dataOut.data_param[:,1].astype(int)
1676 1675 hmet = dataOut.data_param[:,2].astype(int)
1677 1676
1678 1677 x = dataOut.abscissaList
1679 1678 y = dataOut.heightList
1680 1679
1681 1680 z = numpy.zeros((nParam, y.size, x.size - 1))
1682 1681 z[:,:] = numpy.nan
1683 1682 z[:,hmet,tmet] = dataOut.data_param[:,3:].T
1684 1683 z[0,:,:] = 10*numpy.log10(z[0,:,:])
1685 1684
1686 1685 xlabel = "Time (s)"
1687 1686 ylabel = "Range (km)"
1688 1687
1689 1688 thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.ltctime)
1690 1689
1691 1690 if not self.isConfig:
1692 1691
1693 1692 nplots = nParam
1694 1693
1695 1694 self.setup(id=id,
1696 1695 nplots=nplots,
1697 1696 wintitle=wintitle,
1698 1697 show=show)
1699 1698
1700 1699 if xmin is None: xmin = numpy.nanmin(x)
1701 1700 if xmax is None: xmax = numpy.nanmax(x)
1702 1701 if ymin is None: ymin = numpy.nanmin(y)
1703 1702 if ymax is None: ymax = numpy.nanmax(y)
1704 1703 if SNRmin is None: SNRmin = numpy.nanmin(z[0,:])
1705 1704 if SNRmax is None: SNRmax = numpy.nanmax(z[0,:])
1706 1705 if vmax is None: vmax = numpy.nanmax(numpy.abs(z[1,:]))
1707 1706 if vmin is None: vmin = -vmax
1708 1707 if wmin is None: wmin = 0
1709 1708 if wmax is None: wmax = 50
1710 1709
1711 1710 pairsList = dataOut.groupList
1712 1711 self.nPairs = len(dataOut.groupList)
1713 1712
1714 1713 zminList = [SNRmin, vmin, cmin] + [pmin]*self.nPairs
1715 1714 zmaxList = [SNRmax, vmax, cmax] + [pmax]*self.nPairs
1716 1715 titleList = ["SNR","Radial Velocity","Coherence"]
1717 1716 cmapList = ["jet","RdBu_r","jet"]
1718 1717
1719 1718 for i in range(self.nPairs):
1720 1719 strAux1 = "Phase Difference "+ str(pairsList[i][0]) + str(pairsList[i][1])
1721 1720 titleList = titleList + [strAux1]
1722 1721 cmapList = cmapList + ["RdBu_r"]
1723 1722
1724 1723 self.zminList = zminList
1725 1724 self.zmaxList = zmaxList
1726 1725 self.cmapList = cmapList
1727 1726 self.titleList = titleList
1728 1727
1729 1728 self.FTP_WEI = ftp_wei
1730 1729 self.EXP_CODE = exp_code
1731 1730 self.SUB_EXP_CODE = sub_exp_code
1732 1731 self.PLOT_POS = plot_pos
1733 1732
1734 1733 self.isConfig = True
1735 1734
1736 1735 str_datetime = '%s %s'%(thisDatetime.strftime("%Y/%m/%d"),thisDatetime.strftime("%H:%M:%S"))
1737 1736
1738 1737 for i in range(nParam):
1739 1738 title = self.titleList[i] + ": " +str_datetime
1740 1739 axes = self.axesList[i]
1741 1740 axes.pcolor(x, y, z[i,:].T,
1742 1741 xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, zmin=self.zminList[i], zmax=self.zmaxList[i],
1743 1742 xlabel=xlabel, ylabel=ylabel, title=title, colormap=self.cmapList[i],ticksize=9, cblabel='')
1744 1743 self.draw()
1745 1744
1746 1745 if figfile == None:
1747 1746 str_datetime = thisDatetime.strftime("%Y%m%d_%H%M%S")
1748 1747 name = str_datetime
1749 1748 if ((dataOut.azimuth!=None) and (dataOut.zenith!=None)):
1750 1749 name = name + '_az' + '_%2.2f'%(dataOut.azimuth) + '_zn' + '_%2.2f'%(dataOut.zenith)
1751 1750 figfile = self.getFilename(name)
1752 1751
1753 1752 self.save(figpath=figpath,
1754 1753 figfile=figfile,
1755 1754 save=save,
1756 1755 ftp=ftp,
1757 1756 wr_period=wr_period,
1758 1757 thisDatetime=thisDatetime)
1759 1758
1760 1759
1761 1760 class NSMeteorDetection2Plot(Figure):
1762 1761
1763 1762 isConfig = None
1764 1763 __nsubplots = None
1765 1764
1766 1765 WIDTHPROF = None
1767 1766 HEIGHTPROF = None
1768 1767 PREFIX = 'nsm'
1769 1768
1770 1769 zminList = None
1771 1770 zmaxList = None
1772 1771 cmapList = None
1773 1772 titleList = None
1774 1773 nPairs = None
1775 1774 nChannels = None
1776 1775 nParam = None
1777 1776
1778 1777 def __init__(self, **kwargs):
1779 1778 Figure.__init__(self, **kwargs)
1780 1779 self.isConfig = False
1781 1780 self.__nsubplots = 1
1782 1781
1783 1782 self.WIDTH = 750
1784 1783 self.HEIGHT = 250
1785 1784 self.WIDTHPROF = 120
1786 1785 self.HEIGHTPROF = 0
1787 1786 self.counter_imagwr = 0
1788 1787
1789 1788 self.PLOT_CODE = SPEC_CODE
1790 1789
1791 1790 self.FTP_WEI = None
1792 1791 self.EXP_CODE = None
1793 1792 self.SUB_EXP_CODE = None
1794 1793 self.PLOT_POS = None
1795 1794
1796 1795 self.__xfilter_ena = False
1797 1796 self.__yfilter_ena = False
1798 1797
1799 1798 def getSubplots(self):
1800 1799
1801 1800 ncol = 3
1802 1801 nrow = int(numpy.ceil(self.nplots/3.0))
1803 1802
1804 1803 return nrow, ncol
1805 1804
1806 1805 def setup(self, id, nplots, wintitle, show=True):
1807 1806
1808 1807 self.nplots = nplots
1809 1808
1810 1809 ncolspan = 1
1811 1810 colspan = 1
1812 1811
1813 1812 self.createFigure(id = id,
1814 1813 wintitle = wintitle,
1815 1814 widthplot = self.WIDTH + self.WIDTHPROF,
1816 1815 heightplot = self.HEIGHT + self.HEIGHTPROF,
1817 1816 show=show)
1818 1817
1819 1818 nrow, ncol = self.getSubplots()
1820 1819
1821 1820 counter = 0
1822 1821 for y in range(nrow):
1823 1822 for x in range(ncol):
1824 1823
1825 1824 if counter >= self.nplots:
1826 1825 break
1827 1826
1828 1827 self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan, colspan, 1)
1829 1828
1830 1829 counter += 1
1831 1830
1832 1831 def run(self, dataOut, id, wintitle="", channelList=None, showprofile=True,
1833 1832 xmin=None, xmax=None, ymin=None, ymax=None, SNRmin=None, SNRmax=None,
1834 1833 vmin=None, vmax=None, wmin=None, wmax=None, mode = 'SA',
1835 1834 save=False, figpath='./', figfile=None, show=True, ftp=False, wr_period=1,
1836 1835 server=None, folder=None, username=None, password=None,
1837 1836 ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0, realtime=False,
1838 1837 xaxis="frequency"):
1839 1838
1840 1839 """
1841 1840
1842 1841 Input:
1843 1842 dataOut :
1844 1843 id :
1845 1844 wintitle :
1846 1845 channelList :
1847 1846 showProfile :
1848 1847 xmin : None,
1849 1848 xmax : None,
1850 1849 ymin : None,
1851 1850 ymax : None,
1852 1851 zmin : None,
1853 1852 zmax : None
1854 1853 """
1855 1854 #Rebuild matrix
1856 1855 utctime = dataOut.data_param[0,0]
1857 1856 cmet = dataOut.data_param[:,1].astype(int)
1858 1857 tmet = dataOut.data_param[:,2].astype(int)
1859 1858 hmet = dataOut.data_param[:,3].astype(int)
1860 1859
1861 1860 nParam = 3
1862 1861 nChan = len(dataOut.groupList)
1863 1862 x = dataOut.abscissaList
1864 1863 y = dataOut.heightList
1865 1864
1866 1865 z = numpy.full((nChan, nParam, y.size, x.size - 1),numpy.nan)
1867 1866 z[cmet,:,hmet,tmet] = dataOut.data_param[:,4:]
1868 1867 z[:,0,:,:] = 10*numpy.log10(z[:,0,:,:]) #logarithmic scale
1869 1868 z = numpy.reshape(z, (nChan*nParam, y.size, x.size-1))
1870 1869
1871 1870 xlabel = "Time (s)"
1872 1871 ylabel = "Range (km)"
1873 1872
1874 1873 thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.ltctime)
1875 1874
1876 1875 if not self.isConfig:
1877 1876
1878 1877 nplots = nParam*nChan
1879 1878
1880 1879 self.setup(id=id,
1881 1880 nplots=nplots,
1882 1881 wintitle=wintitle,
1883 1882 show=show)
1884 1883
1885 1884 if xmin is None: xmin = numpy.nanmin(x)
1886 1885 if xmax is None: xmax = numpy.nanmax(x)
1887 1886 if ymin is None: ymin = numpy.nanmin(y)
1888 1887 if ymax is None: ymax = numpy.nanmax(y)
1889 1888 if SNRmin is None: SNRmin = numpy.nanmin(z[0,:])
1890 1889 if SNRmax is None: SNRmax = numpy.nanmax(z[0,:])
1891 1890 if vmax is None: vmax = numpy.nanmax(numpy.abs(z[1,:]))
1892 1891 if vmin is None: vmin = -vmax
1893 1892 if wmin is None: wmin = 0
1894 1893 if wmax is None: wmax = 50
1895 1894
1896 1895 self.nChannels = nChan
1897 1896
1898 1897 zminList = []
1899 1898 zmaxList = []
1900 1899 titleList = []
1901 1900 cmapList = []
1902 1901 for i in range(self.nChannels):
1903 1902 strAux1 = "SNR Channel "+ str(i)
1904 1903 strAux2 = "Radial Velocity Channel "+ str(i)
1905 1904 strAux3 = "Spectral Width Channel "+ str(i)
1906 1905
1907 1906 titleList = titleList + [strAux1,strAux2,strAux3]
1908 1907 cmapList = cmapList + ["jet","RdBu_r","jet"]
1909 1908 zminList = zminList + [SNRmin,vmin,wmin]
1910 1909 zmaxList = zmaxList + [SNRmax,vmax,wmax]
1911 1910
1912 1911 self.zminList = zminList
1913 1912 self.zmaxList = zmaxList
1914 1913 self.cmapList = cmapList
1915 1914 self.titleList = titleList
1916 1915
1917 1916 self.FTP_WEI = ftp_wei
1918 1917 self.EXP_CODE = exp_code
1919 1918 self.SUB_EXP_CODE = sub_exp_code
1920 1919 self.PLOT_POS = plot_pos
1921 1920
1922 1921 self.isConfig = True
1923 1922
1924 1923 str_datetime = '%s %s'%(thisDatetime.strftime("%Y/%m/%d"),thisDatetime.strftime("%H:%M:%S"))
1925 1924
1926 1925 for i in range(self.nplots):
1927 1926 title = self.titleList[i] + ": " +str_datetime
1928 1927 axes = self.axesList[i]
1929 1928 axes.pcolor(x, y, z[i,:].T,
1930 1929 xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, zmin=self.zminList[i], zmax=self.zmaxList[i],
1931 1930 xlabel=xlabel, ylabel=ylabel, title=title, colormap=self.cmapList[i],ticksize=9, cblabel='')
1932 1931 self.draw()
1933 1932
1934 1933 if figfile == None:
1935 1934 str_datetime = thisDatetime.strftime("%Y%m%d_%H%M%S")
1936 1935 name = str_datetime
1937 1936 if ((dataOut.azimuth!=None) and (dataOut.zenith!=None)):
1938 1937 name = name + '_az' + '_%2.2f'%(dataOut.azimuth) + '_zn' + '_%2.2f'%(dataOut.zenith)
1939 1938 figfile = self.getFilename(name)
1940 1939
1941 1940 self.save(figpath=figpath,
1942 1941 figfile=figfile,
1943 1942 save=save,
1944 1943 ftp=ftp,
1945 1944 wr_period=wr_period,
1946 1945 thisDatetime=thisDatetime)
@@ -1,315 +1,347
1 1 '''
2 2
3 3 $Author: murco $
4 4 $Id: jroproc_base.py 1 2012-11-12 18:56:07Z murco $
5 5 '''
6 import inspect
7 from fuzzywuzzy import process
8
9 def checkKwargs(method, kwargs):
10 currentKwargs = kwargs
11 choices = inspect.getargspec(method).args
12 try:
13 choices.remove('self')
14 except Exception as e:
15 pass
16
17 try:
18 choices.remove('dataOut')
19 except Exception as e:
20 pass
21
22 for kwarg in kwargs:
23 fuzz = process.extractOne(kwarg, choices)
24 print fuzz
25 if fuzz is None:
26 continue
27 if fuzz[1] < 100:
28 raise Exception('\x1b[2;30;43mDid you mean {} instead of {} in {}? \x1b[0m'.
29 format(fuzz[0], kwarg, method.__self__.__class__.__name__))
6 30
7 31 class ProcessingUnit(object):
8 32
9 33 """
10 34 Esta es la clase base para el procesamiento de datos.
11 35
12 36 Contiene el metodo "call" para llamar operaciones. Las operaciones pueden ser:
13 37 - Metodos internos (callMethod)
14 38 - Objetos del tipo Operation (callObject). Antes de ser llamados, estos objetos
15 39 tienen que ser agreagados con el metodo "add".
16 40
17 41 """
18 42 # objeto de datos de entrada (Voltage, Spectra o Correlation)
19 43 dataIn = None
20 44 dataInList = []
21 45
22 46 # objeto de datos de entrada (Voltage, Spectra o Correlation)
23 47 dataOut = None
24 48
25 49 operations2RunDict = None
26 50
27 51 isConfig = False
28 52
29 53
30 54 def __init__(self, *args, **kwargs):
31 55
32 56 self.dataIn = None
33 57 self.dataInList = []
34 58
35 59 self.dataOut = None
36 60
37 61 self.operations2RunDict = {}
38 62 self.operationKwargs = {}
39 63
40 64 self.isConfig = False
41 65
42 66 self.args = args
43 67 self.kwargs = kwargs
68 checkKwargs(self.run, kwargs)
69
70 def getAllowedArgs(self):
71 return inspect.getargspec(self.run).args
44 72
45 73 def addOperationKwargs(self, objId, **kwargs):
46 74 '''
47 75 '''
48 76
49 77 self.operationKwargs[objId] = kwargs
50 78
51 79
52 80 def addOperation(self, opObj, objId):
53 81
54 82 """
55 83 Agrega un objeto del tipo "Operation" (opObj) a la lista de objetos "self.objectList" y retorna el
56 84 identificador asociado a este objeto.
57 85
58 86 Input:
59 87
60 88 object : objeto de la clase "Operation"
61 89
62 90 Return:
63 91
64 92 objId : identificador del objeto, necesario para ejecutar la operacion
65 93 """
66 94
67 95 self.operations2RunDict[objId] = opObj
68 96
69 97 return objId
70 98
71 99 def getOperationObj(self, objId):
72 100
73 101 if objId not in self.operations2RunDict.keys():
74 102 return None
75 103
76 104 return self.operations2RunDict[objId]
77 105
78 106 def operation(self, **kwargs):
79 107
80 108 """
81 109 Operacion directa sobre la data (dataOut.data). Es necesario actualizar los valores de los
82 110 atributos del objeto dataOut
83 111
84 112 Input:
85 113
86 114 **kwargs : Diccionario de argumentos de la funcion a ejecutar
87 115 """
88 116
89 117 raise NotImplementedError
90 118
91 119 def callMethod(self, name, opId):
92 120
93 121 """
94 122 Ejecuta el metodo con el nombre "name" y con argumentos **kwargs de la propia clase.
95 123
96 124 Input:
97 125 name : nombre del metodo a ejecutar
98 126
99 127 **kwargs : diccionario con los nombres y valores de la funcion a ejecutar.
100 128
101 129 """
102 130
103 131 #Checking the inputs
104 132 if name == 'run':
105 133
106 134 if not self.checkInputs():
107 135 self.dataOut.flagNoData = True
108 136 return False
109 137 else:
110 138 #Si no es un metodo RUN la entrada es la misma dataOut (interna)
111 139 if self.dataOut is not None and self.dataOut.isEmpty():
112 140 return False
113 141
114 142 #Getting the pointer to method
115 143 methodToCall = getattr(self, name)
116 144
117 145 #Executing the self method
118 146
119 147 if hasattr(self, 'mp'):
120 148 if name=='run':
121 149 if self.mp is False:
122 150 self.mp = True
123 151 self.start()
124 152 else:
125 153 methodToCall(**self.operationKwargs[opId])
126 154 else:
127 155 if name=='run':
128 156 methodToCall(**self.kwargs)
129 157 else:
130 158 methodToCall(**self.operationKwargs[opId])
131 159
132 160 if self.dataOut is None:
133 161 return False
134 162
135 163 if self.dataOut.isEmpty():
136 164 return False
137 165
138 166 return True
139 167
140 168 def callObject(self, objId):
141 169
142 170 """
143 171 Ejecuta la operacion asociada al identificador del objeto "objId"
144 172
145 173 Input:
146 174
147 175 objId : identificador del objeto a ejecutar
148 176
149 177 **kwargs : diccionario con los nombres y valores de la funcion a ejecutar.
150 178
151 179 Return:
152 180
153 181 None
154 182 """
155 183
156 184 if self.dataOut is not None and self.dataOut.isEmpty():
157 185 return False
158 186
159 187 externalProcObj = self.operations2RunDict[objId]
160 188
161 189 if hasattr(externalProcObj, 'mp'):
162 190 if externalProcObj.mp is False:
163 191 self.operationKwargs[objId] = externalProcObj.kwargs
164 192 externalProcObj.mp = True
165 193 externalProcObj.start()
166 194 else:
167 195 externalProcObj.run(self.dataOut, **externalProcObj.kwargs)
168 196 self.operationKwargs[objId] = externalProcObj.kwargs
169 197
170 198 return True
171 199
172 200 def call(self, opType, opName=None, opId=None):
173 201
174 202 """
175 203 Return True si ejecuta la operacion interna nombrada "opName" o la operacion externa
176 204 identificada con el id "opId"; con los argumentos "**kwargs".
177 205
178 206 False si la operacion no se ha ejecutado.
179 207
180 208 Input:
181 209
182 210 opType : Puede ser "self" o "external"
183 211
184 212 Depende del tipo de operacion para llamar a:callMethod or callObject:
185 213
186 214 1. If opType = "self": Llama a un metodo propio de esta clase:
187 215
188 216 name_method = getattr(self, name)
189 217 name_method(**kwargs)
190 218
191 219
192 220 2. If opType = "other" o"external": Llama al metodo "run()" de una instancia de la
193 221 clase "Operation" o de un derivado de ella:
194 222
195 223 instanceName = self.operationList[opId]
196 224 instanceName.run(**kwargs)
197 225
198 226 opName : Si la operacion es interna (opType = 'self'), entonces el "opName" sera
199 227 usada para llamar a un metodo interno de la clase Processing
200 228
201 229 opId : Si la operacion es externa (opType = 'other' o 'external), entonces el
202 230 "opId" sera usada para llamar al metodo "run" de la clase Operation
203 231 registrada anteriormente con ese Id
204 232
205 233 Exception:
206 234 Este objeto de tipo Operation debe de haber sido agregado antes con el metodo:
207 235 "addOperation" e identificado con el valor "opId" = el id de la operacion.
208 236 De lo contrario retornara un error del tipo ValueError
209 237
210 238 """
211 239
212 240 if opType == 'self':
213 241
214 242 if not opName:
215 243 raise ValueError, "opName parameter should be defined"
216 244
217 245 sts = self.callMethod(opName, opId)
218 246
219 247 elif opType == 'other' or opType == 'external' or opType == 'plotter':
220 248
221 249 if not opId:
222 250 raise ValueError, "opId parameter should be defined"
223 251
224 252 if opId not in self.operations2RunDict.keys():
225 253 raise ValueError, "Any operation with id=%s has been added" %str(opId)
226 254
227 255 sts = self.callObject(opId)
228 256
229 257 else:
230 258 raise ValueError, "opType should be 'self', 'external' or 'plotter'; and not '%s'" %opType
231 259
232 260 return sts
233 261
234 262 def setInput(self, dataIn):
235 263
236 264 self.dataIn = dataIn
237 265 self.dataInList.append(dataIn)
238 266
239 267 def getOutputObj(self):
240 268
241 269 return self.dataOut
242 270
243 271 def checkInputs(self):
244 272
245 273 for thisDataIn in self.dataInList:
246 274
247 275 if thisDataIn.isEmpty():
248 276 return False
249 277
250 278 return True
251 279
252 280 def setup(self):
253 281
254 282 raise NotImplementedError
255 283
256 284 def run(self):
257 285
258 286 raise NotImplementedError
259 287
260 288 def close(self):
261 289 #Close every thread, queue or any other object here is it is neccesary.
262 290 return
263 291
264 292 class Operation(object):
265 293
266 294 """
267 295 Clase base para definir las operaciones adicionales que se pueden agregar a la clase ProcessingUnit
268 296 y necesiten acumular informacion previa de los datos a procesar. De preferencia usar un buffer de
269 297 acumulacion dentro de esta clase
270 298
271 299 Ejemplo: Integraciones coherentes, necesita la informacion previa de los n perfiles anteriores (bufffer)
272 300
273 301 """
274 302
275 303 __buffer = None
276 304 isConfig = False
277 305
278 306 def __init__(self, **kwargs):
279 307
280 308 self.__buffer = None
281 309 self.isConfig = False
282 310 self.kwargs = kwargs
311 checkKwargs(self.run, kwargs)
312
313 def getAllowedArgs(self):
314 return inspect.getargspec(self.run).args
283 315
284 316 def setup(self):
285 317
286 318 self.isConfig = True
287 319
288 320 raise NotImplementedError
289 321
290 322 def run(self, dataIn, **kwargs):
291 323
292 324 """
293 325 Realiza las operaciones necesarias sobre la dataIn.data y actualiza los
294 326 atributos del objeto dataIn.
295 327
296 328 Input:
297 329
298 330 dataIn : objeto del tipo JROData
299 331
300 332 Return:
301 333
302 334 None
303 335
304 336 Affected:
305 337 __buffer : buffer de recepcion de datos.
306 338
307 339 """
308 340 if not self.isConfig:
309 341 self.setup(**kwargs)
310 342
311 343 raise NotImplementedError
312 344
313 345 def close(self):
314 346
315 347 pass
@@ -1,87 +1,96
1 1 import argparse
2 2
3 3 from schainpy.controller import Project, multiSchain
4 4
5 5 desc = "HF_EXAMPLE"
6 6
7 7 def fiber(cursor, skip, q, dt):
8 8
9 9 controllerObj = Project()
10 10
11 11 controllerObj.setup(id='191', name='test01', description=desc)
12 12
13 13 readUnitConfObj = controllerObj.addReadUnit(datatype='SpectraReader',
14 path='/home/nanosat/data/hysell_data20/pdata',
14 path='/home/nanosat/data/julia',
15 15 startDate=dt,
16 16 endDate=dt,
17 17 startTime="00:00:00",
18 endTime="23:59:59",
18 endTie="23:59:59",
19 19 online=0,
20 20 #set=1426485881,
21 21 delay=10,
22 22 walk=1,
23 23 queue=q,
24 24 cursor=cursor,
25 25 skip=skip,
26 26 #timezone=-5*3600
27 27 )
28 28
29 29 # #opObj11 = readUnitConfObj.addOperation(name='printNumberOfBlock')
30 30 #
31 31 procUnitConfObj2 = controllerObj.addProcUnit(datatype='Spectra', inputId=readUnitConfObj.getId())
32 # opObj11 = procUnitConfObj2.addParameter(name='pairsList', value='(0,1)', format='pairslist')
33 #
32 # procUnitConfObj2.addParameter(name='nipp', value='5', format='int')
33
34 34 procUnitConfObj3 = controllerObj.addProcUnit(datatype='ParametersProc', inputId=readUnitConfObj.getId())
35 35 opObj11 = procUnitConfObj3.addOperation(name='SpectralMoments', optype='other')
36 36
37 37 #
38 38 # opObj11 = procUnitConfObj1.addOperation(name='SpectraPlot', optype='other')
39 39 # opObj11.addParameter(name='id', value='1000', format='int')
40 40 # opObj11.addParameter(name='wintitle', value='HF_Jicamarca_Spc', format='str')
41 41 # opObj11.addParameter(name='channelList', value='0', format='intlist')
42 42 # opObj11.addParameter(name='zmin', value='-120', format='float')
43 43 # opObj11.addParameter(name='zmax', value='-70', format='float')
44 44 # opObj11.addParameter(name='save', value='1', format='int')
45 45 # opObj11.addParameter(name='figpath', value=figpath, format='str')
46 46
47 # opObj11 = procUnitConfObj2.addOperation(name='RTIPlot', optype='other')
48 # opObj11.addParameter(name='id', value='2000', format='int')
49 # opObj11.addParameter(name='wintitzmaxle', value='HF_Jicamarca', format='str')
50 # opObj11.addParameter(name='showprofile', value='0', format='int')
47 opObj11 = procUnitConfObj3.addOperation(name='Parameters1Plot', optype='other')
48 opObj11.addParameter(name='channelList', value='0', format='intList')
49
50 opObj11.addParameter(name='id', value='2000', format='int')
51 # opObj11.addParameter(name='colormap', value='0', format='bool')
52 opObj11.addParameter(name='onlySNR', value='1', format='bool')
53 opObj11.addParameter(name='DOP', value='0', format='bool')
54 # opObj11.addParameter(name='showSNR', value='1', format='bool')
55 # opObj11.addParameter(name='SNRthresh', value='0', format='int')
56 # opObj11.addParameter(name='SNRmin', value='-10', format='int')
57 # opObj11.addParameter(name='SNRmax', value='30', format='int')
58
59 # opObj11.addParameter(name='showSNR', value='1', format='int')
51 60 # # opObj11.addParameter(name='channelList', value='0', format='intlist')
52 61 # # opObj11.addParameter(name='xmin', value='0', format='float')
53 62 # opObj11.addParameter(name='xmin', value='0', format='float')
54 63 # opObj11.addParameter(name='xmax', value='24', format='float')
55 64
56 65 # opObj11.addParameter(name='zmin', value='-110', format='float')
57 66 # opObj11.addParameter(name='zmax', value='-70', format='float')
58 67 # opObj11.addParameter(name='save', value='0', format='int')
59 68 # # opObj11.addParameter(name='figpath', value='/tmp/', format='str')
60 69 #
61 70 opObj12 = procUnitConfObj3.addOperation(name='PublishData', optype='other')
62 71 opObj12.addParameter(name='zeromq', value=1, format='int')
63 72
64 73
65 74 # opObj13 = procUnitConfObj3.addOperation(name='PublishData', optype='other')
66 75 # opObj13.addParameter(name='zeromq', value=1, format='int')
67 76 # opObj13.addParameter(name='server', value="juanca", format='str')
68 77
69 78 opObj12.addParameter(name='delay', value=1, format='int')
70 79
71 80
72 81 # print "Escribiendo el archivo XML"
73 82 # controllerObj.writeXml(filename)
74 83 # print "Leyendo el archivo XML"
75 84 # controllerObj.readXml(filename)
76 85
77 86
78 87 # timeit.timeit('controllerObj.run()', number=2)
79 88
80 89 controllerObj.start()
81 90
82 91
83 92 if __name__ == '__main__':
84 93 parser = argparse.ArgumentParser(description='Set number of parallel processes')
85 94 parser.add_argument('--nProcess', default=1, type=int)
86 95 args = parser.parse_args()
87 96 multiSchain(fiber, nProcess=args.nProcess, startDate='2015/09/26', endDate='2015/09/26')
@@ -1,1 +1,1
1 <Project description="HF_EXAMPLE" id="191" name="test01"><ReadUnit datatype="SpectraReader" id="1911" inputId="0" name="SpectraReader"><Operation id="19111" name="run" priority="1" type="self"><Parameter format="str" id="191111" name="datatype" value="SpectraReader" /><Parameter format="str" id="191112" name="path" value="/home/nanosat/data/hysell_data20/pdata" /><Parameter format="date" id="191113" name="startDate" value="2015/09/26" /><Parameter format="date" id="191114" name="endDate" value="2015/09/26" /><Parameter format="time" id="191115" name="startTime" value="00:00:00" /><Parameter format="time" id="191116" name="endTime" value="23:59:59" /><Parameter format="int" id="191118" name="cursor" value="2" /><Parameter format="int" id="191119" name="skip" value="720" /><Parameter format="int" id="191120" name="delay" value="10" /><Parameter format="int" id="191121" name="walk" value="1" /><Parameter format="int" id="191122" name="online" value="0" /></Operation></ReadUnit><ProcUnit datatype="ParametersProc" id="1913" inputId="1911" name="ParametersProc"><Operation id="19131" name="run" priority="1" type="self" /><Operation id="19132" name="SpectralMoments" priority="2" type="other" /><Operation id="19133" name="PublishData" priority="3" type="other"><Parameter format="int" id="191331" name="zeromq" value="1" /><Parameter format="int" id="191332" name="delay" value="1" /></Operation></ProcUnit><ProcUnit datatype="Spectra" id="1912" inputId="1911" name="SpectraProc"><Operation id="19121" name="run" priority="1" type="self" /></ProcUnit></Project> No newline at end of file
1 <Project description="HF_EXAMPLE" id="191" name="test01"><ReadUnit datatype="SpectraReader" id="1911" inputId="0" name="SpectraReader"><Operation id="19111" name="run" priority="1" type="self"><Parameter format="str" id="191111" name="datatype" value="SpectraReader" /><Parameter format="str" id="191112" name="path" value="/home/nanosat/data/julia" /><Parameter format="date" id="191113" name="startDate" value="2015/09/26" /><Parameter format="date" id="191114" name="endDate" value="2015/09/26" /><Parameter format="time" id="191115" name="startTime" value="00:00:00" /><Parameter format="time" id="191116" name="endTime" value="23:59:59" /><Parameter format="int" id="191118" name="cursor" value="0" /><Parameter format="int" id="191119" name="skip" value="0" /><Parameter format="int" id="191120" name="delay" value="10" /><Parameter format="int" id="191121" name="walk" value="1" /><Parameter format="int" id="191122" name="online" value="0" /></Operation></ReadUnit><ProcUnit datatype="ParametersProc" id="1913" inputId="1911" name="ParametersProc"><Operation id="19131" name="run" priority="1" type="self" /><Operation id="19132" name="SpectralMoments" priority="2" type="other" /><Operation id="19133" name="Parameters1Plot" priority="3" type="other"><Parameter format="intlist" id="191331" name="channelList" value="0" /><Parameter format="int" id="191332" name="id" value="2000" /><Parameter format="bool" id="191333" name="olySNR" value="1" /><Parameter format="bool" id="191334" name="DOP" value="0" /></Operation><Operation id="19134" name="PublishData" priority="4" type="other"><Parameter format="int" id="191341" name="zeromq" value="1" /><Parameter format="int" id="191342" name="delay" value="1" /></Operation></ProcUnit><ProcUnit datatype="Spectra" id="1912" inputId="1911" name="SpectraProc"><Operation id="19121" name="run" priority="1" type="self" /></ProcUnit></Project> No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now