##// END OF EJS Templates
Bug fixed in Sky Map and Phase Plots
Julio Valdez -
r786:aed163ca3230
parent child
Show More
@@ -131,6 +131,8 class MomentsPlot(Figure):
131 xlabel = "Velocity (m/s)"
131 xlabel = "Velocity (m/s)"
132 ylabel = "Range (Km)"
132 ylabel = "Range (Km)"
133
133
134 update_figfile = False
135
134 if not self.isConfig:
136 if not self.isConfig:
135
137
136 nplots = len(channelIndexList)
138 nplots = len(channelIndexList)
@@ -154,6 +156,7 class MomentsPlot(Figure):
154 self.PLOT_POS = plot_pos
156 self.PLOT_POS = plot_pos
155
157
156 self.isConfig = True
158 self.isConfig = True
159 update_figfile = True
157
160
158 self.setWinTitle(title)
161 self.setWinTitle(title)
159
162
@@ -248,7 +251,7 class SkyMapPlot(Figure):
248 self.addAxes(1, 1, 0, 0, 1, 1, True)
251 self.addAxes(1, 1, 0, 0, 1, 1, True)
249
252
250 def run(self, dataOut, id, wintitle="", channelList=None, showprofile=False,
253 def run(self, dataOut, id, wintitle="", channelList=None, showprofile=False,
251 xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None,
254 tmin=None, tmax=None, timerange=None,
252 save=False, figpath='./', figfile=None, show=True, ftp=False, wr_period=1,
255 save=False, figpath='./', figfile=None, show=True, ftp=False, wr_period=1,
253 server=None, folder=None, username=None, password=None,
256 server=None, folder=None, username=None, password=None,
254 ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0, realtime=False):
257 ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0, realtime=False):
@@ -278,13 +281,14 class SkyMapPlot(Figure):
278
281
279 x = finalAzimuth*numpy.pi/180
282 x = finalAzimuth*numpy.pi/180
280 y = finalZenith
283 y = finalZenith
284 x1 = dataOut.getTimeRange()
281
285
282
283 #thisDatetime = dataOut.datatime
286 #thisDatetime = dataOut.datatime
284 thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.getTimeRange()[0])
287 thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.getTimeRange()[0])
285 title = wintitle + " Parameters"
288 title = wintitle + " Parameters"
286 xlabel = "Zonal Zenith Angle (deg) "
289 xlabel = "Zonal Zenith Angle (deg) "
287 ylabel = "Meridional Zenith Angle (deg)"
290 ylabel = "Meridional Zenith Angle (deg)"
291 update_figfile = False
288
292
289 if not self.__isConfig:
293 if not self.__isConfig:
290
294
@@ -295,7 +299,14 class SkyMapPlot(Figure):
295 wintitle=wintitle,
299 wintitle=wintitle,
296 showprofile=showprofile,
300 showprofile=showprofile,
297 show=show)
301 show=show)
298
302
303 self.xmin, self.xmax = self.getTimeLim(x1, tmin, tmax, timerange)
304
305 if timerange != None:
306 self.timerange = timerange
307 else:
308 self.timerange = self.xmax - self.xmin
309
299 self.FTP_WEI = ftp_wei
310 self.FTP_WEI = ftp_wei
300 self.EXP_CODE = exp_code
311 self.EXP_CODE = exp_code
301 self.SUB_EXP_CODE = sub_exp_code
312 self.SUB_EXP_CODE = sub_exp_code
@@ -303,6 +314,7 class SkyMapPlot(Figure):
303 self.name = thisDatetime.strftime("%Y%m%d_%H%M%S")
314 self.name = thisDatetime.strftime("%Y%m%d_%H%M%S")
304 self.firstdate = '%s %s'%(thisDatetime.strftime("%Y/%m/%d"),thisDatetime.strftime("%H:%M:%S"))
315 self.firstdate = '%s %s'%(thisDatetime.strftime("%Y/%m/%d"),thisDatetime.strftime("%H:%M:%S"))
305 self.__isConfig = True
316 self.__isConfig = True
317 update_figfile = True
306
318
307 self.setWinTitle(title)
319 self.setWinTitle(title)
308
320
@@ -317,14 +329,24 class SkyMapPlot(Figure):
317 ticksize=9, cblabel='')
329 ticksize=9, cblabel='')
318
330
319 self.draw()
331 self.draw()
320
332
321 self.save(figpath=figpath,
333 self.save(figpath=figpath,
322 figfile=figfile,
334 figfile=figfile,
323 save=save,
335 save=save,
324 ftp=ftp,
336 ftp=ftp,
325 wr_period=wr_period,
337 wr_period=wr_period,
326 thisDatetime=thisDatetime,
338 thisDatetime=thisDatetime,
327 update_figfile=False)
339 update_figfile=update_figfile)
340
341 if dataOut.ltctime >= self.xmax:
342 self.counter_imagwr = wr_period
343 self.__isConfig = False
344 update_figfile = True
345 axes.__firsttime = True
346 self.xmin += self.timerange
347 self.xmax += self.timerange
348
349
328
350
329
351
330 class WindProfilerPlot(Figure):
352 class WindProfilerPlot(Figure):
@@ -461,6 +483,7 class WindProfilerPlot(Figure):
461 title = wintitle + "Wind"
483 title = wintitle + "Wind"
462 xlabel = ""
484 xlabel = ""
463 ylabel = "Range (Km)"
485 ylabel = "Range (Km)"
486 update_figfile = False
464
487
465 if not self.__isConfig:
488 if not self.__isConfig:
466
489
@@ -499,6 +522,7 class WindProfilerPlot(Figure):
499 self.name = thisDatetime.strftime("%Y%m%d_%H%M%S")
522 self.name = thisDatetime.strftime("%Y%m%d_%H%M%S")
500 self.__isConfig = True
523 self.__isConfig = True
501 self.figfile = figfile
524 self.figfile = figfile
525 update_figfile = True
502
526
503 self.setWinTitle(title)
527 self.setWinTitle(title)
504
528
@@ -537,10 +561,10 class WindProfilerPlot(Figure):
537
561
538 self.draw()
562 self.draw()
539
563
540 if x[1] >= self.axesList[0].xmax:
564 if dataOut.ltctime >= self.xmax:
541 self.counter_imagwr = wr_period
565 self.counter_imagwr = wr_period
542 self.__isConfig = False
566 self.__isConfig = False
543 self.figfile = None
567 update_figfile = True
544
568
545 self.save(figpath=figpath,
569 self.save(figpath=figpath,
546 figfile=figfile,
570 figfile=figfile,
@@ -548,7 +572,8 class WindProfilerPlot(Figure):
548 ftp=ftp,
572 ftp=ftp,
549 wr_period=wr_period,
573 wr_period=wr_period,
550 thisDatetime=thisDatetime,
574 thisDatetime=thisDatetime,
551 update_figfile=False)
575 update_figfile=update_figfile)
576
552
577
553
578
554 class ParametersPlot(Figure):
579 class ParametersPlot(Figure):
@@ -1247,7 +1272,7 class PhasePlot(Figure):
1247 def run(self, dataOut, id, wintitle="", pairsList=None, showprofile='True',
1272 def run(self, dataOut, id, wintitle="", pairsList=None, showprofile='True',
1248 xmin=None, xmax=None, ymin=None, ymax=None,
1273 xmin=None, xmax=None, ymin=None, ymax=None,
1249 timerange=None,
1274 timerange=None,
1250 save=False, figpath='', figfile=None, show=True, ftp=False, wr_period=1,
1275 save=False, figpath='./', figfile=None, show=True, ftp=False, wr_period=1,
1251 server=None, folder=None, username=None, password=None,
1276 server=None, folder=None, username=None, password=None,
1252 ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0):
1277 ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0):
1253
1278
@@ -1267,7 +1292,7 class PhasePlot(Figure):
1267
1292
1268 #phase = numpy.zeros((len(pairsIndexList),len(dataOut.beacon_heiIndexList)))
1293 #phase = numpy.zeros((len(pairsIndexList),len(dataOut.beacon_heiIndexList)))
1269 phase_beacon = dataOut.data_output
1294 phase_beacon = dataOut.data_output
1270
1295 update_figfile = False
1271
1296
1272 if not self.__isConfig:
1297 if not self.__isConfig:
1273
1298
@@ -1302,7 +1327,7 class PhasePlot(Figure):
1302 path = '%s%03d' %(self.PREFIX, self.id)
1327 path = '%s%03d' %(self.PREFIX, self.id)
1303 beacon_file = os.path.join(path,'%s.txt'%self.name)
1328 beacon_file = os.path.join(path,'%s.txt'%self.name)
1304 self.filename_phase = os.path.join(figpath,beacon_file)
1329 self.filename_phase = os.path.join(figpath,beacon_file)
1305 #self.save_phase(self.filename_phase)
1330 update_figfile = True
1306
1331
1307
1332
1308 #store data beacon phase
1333 #store data beacon phase
@@ -1333,27 +1358,10 class PhasePlot(Figure):
1333
1358
1334 self.draw()
1359 self.draw()
1335
1360
1336 if x[1] >= self.axesList[0].xmax:
1361 if dataOut.ltctime >= self.xmax:
1337 self.counter_imagwr = wr_period
1362 self.counter_imagwr = wr_period
1338 del self.xdata
1339 del self.ydata
1340 self.__isConfig = False
1363 self.__isConfig = False
1341
1364 update_figfile = True
1342 # if self.figfile == None:
1343 # str_datetime = thisDatetime.strftime("%Y%m%d_%H%M%S")
1344 # self.figfile = self.getFilename(name = str_datetime)
1345
1346 # if figpath != '':
1347 # self.counter_imagwr += 1
1348 # if (self.counter_imagwr>=wr_period):
1349 # # store png plot to local folder
1350 # self.saveFigure(figpath, self.figfile)
1351 # # store png plot to FTP server according to RT-Web format
1352 # name = self.getNameToFtp(thisDatetime, self.FTP_WEI, self.EXP_CODE, self.SUB_EXP_CODE, self.PLOT_CODE, self.PLOT_POS)
1353 # ftp_filename = os.path.join(figpath, name)
1354 # self.saveFigure(figpath, ftp_filename)
1355 # self.counter_imagwr = 0
1356 # self.figfile = None
1357
1365
1358 self.save(figpath=figpath,
1366 self.save(figpath=figpath,
1359 figfile=figfile,
1367 figfile=figfile,
@@ -1361,4 +1369,4 class PhasePlot(Figure):
1361 ftp=ftp,
1369 ftp=ftp,
1362 wr_period=wr_period,
1370 wr_period=wr_period,
1363 thisDatetime=thisDatetime,
1371 thisDatetime=thisDatetime,
1364 update_figfile=False)
1372 update_figfile=update_figfile)
General Comments 0
You need to be logged in to leave comments. Login now