@@ -526,36 +526,29 class Spectra(JROData): | |||
|
526 | 526 | def getFreqRangeTimeResponse(self, extrapoints=0): |
|
527 | 527 | |
|
528 | 528 | deltafreq = self.getFmaxTimeResponse() / (self.nFFTPoints * self.ippFactor) |
|
529 | freqrange = deltafreq * \ | |
|
530 | (numpy.arange(self.nFFTPoints + extrapoints) - | |
|
531 | self.nFFTPoints / 2.) - deltafreq / 2 | |
|
529 | freqrange = deltafreq * (numpy.arange(self.nFFTPoints + extrapoints) -self.nFFTPoints / 2.) - deltafreq / 2 | |
|
532 | 530 | |
|
533 | 531 | return freqrange |
|
534 | 532 | |
|
535 | 533 | def getAcfRange(self, extrapoints=0): |
|
536 | 534 | |
|
537 | 535 | deltafreq = 10. / (self.getFmax() / (self.nFFTPoints * self.ippFactor)) |
|
538 | freqrange = deltafreq * \ | |
|
539 | (numpy.arange(self.nFFTPoints + extrapoints) - | |
|
540 | self.nFFTPoints / 2.) - deltafreq / 2 | |
|
536 | freqrange = deltafreq * (numpy.arange(self.nFFTPoints + extrapoints) -self.nFFTPoints / 2.) - deltafreq / 2 | |
|
541 | 537 | |
|
542 | 538 | return freqrange |
|
543 | 539 | |
|
544 | 540 | def getFreqRange(self, extrapoints=0): |
|
545 | 541 | |
|
546 | 542 | deltafreq = self.getFmax() / (self.nFFTPoints * self.ippFactor) |
|
547 | freqrange = deltafreq * \ | |
|
548 | (numpy.arange(self.nFFTPoints + extrapoints) - | |
|
549 | self.nFFTPoints / 2.) - deltafreq / 2 | |
|
543 | freqrange = deltafreq * (numpy.arange(self.nFFTPoints + extrapoints) -self.nFFTPoints / 2.) - deltafreq / 2 | |
|
550 | 544 | |
|
551 | 545 | return freqrange |
|
552 | 546 | |
|
553 | 547 | def getVelRange(self, extrapoints=0): |
|
554 | 548 | |
|
555 | 549 | deltav = self.getVmax() / (self.nFFTPoints * self.ippFactor) |
|
556 | velrange = deltav * (numpy.arange(self.nFFTPoints + | |
|
557 | extrapoints) - self.nFFTPoints / 2.) | |
|
558 | ||
|
550 | velrange = deltav * (numpy.arange(self.nFFTPoints + extrapoints) - self.nFFTPoints / 2.) | |
|
551 | ||
|
559 | 552 | if self.nmodes: |
|
560 | 553 | return velrange/self.nmodes |
|
561 | 554 | else: |
@@ -576,8 +569,7 class Spectra(JROData): | |||
|
576 | 569 | if self.flagDecodeData: |
|
577 | 570 | pwcode = numpy.sum(self.code[0]**2) |
|
578 | 571 | #normFactor = min(self.nFFTPoints,self.nProfiles)*self.nIncohInt*self.nCohInt*pwcode*self.windowOfFilter |
|
579 |
normFactor = self.nProfiles * self.nIncohInt * |
|
|
580 | self.nCohInt * pwcode * self.windowOfFilter | |
|
572 | normFactor = self.nProfiles * self.nIncohInt * self.nCohInt * pwcode * self.windowOfFilter | |
|
581 | 573 | |
|
582 | 574 | return normFactor |
|
583 | 575 | |
@@ -597,8 +589,7 class Spectra(JROData): | |||
|
597 | 589 | |
|
598 | 590 | def getTimeInterval(self): |
|
599 | 591 | |
|
600 |
timeInterval = self.ippSeconds * self.nCohInt * |
|
|
601 | self.nIncohInt * self.nProfiles * self.ippFactor | |
|
592 | timeInterval = self.ippSeconds * self.nCohInt * self.nIncohInt * self.nProfiles * self.ippFactor | |
|
602 | 593 | |
|
603 | 594 | return timeInterval |
|
604 | 595 | |
@@ -625,8 +616,7 class Spectra(JROData): | |||
|
625 | 616 | pairsIndexList.append(self.pairsList.index(pair)) |
|
626 | 617 | for i in range(len(pairsIndexList)): |
|
627 | 618 | pair = self.pairsList[pairsIndexList[i]] |
|
628 | ccf = numpy.average( | |
|
629 | self.data_cspc[pairsIndexList[i], :, :], axis=0) | |
|
619 | ccf = numpy.average(self.data_cspc[pairsIndexList[i], :, :], axis=0) | |
|
630 | 620 | powa = numpy.average(self.data_spc[pair[0], :, :], axis=0) |
|
631 | 621 | powb = numpy.average(self.data_spc[pair[1], :, :], axis=0) |
|
632 | 622 | avgcoherenceComplex = ccf / numpy.sqrt(powa * powb) |
@@ -735,7 +735,7 class SkyMapPlot_(Figure): | |||
|
735 | 735 | |
|
736 | 736 | |
|
737 | 737 | |
|
738 | ||
|
738 | @MPDecorator | |
|
739 | 739 | class WindProfilerPlot_(Figure): |
|
740 | 740 | |
|
741 | 741 | __isConfig = None |
@@ -745,8 +745,8 class WindProfilerPlot_(Figure): | |||
|
745 | 745 | HEIGHTPROF = None |
|
746 | 746 | PREFIX = 'wind' |
|
747 | 747 | |
|
748 |
def __init__(self |
|
|
749 |
Figure.__init__(self |
|
|
748 | def __init__(self): | |
|
749 | Figure.__init__(self) | |
|
750 | 750 | self.timerange = None |
|
751 | 751 | self.isConfig = False |
|
752 | 752 | self.__nsubplots = 1 |
@@ -825,6 +825,9 class WindProfilerPlot_(Figure): | |||
|
825 | 825 | zmax : None |
|
826 | 826 | """ |
|
827 | 827 | |
|
828 | if dataOut.flagNoData: | |
|
829 | return dataOut | |
|
830 | ||
|
828 | 831 | # if timerange is not None: |
|
829 | 832 | # self.timerange = timerange |
|
830 | 833 | # |
@@ -836,8 +839,8 class WindProfilerPlot_(Figure): | |||
|
836 | 839 | z = dataOut.data_output.copy() |
|
837 | 840 | nplots = z.shape[0] #Number of wind dimensions estimated |
|
838 | 841 | nplotsw = nplots |
|
839 | ||
|
840 | ||
|
842 | ||
|
843 | ||
|
841 | 844 | #If there is a SNR function defined |
|
842 | 845 | if dataOut.data_SNR is not None: |
|
843 | 846 | nplots += 1 |
@@ -948,6 +951,8 class WindProfilerPlot_(Figure): | |||
|
948 | 951 | self.isConfig = False |
|
949 | 952 | update_figfile = True |
|
950 | 953 | |
|
954 | return dataOut | |
|
955 | ||
|
951 | 956 | @MPDecorator |
|
952 | 957 | class ParametersPlot_(Figure): |
|
953 | 958 | |
@@ -1051,7 +1056,7 class ParametersPlot_(Figure): | |||
|
1051 | 1056 | |
|
1052 | 1057 | if not isTimeInHourRange(dataOut.datatime, xmin, xmax): |
|
1053 | 1058 | return |
|
1054 | ||
|
1059 | ||
|
1055 | 1060 | if channelList == None: |
|
1056 | 1061 | channelIndexList = list(range(dataOut.data_param.shape[0])) |
|
1057 | 1062 | else: |
@@ -226,7 +226,7 def createPcolor(ax, x, y, z, xmin, xmax, ymin, ymax, zmin, zmax, | |||
|
226 | 226 | |
|
227 | 227 | z = numpy.ma.masked_invalid(z) |
|
228 | 228 | cmap = matplotlib.pyplot.get_cmap(colormap) |
|
229 |
cmap.set_bad(' |
|
|
229 | cmap.set_bad('white', 1.) | |
|
230 | 230 | imesh = ax.pcolormesh(x, y, z.T, vmin=zmin, vmax=zmax, cmap=cmap) |
|
231 | 231 | cb = matplotlib.pyplot.colorbar(imesh, cax=ax_cb) |
|
232 | 232 | cb.set_label(cblabel) |
@@ -291,7 +291,7 def addpcolorbuffer(ax, x, y, z, zmin, zmax, xlabel='', ylabel='', title='', col | |||
|
291 | 291 | z = numpy.ma.masked_invalid(z) |
|
292 | 292 | |
|
293 | 293 | cmap = matplotlib.pyplot.get_cmap(colormap) |
|
294 |
cmap.set_bad(' |
|
|
294 | cmap.set_bad('white', 1.) | |
|
295 | 295 | |
|
296 | 296 | ax.pcolormesh(x, y, z.T, vmin=zmin, vmax=zmax, cmap=cmap) |
|
297 | 297 |
@@ -192,10 +192,10 class MADReader(JRODataReader, ProcessingUnit): | |||
|
192 | 192 | self.parameters = one + two |
|
193 | 193 | self.parameters_d = one_d + two_d |
|
194 | 194 | |
|
195 | log.success('Parameters found: {}'.format(','.join(self.parameters)), | |
|
195 | log.success('Parameters found: {}'.format(','.join(str(self.parameters))), | |
|
196 | 196 | 'MADReader') |
|
197 | 197 | if s_parameters: |
|
198 | log.success('Spatial parameters: {}'.format(','.join(s_parameters)), | |
|
198 | log.success('Spatial parameters: {}'.format(','.join(str(s_parameters))), | |
|
199 | 199 | 'MADReader') |
|
200 | 200 | |
|
201 | 201 | for param in list(self.oneDDict.keys()): |
@@ -123,7 +123,7 class ParametersProc(ProcessingUnit): | |||
|
123 | 123 | self.dataOut.ippFactor = self.dataIn.ippFactor |
|
124 | 124 | self.dataOut.abscissaList = self.dataIn.getVelRange(1) |
|
125 | 125 | self.dataOut.spc_noise = self.dataIn.getNoise() |
|
126 |
self.dataOut.spc_range = (self.dataIn.getFreqRange(1) |
|
|
126 | self.dataOut.spc_range = (self.dataIn.getFreqRange(1) , self.dataIn.getAcfRange(1) , self.dataIn.getVelRange(1)) | |
|
127 | 127 | # self.dataOut.normFactor = self.dataIn.normFactor |
|
128 | 128 | self.dataOut.pairsList = self.dataIn.pairsList |
|
129 | 129 | self.dataOut.groupList = self.dataIn.pairsList |
@@ -239,18 +239,18 class SpectralFilters(Operation): | |||
|
239 | 239 | |
|
240 | 240 | |
|
241 | 241 | '''Reacomodando SPCrange''' |
|
242 | ||
|
243 | VelRange=numpy.roll(VelRange,-(int(self.Num_Bin/2)) ,axis=0) | |
|
242 | 244 | |
|
243 |
VelRange |
|
|
244 | ||
|
245 | VelRange[-(self.Num_Bin/2):]+= Vmax | |
|
245 | VelRange[-(int(self.Num_Bin/2)):]+= Vmax | |
|
246 | 246 | |
|
247 | FrecRange=numpy.roll(FrecRange,-(self.Num_Bin/2),axis=0) | |
|
247 | FrecRange=numpy.roll(FrecRange,-(int(self.Num_Bin/2)),axis=0) | |
|
248 | 248 | |
|
249 | FrecRange[-(self.Num_Bin/2):]+= Fmax | |
|
249 | FrecRange[-(int(self.Num_Bin/2)):]+= Fmax | |
|
250 | 250 | |
|
251 | TimeRange=numpy.roll(TimeRange,-(self.Num_Bin/2),axis=0) | |
|
251 | TimeRange=numpy.roll(TimeRange,-(int(self.Num_Bin/2)),axis=0) | |
|
252 | 252 | |
|
253 | TimeRange[-(self.Num_Bin/2):]+= Tmax | |
|
253 | TimeRange[-(int(self.Num_Bin/2)):]+= Tmax | |
|
254 | 254 | |
|
255 | 255 | ''' ------------------ ''' |
|
256 | 256 | |
@@ -258,7 +258,7 class SpectralFilters(Operation): | |||
|
258 | 258 | Breaker2R=numpy.where(VelRange == Breaker2R) |
|
259 | 259 | |
|
260 | 260 | |
|
261 | SPCroll = numpy.roll(self.spc,-(self.Num_Bin/2) ,axis=1) | |
|
261 | SPCroll = numpy.roll(self.spc,-(int(self.Num_Bin/2)) ,axis=1) | |
|
262 | 262 | |
|
263 | 263 | SPCcut = SPCroll.copy() |
|
264 | 264 | for i in range(self.Num_Chn): |
@@ -285,7 +285,7 class SpectralFilters(Operation): | |||
|
285 | 285 | dataOut.spcparam_range[2]=VelRange |
|
286 | 286 | dataOut.spcparam_range[1]=TimeRange |
|
287 | 287 | dataOut.spcparam_range[0]=FrecRange |
|
288 | ||
|
288 | return dataOut | |
|
289 | 289 | |
|
290 | 290 | class GaussianFit(Operation): |
|
291 | 291 | |
@@ -660,7 +660,7 class PrecipitationProc(Operation): | |||
|
660 | 660 | |
|
661 | 661 | Numerator = ( (4*numpy.pi)**3 * aL**2 * 16 * numpy.log(2) ) |
|
662 | 662 | Denominator = ( Pt * Gt * Gr * Lambda**2 * SPEED_OF_LIGHT * tauW * numpy.pi * ThetaT * ThetaR) |
|
663 |
RadarConstant = |
|
|
663 | RadarConstant = 10e-26 * Numerator / Denominator # | |
|
664 | 664 | |
|
665 | 665 | ''' ============================= ''' |
|
666 | 666 | |
@@ -753,6 +753,7 class PrecipitationProc(Operation): | |||
|
753 | 753 | dataOut.data_param[1]=V_mean |
|
754 | 754 | dataOut.data_param[2]=RR |
|
755 | 755 | |
|
756 | return dataOut | |
|
756 | 757 | |
|
757 | 758 | def dBZeMODE2(self, dataOut): # Processing for MIRA35C |
|
758 | 759 | |
@@ -833,7 +834,7 class FullSpectralAnalysis(Operation): | |||
|
833 | 834 | |
|
834 | 835 | SNRspc = spc.copy() |
|
835 | 836 | SNRspc[:,:,0:7]= numpy.NaN |
|
836 |
|
|
|
837 | ||
|
837 | 838 | """##########################################""" |
|
838 | 839 | |
|
839 | 840 | |
@@ -876,8 +877,8 class FullSpectralAnalysis(Operation): | |||
|
876 | 877 | dbSNR = numpy.average(dbSNR,0) |
|
877 | 878 | |
|
878 | 879 | for Height in range(nHeights): |
|
879 | ||
|
880 |
[Vzon,Vmer,Vver, GaussCenter, PhaseSlope, FitGaussCSPC]= self.WindEstimation(spc, cspc, pairsList, ChanDist, Height, noise, dataOut.spc_range |
|
|
880 | ||
|
881 | [Vzon,Vmer,Vver, GaussCenter, PhaseSlope, FitGaussCSPC]= self.WindEstimation(spc, cspc, pairsList, ChanDist, Height, noise, dataOut.spc_range, dbSNR[Height], SNRlimit) | |
|
881 | 882 | PhaseLine = numpy.append(PhaseLine, PhaseSlope) |
|
882 | 883 | |
|
883 | 884 | if abs(Vzon)<100. and abs(Vzon)> 0.: |
@@ -908,7 +909,7 class FullSpectralAnalysis(Operation): | |||
|
908 | 909 | |
|
909 | 910 | dataOut.data_output=data_output |
|
910 | 911 | |
|
911 | return | |
|
912 | return dataOut | |
|
912 | 913 | |
|
913 | 914 | |
|
914 | 915 | def moving_average(self,x, N=2): |
General Comments 0
You need to be logged in to leave comments.
Login now