##// END OF EJS Templates
New Graphic added: ParametersPlot, plot a user selected parameter as RTI.
Julio Valdez -
r512:3b00dd89e2d9
parent child
Show More
@@ -576,14 +576,14 class WindProfilerPlot(Figure):
576 self.figfile = None
576 self.figfile = None
577
577
578
578
579 class RadialVelocityPlot(Figure):
579 class ParametersPlot(Figure):
580
580
581 __isConfig = None
581 __isConfig = None
582 __nsubplots = None
582 __nsubplots = None
583
583
584 WIDTHPROF = None
584 WIDTHPROF = None
585 HEIGHTPROF = None
585 HEIGHTPROF = None
586 PREFIX = 'rti'
586 PREFIX = 'prm'
587
587
588 def __init__(self):
588 def __init__(self):
589
589
@@ -649,7 +649,8 class RadialVelocityPlot(Figure):
649
649
650 def run(self, dataOut, id, wintitle="", channelList=None, showprofile=False,
650 def run(self, dataOut, id, wintitle="", channelList=None, showprofile=False,
651 xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None,timerange=None,
651 xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None,timerange=None,
652 SNRmin = None, SNRmax = None, SNRthresh = None, paramIndex = None,
652 SNRmin = None, SNRmax = None, SNRthresh = None, paramIndex = None, onlyPositive = False,
653 zlabel = "", parameterName = "",
653 save=False, figpath='', lastone=0,figfile=None, ftp=False, wr_period=1, show=True,
654 save=False, figpath='', lastone=0,figfile=None, ftp=False, wr_period=1, show=True,
654 server=None, folder=None, username=None, password=None,
655 server=None, folder=None, username=None, password=None,
655 ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0):
656 ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0):
@@ -692,26 +693,16 class RadialVelocityPlot(Figure):
692
693
693 zRange = dataOut.abscissaRange
694 zRange = dataOut.abscissaRange
694 nplots = z.shape[0] #Number of wind dimensions estimated
695 nplots = z.shape[0] #Number of wind dimensions estimated
695 nplotsw = nplots
696
697 if dataOut.SNR != None:
698 nplots += 1
699 SNR = dataOut.SNR
700 SNRavg = numpy.average(SNR, axis=0)
701
702 SNRdB = 10*numpy.log10(SNR)
703 SNRavgdB = 10*numpy.log10(SNRavg)
704
705 if SNRthresh == None: SNRthresh = -5.0
706 ind = numpy.where(SNRavg < 10**(SNRthresh/10))[0]
707
708 for i in range(nplotsw):
709 z[i,ind] = numpy.nan
710 # thisDatetime = dataOut.datatime
696 # thisDatetime = dataOut.datatime
711 thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.getTimeRange()[1])
697 thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.getTimeRange()[1])
712 title = wintitle + " Radial Velocity" #: %s" %(thisDatetime.strftime("%d-%b-%Y"))
698 title = wintitle + " Parameters Plot" #: %s" %(thisDatetime.strftime("%d-%b-%Y"))
713 xlabel = ""
699 xlabel = ""
714 ylabel = "Height (Km)"
700 ylabel = "Range (Km)"
701
702 if onlyPositive:
703 colormap = "jet"
704 zmin = 0
705 else: colormap = "RdBu_r"
715
706
716 if not self.__isConfig:
707 if not self.__isConfig:
717
708
@@ -727,6 +718,7 class RadialVelocityPlot(Figure):
727 if ymax == None: ymax = numpy.nanmax(y)
718 if ymax == None: ymax = numpy.nanmax(y)
728 if zmin == None: zmin = numpy.nanmin(zRange)
719 if zmin == None: zmin = numpy.nanmin(zRange)
729 if zmax == None: zmax = numpy.nanmax(zRange)
720 if zmax == None: zmax = numpy.nanmax(zRange)
721
730 if dataOut.SNR != None:
722 if dataOut.SNR != None:
731 if SNRmin == None: SNRmin = numpy.nanmin(SNRavgdB)
723 if SNRmin == None: SNRmin = numpy.nanmin(SNRavgdB)
732 if SNRmax == None: SNRmax = numpy.nanmax(SNRavgdB)
724 if SNRmax == None: SNRmax = numpy.nanmax(SNRavgdB)
@@ -745,29 +737,18 class RadialVelocityPlot(Figure):
745 if ((self.xmax - x[1]) < (x[1]-x[0])):
737 if ((self.xmax - x[1]) < (x[1]-x[0])):
746 x[1] = self.xmax
738 x[1] = self.xmax
747
739
748 for i in range(nplotsw):
740 for i in range(nplots):
749 title = "Channel %d: %s" %(dataOut.channelList[i]+1, thisDatetime.strftime("%Y/%m/%d %H:%M:%S"))
741 title = "%s Channel %d: %s" %(parameterName, dataOut.channelList[i]+1, thisDatetime.strftime("%Y/%m/%d %H:%M:%S"))
742
750 if ((dataOut.azimuth!=None) and (dataOut.zenith!=None)):
743 if ((dataOut.azimuth!=None) and (dataOut.zenith!=None)):
751 title = title + '_' + 'azimuth,zenith=%2.2f,%2.2f'%(dataOut.azimuth, dataOut.zenith)
744 title = title + '_' + 'azimuth,zenith=%2.2f,%2.2f'%(dataOut.azimuth, dataOut.zenith)
752 axes = self.axesList[i*self.__nsubplots]
745 axes = self.axesList[i*self.__nsubplots]
753 z1 = z[i,:].reshape((1,-1))
746 z1 = z[i,:].reshape((1,-1))
754 axes.pcolorbuffer(x, y, z1,
747 axes.pcolorbuffer(x, y, z1,
755 xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=zmin, zmax=zmax,
748 xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=zmin, zmax=zmax,
756 xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True,colormap="RdBu_r",
749 xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True,colormap=colormap,
757 ticksize=9, cblabel='', cbsize="1%")
750 ticksize=9, cblabel=zlabel, cbsize="1%")
758
751
759 if dataOut.SNR != None:
760 i += 1
761 title = "Signal Noise Ratio (SNR): %s" %(thisDatetime.strftime("%Y/%m/%d %H:%M:%S"))
762 axes = self.axesList[i*self.__nsubplots]
763
764 SNRavgdB = SNRavgdB.reshape((1,-1))
765
766 axes.pcolorbuffer(x, y, SNRavgdB,
767 xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=SNRmin, zmax=SNRmax,
768 xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True,
769 ticksize=9, cblabel='', cbsize="1%", colormap="jet")
770
771 self.draw()
752 self.draw()
772
753
773 if self.figfile == None:
754 if self.figfile == None:
General Comments 0
You need to be logged in to leave comments. Login now