##// END OF EJS Templates
actualizacion para calculo de fase
Daniel Valdez -
r281:8db752314ca7
parent child
Show More
@@ -54,7 +54,8 class CrossSpectraPlot(Figure):
54 54
55 55 def run(self, dataOut, idfigure, wintitle="", pairsList=None, showprofile='True',
56 56 xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None,
57 save=False, figpath='./', figfile=None):
57 save=False, figpath='./', figfile=None,
58 power_cmap='jet', coherence_cmap='jet', phase_cmap='RdBu_r'):
58 59
59 60 """
60 61
@@ -90,8 +91,8 class CrossSpectraPlot(Figure):
90 91 x = dataOut.getVelRange(1)
91 92 y = dataOut.getHeiRange()
92 93 z = dataOut.data_spc[:,:,:]/factor
93 z = numpy.where(numpy.isfinite(z), z, numpy.NAN)
94 avg = numpy.average(numpy.abs(z), axis=1)
94 # z = numpy.where(numpy.isfinite(z), z, numpy.NAN)
95 avg = numpy.abs(numpy.average(z, axis=1))
95 96 noise = dataOut.getNoise()/factor
96 97
97 98 zdB = 10*numpy.log10(z)
@@ -133,7 +134,7 class CrossSpectraPlot(Figure):
133 134 axes0.pcolor(x, y, zdB,
134 135 xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, zmin=zmin, zmax=zmax,
135 136 xlabel=xlabel, ylabel=ylabel, title=title,
136 ticksize=9, cblabel='')
137 ticksize=9, colormap=power_cmap, cblabel='')
137 138
138 139 title = "Channel %d: %4.2fdB" %(pair[1], noisedB[pair[1]])
139 140 zdB = 10.*numpy.log10(dataOut.data_spc[pair[1],:,:]/factor)
@@ -141,26 +142,26 class CrossSpectraPlot(Figure):
141 142 axes0.pcolor(x, y, zdB,
142 143 xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, zmin=zmin, zmax=zmax,
143 144 xlabel=xlabel, ylabel=ylabel, title=title,
144 ticksize=9, cblabel='')
145 ticksize=9, colormap=power_cmap, cblabel='')
145 146
146 147 coherenceComplex = dataOut.data_cspc[pairsIndexList[i],:,:]/numpy.sqrt(dataOut.data_spc[pair[0],:,:]*dataOut.data_spc[pair[1],:,:])
147 148 coherence = numpy.abs(coherenceComplex)
148 phase = numpy.arctan(-1*coherenceComplex.imag/coherenceComplex.real)*180/numpy.pi
149
149 # phase = numpy.arctan(-1*coherenceComplex.imag/coherenceComplex.real)*180/numpy.pi
150 phase = numpy.arctan2(coherenceComplex.imag, coherenceComplex.real)*180/numpy.pi
150 151
151 152 title = "Coherence %d%d" %(pair[0], pair[1])
152 153 axes0 = self.axesList[i*self.__nsubplots+2]
153 154 axes0.pcolor(x, y, coherence,
154 155 xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, zmin=0, zmax=1,
155 156 xlabel=xlabel, ylabel=ylabel, title=title,
156 ticksize=9, cblabel='')
157 ticksize=9, colormap=coherence_cmap, cblabel='')
157 158
158 159 title = "Phase %d%d" %(pair[0], pair[1])
159 160 axes0 = self.axesList[i*self.__nsubplots+3]
160 161 axes0.pcolor(x, y, phase,
161 162 xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, zmin=-180, zmax=180,
162 163 xlabel=xlabel, ylabel=ylabel, title=title,
163 ticksize=9, cblabel='', colormap='RdBu_r')
164 ticksize=9, colormap=phase_cmap, cblabel='')
164 165
165 166
166 167
@@ -190,7 +191,7 class RTIPlot(Figure):
190 191 self.__nsubplots = 1
191 192
192 193 self.WIDTH = 800
193 self.HEIGHT = 200
194 self.HEIGHT = 180
194 195 self.WIDTHPROF = 120
195 196 self.HEIGHTPROF = 0
196 197
@@ -276,11 +277,9 class RTIPlot(Figure):
276 277 z = dataOut.data_spc[channelIndexList,:,:]/factor
277 278 z = numpy.where(numpy.isfinite(z), z, numpy.NAN)
278 279 avg = numpy.average(z, axis=1)
279 noise = dataOut.getNoise()/factor
280 280
281 # zdB = 10.*numpy.log10(z)
282 281 avgdB = 10.*numpy.log10(avg)
283 noisedB = 10.*numpy.log10(noise)
282
284 283
285 284 thisDatetime = dataOut.datatime
286 285 title = "RTI: %s" %(thisDatetime.strftime("%d-%b-%Y"))
@@ -699,7 +698,7 class CoherenceMap(Figure):
699 698
700 699 WIDTHPROF = None
701 700 HEIGHTPROF = None
702 PREFIX = 'coherencemap'
701 PREFIX = 'cmap'
703 702
704 703 def __init__(self):
705 704 self.timerange = 2*60*60
@@ -707,7 +706,7 class CoherenceMap(Figure):
707 706 self.__nsubplots = 1
708 707
709 708 self.WIDTH = 800
710 self.HEIGHT = 200
709 self.HEIGHT = 180
711 710 self.WIDTHPROF = 120
712 711 self.HEIGHTPROF = 0
713 712
@@ -746,7 +745,8 class CoherenceMap(Figure):
746 745 def run(self, dataOut, idfigure, wintitle="", pairsList=None, showprofile='True',
747 746 xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None,
748 747 timerange=None,
749 save=False, figpath='./', figfile=None):
748 save=False, figpath='./', figfile=None,
749 coherence_cmap='jet', phase_cmap='RdBu_r'):
750 750
751 751 if pairsList == None:
752 752 pairsIndexList = dataOut.pairsIndexList
@@ -797,9 +797,12 class CoherenceMap(Figure):
797 797
798 798 pair = dataOut.pairsList[pairsIndexList[i]]
799 799 coherenceComplex = dataOut.data_cspc[pairsIndexList[i],:,:]/numpy.sqrt(dataOut.data_spc[pair[0],:,:]*dataOut.data_spc[pair[1],:,:])
800 coherence = numpy.abs(coherenceComplex)
801 avg = numpy.average(coherence, axis=0)
802 z = avg.reshape((1,-1))
800 avgcoherenceComplex = numpy.average(coherenceComplex, axis=0)
801 coherence = numpy.abs(avgcoherenceComplex)
802 # coherence = numpy.abs(coherenceComplex)
803 # avg = numpy.average(coherence, axis=0)
804
805 z = coherence.reshape((1,-1))
803 806
804 807 counter = 0
805 808
@@ -808,33 +811,34 class CoherenceMap(Figure):
808 811 axes.pcolor(x, y, z,
809 812 xmin=tmin, xmax=tmax, ymin=ymin, ymax=ymax, zmin=0, zmax=1,
810 813 xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True,
811 ticksize=9, cblabel='', cbsize="1%")
814 ticksize=9, cblabel='', colormap=coherence_cmap, cbsize="1%")
812 815
813 816 if self.__showprofile:
814 817 counter += 1
815 818 axes = self.axesList[i*self.__nsubplots*2 + counter]
816 axes.pline(avg, y,
819 axes.pline(coherence, y,
817 820 xmin=0, xmax=1, ymin=ymin, ymax=ymax,
818 821 xlabel='', ylabel='', title='', ticksize=7,
819 822 ytick_visible=False, nxticks=5,
820 823 grid='x')
821 824
822 825 counter += 1
823 phase = numpy.arctan(-1*coherenceComplex.imag/coherenceComplex.real)*180/numpy.pi
824 avg = numpy.average(phase, axis=0)
825 z = avg.reshape((1,-1))
826 # phase = numpy.arctan(-1*coherenceComplex.imag/coherenceComplex.real)*180/numpy.pi
827 phase = numpy.arctan2(avgcoherenceComplex.imag, avgcoherenceComplex.real)*180/numpy.pi
828 # avg = numpy.average(phase, axis=0)
829 z = phase.reshape((1,-1))
826 830
827 831 title = "Phase %d%d: %s" %(pair[0], pair[1], thisDatetime.strftime("%d-%b-%Y %H:%M:%S"))
828 832 axes = self.axesList[i*self.__nsubplots*2 + counter]
829 833 axes.pcolor(x, y, z,
830 834 xmin=tmin, xmax=tmax, ymin=ymin, ymax=ymax, zmin=-180, zmax=180,
831 835 xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True,
832 ticksize=9, cblabel='', colormap='RdBu', cbsize="1%")
836 ticksize=9, cblabel='', colormap=phase_cmap, cbsize="1%")
833 837
834 838 if self.__showprofile:
835 839 counter += 1
836 840 axes = self.axesList[i*self.__nsubplots*2 + counter]
837 axes.pline(avg, y,
841 axes.pline(phase, y,
838 842 xmin=-180, xmax=180, ymin=ymin, ymax=ymax,
839 843 xlabel='', ylabel='', title='', ticksize=7,
840 844 ytick_visible=False, nxticks=4,
General Comments 0
You need to be logged in to leave comments. Login now