##// END OF EJS Templates
ParametersPlot: Corrections and SNR graphic added.
Julio Valdez -
r548:f6f23959bcc9
parent child
Show More
@@ -650,6 +650,8 class ParametersPlot(Figure):
650 650 def run(self, dataOut, id, wintitle="", channelList=None, showprofile=False,
651 651 xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None,timerange=None,
652 652 parameterIndex = None, onlyPositive = False,
653 SNRthresh = -numpy.inf, SNR = True, SNRmin = None, SNRmax = None,
654
653 655 zlabel = "", parameterName = "", parameterObject = "data_param",
654 656 save=False, figpath='', lastone=0,figfile=None, ftp=False, wr_period=1, show=True,
655 657 server=None, folder=None, username=None, password=None,
@@ -678,6 +680,8 class ParametersPlot(Figure):
678 680 else:
679 681 channelIndexList = numpy.array(channelIndexList)
680 682
683 nchan = len(channelIndexList) #Number of channels being plotted
684
681 685 if timerange != None:
682 686 self.timerange = timerange
683 687
@@ -692,11 +696,21 class ParametersPlot(Figure):
692 696 zRange = dataOut.abscissaList
693 697 nplots = z.shape[0] #Number of wind dimensions estimated
694 698 # thisDatetime = dataOut.datatime
699
700 if dataOut.data_SNR != None:
701 SNRarray = dataOut.data_SNR
702 SNRdB = 10*numpy.log10(SNRarray)
703 # SNRavgdB = 10*numpy.log10(SNRavg)
704 ind = numpy.where(SNRdB < 10**(SNRthresh/10))
705 z[ind] = numpy.nan
706
695 707 thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.getTimeRange()[1])
696 708 title = wintitle + " Parameters Plot" #: %s" %(thisDatetime.strftime("%d-%b-%Y"))
697 709 xlabel = ""
698 710 ylabel = "Range (Km)"
699 711
712 if SNR: nplots = 2*nplots
713
700 714 if onlyPositive:
701 715 colormap = "jet"
702 716 zmin = 0
@@ -717,6 +731,10 class ParametersPlot(Figure):
717 731 if zmin == None: zmin = numpy.nanmin(zRange)
718 732 if zmax == None: zmax = numpy.nanmax(zRange)
719 733
734 if SNR != None:
735 if SNRmin == None: SNRmin = numpy.nanmin(SNRdB)
736 if SNRmax == None: SNRmax = numpy.nanmax(SNRdB)
737
720 738 self.FTP_WEI = ftp_wei
721 739 self.EXP_CODE = exp_code
722 740 self.SUB_EXP_CODE = sub_exp_code
@@ -730,18 +748,32 class ParametersPlot(Figure):
730 748
731 749 if ((self.xmax - x[1]) < (x[1]-x[0])):
732 750 x[1] = self.xmax
733
734 for i in range(nplots):
735 title = "%s Channel %d: %s" %(parameterName, dataOut.channelList[i]+1, thisDatetime.strftime("%Y/%m/%d %H:%M:%S"))
751
752 for i in range(nchan):
753 if SNR: j = 2*i
754 else: j = i
755
756 title = "%s Channel %d: %s" %(parameterName, channelIndexList[i]+1, thisDatetime.strftime("%Y/%m/%d %H:%M:%S"))
736 757
737 758 if ((dataOut.azimuth!=None) and (dataOut.zenith!=None)):
738 759 title = title + '_' + 'azimuth,zenith=%2.2f,%2.2f'%(dataOut.azimuth, dataOut.zenith)
739 axes = self.axesList[i*self.__nsubplots]
760 axes = self.axesList[j*self.__nsubplots]
740 761 z1 = z[i,:].reshape((1,-1))
741 762 axes.pcolorbuffer(x, y, z1,
742 763 xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=zmin, zmax=zmax,
743 764 xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True,colormap=colormap,
744 765 ticksize=9, cblabel=zlabel, cbsize="1%")
766
767 if SNR:
768 title = "Channel %d Signal Noise Ratio (SNR): %s" %(channelIndexList[i]+1, thisDatetime.strftime("%Y/%m/%d %H:%M:%S"))
769 axes = self.axesList[(j + 1)*self.__nsubplots]
770 z1 = SNRdB[i,:].reshape((1,-1))
771 axes.pcolorbuffer(x, y, z1,
772 xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=SNRmin, zmax=SNRmax,
773 xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True,colormap="jet",
774 ticksize=9, cblabel=zlabel, cbsize="1%")
775
776
745 777
746 778 self.draw()
747 779
General Comments 0
You need to be logged in to leave comments. Login now