##// END OF EJS Templates
parametrs plotting: SNR and DOP arguments have been added
Miguel Valdez -
r588:c1c257c97d52
parent child
Show More
@@ -621,6 +621,7 class ParametersPlot(Figure):
621 xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None,timerange=None,
621 xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None,timerange=None,
622 parameterIndex = None, onlyPositive = False,
622 parameterIndex = None, onlyPositive = False,
623 SNRthresh = -numpy.inf, SNR = True, SNRmin = None, SNRmax = None,
623 SNRthresh = -numpy.inf, SNR = True, SNRmin = None, SNRmax = None,
624 DOP = True,
624 zlabel = "", parameterName = "", parameterObject = "data_param",
625 zlabel = "", parameterName = "", parameterObject = "data_param",
625 save=False, figpath='./', lastone=0,figfile=None, ftp=False, wr_period=1, show=True,
626 save=False, figpath='./', lastone=0,figfile=None, ftp=False, wr_period=1, show=True,
626 server=None, folder=None, username=None, password=None,
627 server=None, folder=None, username=None, password=None,
@@ -651,6 +652,21 class ParametersPlot(Figure):
651
652
652 nchan = len(channelIndexList) #Number of channels being plotted
653 nchan = len(channelIndexList) #Number of channels being plotted
653
654
655 if nchan < 1:
656 return
657
658 nGraphsByChannel = 0
659
660 if SNR:
661 nGraphsByChannel += 1
662 if DOP:
663 nGraphsByChannel += 1
664
665 if nGraphsByChannel < 1:
666 return
667
668 nplots = nGraphsByChannel*nchan
669
654 if timerange != None:
670 if timerange != None:
655 self.timerange = timerange
671 self.timerange = timerange
656
672
@@ -658,12 +674,13 class ParametersPlot(Figure):
658 #tmax = None
674 #tmax = None
659 if parameterIndex == None:
675 if parameterIndex == None:
660 parameterIndex = 1
676 parameterIndex = 1
677
661 x = dataOut.getTimeRange1()
678 x = dataOut.getTimeRange1()
662 y = dataOut.heightList
679 y = dataOut.heightList
663 z = data_param[channelIndexList,parameterIndex,:].copy()
680 z = data_param[channelIndexList,parameterIndex,:].copy()
664
681
665 zRange = dataOut.abscissaList
682 zRange = dataOut.abscissaList
666 nplots = z.shape[0] #Number of wind dimensions estimated
683 # nChannels = z.shape[0] #Number of wind dimensions estimated
667 # thisDatetime = dataOut.datatime
684 # thisDatetime = dataOut.datatime
668
685
669 if dataOut.data_SNR != None:
686 if dataOut.data_SNR != None:
@@ -678,8 +695,6 class ParametersPlot(Figure):
678 xlabel = ""
695 xlabel = ""
679 ylabel = "Range (Km)"
696 ylabel = "Range (Km)"
680
697
681 if SNR: nplots = 2*nplots
682
683 if onlyPositive:
698 if onlyPositive:
684 colormap = "jet"
699 colormap = "jet"
685 zmin = 0
700 zmin = 0
@@ -700,7 +715,7 class ParametersPlot(Figure):
700 if zmin == None: zmin = numpy.nanmin(zRange)
715 if zmin == None: zmin = numpy.nanmin(zRange)
701 if zmax == None: zmax = numpy.nanmax(zRange)
716 if zmax == None: zmax = numpy.nanmax(zRange)
702
717
703 if SNR != None:
718 if SNR:
704 if SNRmin == None: SNRmin = numpy.nanmin(SNRdB)
719 if SNRmin == None: SNRmin = numpy.nanmin(SNRdB)
705 if SNRmax == None: SNRmax = numpy.nanmax(SNRdB)
720 if SNRmax == None: SNRmax = numpy.nanmax(SNRdB)
706
721
@@ -719,23 +734,24 class ParametersPlot(Figure):
719 x[1] = self.xmax
734 x[1] = self.xmax
720
735
721 for i in range(nchan):
736 for i in range(nchan):
722 if SNR: j = 2*i
723 else: j = i
724
737
725 title = "%s Channel %d: %s" %(parameterName, channelIndexList[i]+1, thisDatetime.strftime("%Y/%m/%d %H:%M:%S"))
738 j = nGraphsByChannel*i
726
739
727 if ((dataOut.azimuth!=None) and (dataOut.zenith!=None)):
740 if DOP:
728 title = title + '_' + 'azimuth,zenith=%2.2f,%2.2f'%(dataOut.azimuth, dataOut.zenith)
741 title = "%s Channel %d: %s" %(parameterName, channelIndexList[i]+1, thisDatetime.strftime("%Y/%m/%d %H:%M:%S"))
729 axes = self.axesList[j*self.__nsubplots]
742
730 z1 = z[i,:].reshape((1,-1))
743 if ((dataOut.azimuth!=None) and (dataOut.zenith!=None)):
731 axes.pcolorbuffer(x, y, z1,
744 title = title + '_' + 'azimuth,zenith=%2.2f,%2.2f'%(dataOut.azimuth, dataOut.zenith)
732 xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=zmin, zmax=zmax,
745 axes = self.axesList[j]
733 xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True,colormap=colormap,
746 z1 = z[i,:].reshape((1,-1))
734 ticksize=9, cblabel=zlabel, cbsize="1%")
747 axes.pcolorbuffer(x, y, z1,
748 xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=zmin, zmax=zmax,
749 xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True,colormap=colormap,
750 ticksize=9, cblabel=zlabel, cbsize="1%")
735
751
736 if SNR:
752 if SNR:
737 title = "Channel %d Signal Noise Ratio (SNR): %s" %(channelIndexList[i]+1, thisDatetime.strftime("%Y/%m/%d %H:%M:%S"))
753 title = "Channel %d Signal Noise Ratio (SNR): %s" %(channelIndexList[i]+1, thisDatetime.strftime("%Y/%m/%d %H:%M:%S"))
738 axes = self.axesList[(j + 1)*self.__nsubplots]
754 axes = self.axesList[(j + nGraphsByChannel-1)]
739 z1 = SNRdB[i,:].reshape((1,-1))
755 z1 = SNRdB[i,:].reshape((1,-1))
740 axes.pcolorbuffer(x, y, z1,
756 axes.pcolorbuffer(x, y, z1,
741 xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=SNRmin, zmax=SNRmax,
757 xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=SNRmin, zmax=SNRmax,
General Comments 0
You need to be logged in to leave comments. Login now