@@ -4,8 +4,7 import numpy | |||||
4 |
|
4 | |||
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 | from numpy import NaN | ||
8 | import matplotlib.pyplot as plt |
|
|||
9 |
|
8 | |||
10 | class MomentsPlot(Figure): |
|
9 | class MomentsPlot(Figure): | |
11 |
|
10 | |||
@@ -447,13 +446,18 class WindProfilerPlot(Figure): | |||||
447 | # tmin = None |
|
446 | # tmin = None | |
448 | # tmax = None |
|
447 | # tmax = None | |
449 |
|
448 | |||
450 | x = dataOut.getTimeRange1(dataOut.outputInterval) |
|
449 | ||
451 |
|
|
450 | x = dataOut.getTimeRange() | |
|
451 | y = dataOut.getHeiRange() | |||
|
452 | #x = dataOut.getTimeRange1(dataOut.outputInterval) | |||
|
453 | #y = dataOut.heightList | |||
|
454 | ||||
452 | z = dataOut.data_output.copy() |
|
455 | z = dataOut.data_output.copy() | |
|
456 | #print 'dataOut_JI',z | |||
453 | nplots = z.shape[0] #Number of wind dimensions estimated |
|
457 | nplots = z.shape[0] #Number of wind dimensions estimated | |
454 |
|
||||
455 | nplotsw = nplots |
|
458 | nplotsw = nplots | |
456 |
|
|
459 | ||
|
460 | ||||
457 | #If there is a SNR function defined |
|
461 | #If there is a SNR function defined | |
458 | if dataOut.data_SNR is not None: |
|
462 | if dataOut.data_SNR is not None: | |
459 | nplots += 1 |
|
463 | nplots += 1 | |
@@ -472,8 +476,7 class WindProfilerPlot(Figure): | |||||
472 |
|
476 | |||
473 | # showprofile = False |
|
477 | # showprofile = False | |
474 | # thisDatetime = dataOut.datatime |
|
478 | # thisDatetime = dataOut.datatime | |
475 |
|
|
479 | thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.ltctime) | |
476 | thisDatetime = datetime.datetime.now() |
|
|||
477 | title = wintitle + "Wind" |
|
480 | title = wintitle + "Wind" | |
478 | xlabel = "" |
|
481 | xlabel = "" | |
479 | ylabel = "Height (km)" |
|
482 | ylabel = "Height (km)" | |
@@ -492,8 +495,8 class WindProfilerPlot(Figure): | |||||
492 |
|
495 | |||
493 | self.xmin, self.xmax = self.getTimeLim(x, xmin, xmax, timerange) |
|
496 | self.xmin, self.xmax = self.getTimeLim(x, xmin, xmax, timerange) | |
494 |
|
497 | |||
495 |
|
|
498 | if ymin == None: ymin = numpy.nanmin(y) | |
496 |
|
|
499 | if ymax == None: ymax = numpy.nanmax(y) | |
497 |
|
500 | |||
498 | if zmax == None: zmax = numpy.nanmax(abs(z[range(2),:])) |
|
501 | if zmax == None: zmax = numpy.nanmax(abs(z[range(2),:])) | |
499 | #if numpy.isnan(zmax): zmax = 50 |
|
502 | #if numpy.isnan(zmax): zmax = 50 | |
@@ -503,9 +506,9 class WindProfilerPlot(Figure): | |||||
503 | if zmax_ver == None: zmax_ver = numpy.nanmax(abs(z[2,:])) |
|
506 | if zmax_ver == None: zmax_ver = numpy.nanmax(abs(z[2,:])) | |
504 | if zmin_ver == None: zmin_ver = -zmax_ver |
|
507 | if zmin_ver == None: zmin_ver = -zmax_ver | |
505 |
|
508 | |||
506 |
|
|
509 | if dataOut.data_SNR is not None: | |
507 |
|
|
510 | if SNRmin == None: SNRmin = numpy.nanmin(SNRavgdB) | |
508 |
|
|
511 | if SNRmax == None: SNRmax = numpy.nanmax(SNRavgdB) | |
509 |
|
512 | |||
510 |
|
513 | |||
511 | self.FTP_WEI = ftp_wei |
|
514 | self.FTP_WEI = ftp_wei | |
@@ -520,8 +523,8 class WindProfilerPlot(Figure): | |||||
520 |
|
523 | |||
521 | self.setWinTitle(title) |
|
524 | self.setWinTitle(title) | |
522 |
|
525 | |||
523 |
|
|
526 | if ((self.xmax - x[1]) < (x[1]-x[0])): | |
524 |
|
|
527 | x[1] = self.xmax | |
525 |
|
528 | |||
526 | strWind = ['Zonal', 'Meridional', 'Vertical'] |
|
529 | strWind = ['Zonal', 'Meridional', 'Vertical'] | |
527 | strCb = ['Velocity (m/s)','Velocity (m/s)','Velocity (cm/s)'] |
|
530 | strCb = ['Velocity (m/s)','Velocity (m/s)','Velocity (cm/s)'] | |
@@ -535,11 +538,12 class WindProfilerPlot(Figure): | |||||
535 | axes = self.axesList[i*self.__nsubplots] |
|
538 | axes = self.axesList[i*self.__nsubplots] | |
536 |
|
539 | |||
537 |
z1 = z[i,:].reshape((1,-1))*windFactor[i] |
|
540 | z1 = z[i,:].reshape((1,-1))*windFactor[i] | |
|
541 | #z1=numpy.ma.masked_where(z1==0.,z1) | |||
538 |
|
542 | |||
539 | axes.pcolorbuffer(x, y, z1, |
|
543 | axes.pcolorbuffer(x, y, z1, | |
540 | xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=zminVector[i], zmax=zmaxVector[i], |
|
544 | xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=zminVector[i], zmax=zmaxVector[i], | |
541 | xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True, |
|
545 | xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True, | |
542 |
ticksize=9, cblabel=strCb[i], cbsize="1%", colormap=" |
|
546 | ticksize=9, cblabel=strCb[i], cbsize="1%", colormap="seismic" ) | |
543 |
|
547 | |||
544 | if dataOut.data_SNR is not None: |
|
548 | if dataOut.data_SNR is not None: | |
545 | i += 1 |
|
549 | i += 1 | |
@@ -563,7 +567,7 class WindProfilerPlot(Figure): | |||||
563 | thisDatetime=thisDatetime, |
|
567 | thisDatetime=thisDatetime, | |
564 | update_figfile=update_figfile) |
|
568 | update_figfile=update_figfile) | |
565 |
|
569 | |||
566 |
if |
|
570 | if dataOut.ltctime + dataOut.outputInterval >= self.xmax: | |
567 |
self.counter_imagwr = wr_period |
|
571 | self.counter_imagwr = wr_period | |
568 | self.isConfig = False |
|
572 | self.isConfig = False | |
569 | update_figfile = True |
|
573 | update_figfile = True | |
@@ -780,7 +784,7 class ParametersPlot(Figure): | |||||
780 |
|
784 | |||
781 |
|
785 | |||
782 |
|
786 | |||
783 | class ParametersPlot(Figure): |
|
787 | class Parameters1Plot(Figure): | |
784 |
|
788 | |||
785 | __isConfig = None |
|
789 | __isConfig = None | |
786 | __nsubplots = None |
|
790 | __nsubplots = None |
General Comments 0
You need to be logged in to leave comments.
Login now