##// END OF EJS Templates
15/3/18
ebocanegra -
r1149:c513dba92d21
parent child
Show More
@@ -128,12 +128,13 class SpcParamPlot(Figure):
128 else:
128 else:
129 x = dataOut.spcparam_range[2]
129 x = dataOut.spcparam_range[2]
130 xlabel = "Velocity (m/s)"
130 xlabel = "Velocity (m/s)"
131 print "Vmax=",x[-1]
131
132
132 ylabel = "Range (Km)"
133 ylabel = "Range (Km)"
133
134
134 y = dataOut.getHeiRange()
135 y = dataOut.getHeiRange()
135
136
136 z = dataOut.SPCparam[Selector] #GauSelector] #dataOut.data_spc/factor
137 z = dataOut.SPCparam[Selector] /1966080.0#/ dataOut.normFactor#GauSelector] #dataOut.data_spc/factor
137 #print 'GausSPC', z[0,32,10:40]
138 #print 'GausSPC', z[0,32,10:40]
138 z = numpy.where(numpy.isfinite(z), z, numpy.NAN)
139 z = numpy.where(numpy.isfinite(z), z, numpy.NAN)
139 zdB = 10*numpy.log10(z)
140 zdB = 10*numpy.log10(z)
@@ -141,7 +141,7 class SpectraPlot(Figure):
141 ylabel = "Range (Km)"
141 ylabel = "Range (Km)"
142
142
143 y = dataOut.getHeiRange()
143 y = dataOut.getHeiRange()
144
144 print 'dataOut.normFactor', dataOut.normFactor
145 z = dataOut.data_spc/factor
145 z = dataOut.data_spc/factor
146 z = numpy.where(numpy.isfinite(z), z, numpy.NAN)
146 z = numpy.where(numpy.isfinite(z), z, numpy.NAN)
147 zdB = 10*numpy.log10(z)
147 zdB = 10*numpy.log10(z)
@@ -28,7 +28,6 from scipy.optimize import curve_fit
28 import warnings
28 import warnings
29 from numpy import NaN
29 from numpy import NaN
30 from scipy.optimize.optimize import OptimizeWarning
30 from scipy.optimize.optimize import OptimizeWarning
31 from IPython.parallel.controller.scheduler import numpy
32 warnings.filterwarnings('ignore')
31 warnings.filterwarnings('ignore')
33
32
34
33
@@ -213,11 +212,12 class SpectralFilters(Operation):
213 Operation.__init__(self, **kwargs)
212 Operation.__init__(self, **kwargs)
214 self.i=0
213 self.i=0
215
214
216 def run(self, dataOut, Rain_Velocity_Limit=1.5, Wind_Velocity_Limit=2.5):
215 def run(self, dataOut, PositiveLimit=1.5, NegativeLimit=2.5):
216
217
217
218 #Limite de vientos
218 #Limite de vientos
219 LimitR = Rain_Velocity_Limit
219 LimitR = PositiveLimit
220 LimitW = Wind_Velocity_Limit
220 LimitN = NegativeLimit
221
221
222 self.spc = dataOut.data_pre[0].copy()
222 self.spc = dataOut.data_pre[0].copy()
223 self.cspc = dataOut.data_pre[1].copy()
223 self.cspc = dataOut.data_pre[1].copy()
@@ -234,29 +234,31 class SpectralFilters(Operation):
234 Tmax= 2*numpy.max(dataOut.spc_range[1])
234 Tmax= 2*numpy.max(dataOut.spc_range[1])
235 Fmax= 2*numpy.max(dataOut.spc_range[0])
235 Fmax= 2*numpy.max(dataOut.spc_range[0])
236
236
237 Breaker1R=VelRange[numpy.abs(VelRange-(-LimitR)).argmin()]
237 Breaker1R=VelRange[numpy.abs(VelRange-(-LimitN)).argmin()]
238 Breaker1R=numpy.where(VelRange == Breaker1R)
238 Breaker1R=numpy.where(VelRange == Breaker1R)
239
239
240 Breaker1W=VelRange[numpy.abs(VelRange-(-LimitW)).argmin()]
240 Delta = self.Num_Bin/2 - Breaker1R[0]
241 Breaker1W=numpy.where(VelRange == Breaker1W)
241
242 #Breaker1W=VelRange[numpy.abs(VelRange-(-LimitW)).argmin()]
243 #Breaker1W=numpy.where(VelRange == Breaker1W)
242
244
243 Breaker2W=VelRange[numpy.abs(VelRange-(LimitW)).argmin()]
245 #Breaker2W=VelRange[numpy.abs(VelRange-(LimitW)).argmin()]
244 Breaker2W=numpy.where(VelRange == Breaker2W)
246 #Breaker2W=numpy.where(VelRange == Breaker2W)
245
247
246
248
247 '''Reacomodando SPCrange'''
249 '''Reacomodando SPCrange'''
248
250
249 VelRange=numpy.roll(VelRange,-Breaker1R[0],axis=0)
251 VelRange=numpy.roll(VelRange,-(self.Num_Bin/2) ,axis=0)
250
252
251 VelRange[-int(Breaker1R[0]):]+= Vmax
253 VelRange[-(self.Num_Bin/2):]+= Vmax
252
254
253 FrecRange=numpy.roll(FrecRange,-Breaker1R[0],axis=0)
255 FrecRange=numpy.roll(FrecRange,-(self.Num_Bin/2),axis=0)
254
256
255 FrecRange[-int(Breaker1R[0]):]+= Fmax
257 FrecRange[-(self.Num_Bin/2):]+= Fmax
256
258
257 TimeRange=numpy.roll(TimeRange,-Breaker1R[0],axis=0)
259 TimeRange=numpy.roll(TimeRange,-(self.Num_Bin/2),axis=0)
258
260
259 TimeRange[-int(Breaker1R[0]):]+= Tmax
261 TimeRange[-(self.Num_Bin/2):]+= Tmax
260
262
261 ''' ------------------ '''
263 ''' ------------------ '''
262
264
@@ -264,21 +266,23 class SpectralFilters(Operation):
264 Breaker2R=numpy.where(VelRange == Breaker2R)
266 Breaker2R=numpy.where(VelRange == Breaker2R)
265
267
266
268
267
269 SPCroll = numpy.roll(self.spc,-(self.Num_Bin/2) ,axis=1)
268
269 SPCroll = numpy.roll(self.spc,-Breaker1R[0],axis=1)
270
270
271 SPCcut = SPCroll.copy()
271 SPCcut = SPCroll.copy()
272 for i in range(self.Num_Chn):
272 for i in range(self.Num_Chn):
273
273 SPCcut[i,0:int(Breaker2R[0]),:] = dataOut.noise[i]
274 SPCcut[i,0:int(Breaker2R[0]),:] = dataOut.noise[i]
275 SPCcut[i,-int(Delta):,:] = dataOut.noise[i]
274
276
275 self.spc[i, 0:int(Breaker1W[0]) ,:] = dataOut.noise[i]
277 #self.spc[i, 0:int(Breaker1W[0]) ,:] = dataOut.noise[i]
276 self.spc[i, int(Breaker2W[0]):self.Num_Bin ,:] = dataOut.noise[i]
278 #self.spc[i, int(Breaker2W[0]):self.Num_Bin ,:] = dataOut.noise[i]
277
279
278 self.cspc[i, 0:int(Breaker1W[0]) ,:] = dataOut.noise[i]
280 #self.cspc[i, 0:int(Breaker1W[0]) ,:] = dataOut.noise[i]
279 self.cspc[i, int(Breaker2W[0]):self.Num_Bin ,:] = dataOut.noise[i]
281 #self.cspc[i, int(Breaker2W[0]):self.Num_Bin ,:] = dataOut.noise[i]
280
282
281
283
284
285
282 SPC_ch1 = SPCroll
286 SPC_ch1 = SPCroll
283
287
284 SPC_ch2 = SPCcut
288 SPC_ch2 = SPCcut
@@ -286,7 +290,7 class SpectralFilters(Operation):
286 SPCparam = (SPC_ch1, SPC_ch2, self.spc)
290 SPCparam = (SPC_ch1, SPC_ch2, self.spc)
287 dataOut.SPCparam = numpy.asarray(SPCparam)
291 dataOut.SPCparam = numpy.asarray(SPCparam)
288
292
289 dataOut.data_pre= (self.spc , self.cspc)
293 #dataOut.data_pre= (self.spc , self.cspc)
290
294
291 #dataOut.data_preParam = (self.spc , self.cspc)
295 #dataOut.data_preParam = (self.spc , self.cspc)
292
296
@@ -712,8 +716,8 class PrecipitationProc(Operation):
712 tauW=4e-06, ThetaT=0.1656317, ThetaR=0.36774087, Km = 0.93, Altitude=3350):
716 tauW=4e-06, ThetaT=0.1656317, ThetaR=0.36774087, Km = 0.93, Altitude=3350):
713
717
714
718
715 Velrange = dataOut.spc_range[2]
719 Velrange = dataOut.spcparam_range[2]
716 FrecRange = dataOut.spc_range[0]
720 FrecRange = dataOut.spcparam_range[0]
717
721
718 dV= Velrange[1]-Velrange[0]
722 dV= Velrange[1]-Velrange[0]
719 dF= FrecRange[1]-FrecRange[0]
723 dF= FrecRange[1]-FrecRange[0]
@@ -728,7 +732,7 class PrecipitationProc(Operation):
728
732
729 else:
733 else:
730
734
731 self.spc = dataOut.SPCparam[1] #dataOut.data_pre[0].copy() #
735 self.spc = dataOut.SPCparam[1].copy() #dataOut.data_pre[0].copy() #
732 self.Num_Hei = self.spc.shape[2]
736 self.Num_Hei = self.spc.shape[2]
733 self.Num_Bin = self.spc.shape[1]
737 self.Num_Bin = self.spc.shape[1]
734 self.Num_Chn = self.spc.shape[0]
738 self.Num_Chn = self.spc.shape[0]
@@ -748,18 +752,26 class PrecipitationProc(Operation):
748
752
749 Numerator = ( (4*numpy.pi)**3 * aL**2 * 16 * numpy.log(2) )
753 Numerator = ( (4*numpy.pi)**3 * aL**2 * 16 * numpy.log(2) )
750 Denominator = ( Pt * Gt * Gr * Lambda**2 * SPEED_OF_LIGHT * tauW * numpy.pi * ThetaT * ThetaR)
754 Denominator = ( Pt * Gt * Gr * Lambda**2 * SPEED_OF_LIGHT * tauW * numpy.pi * ThetaT * ThetaR)
751 RadarConstant = 4.1396e+08# Numerator / Denominator
755 RadarConstant = 1/4.1396e+08# Numerator / Denominator #
752 print '***'
756 print '***'
753 print '*** RadarConstant' , RadarConstant, '****'
757 print '*** RadarConstant' , RadarConstant, '****'
754 print '***'
758 print '***'
755 ''' ============================= '''
759 ''' ============================= '''
756
760
757 SPCmean = numpy.mean(self.spc,0)
761 self.spc[0] = self.spc[0]-dataOut.noise[0]
758 ETAf = numpy.zeros([self.Num_Bin,self.Num_Hei])
762 self.spc[1] = self.spc[1]-dataOut.noise[1]
763 self.spc[2] = self.spc[2]-dataOut.noise[2]
764
765 self.spc[ numpy.where(self.spc < 0)] = 0
766
767 SPCmean = numpy.mean(self.spc,0) - numpy.mean(dataOut.noise)
768 SPCmean[ numpy.where(SPCmean < 0)] = 1e-20
769
770 ETAn = numpy.zeros([self.Num_Bin,self.Num_Hei])
759 ETAv = numpy.zeros([self.Num_Bin,self.Num_Hei])
771 ETAv = numpy.zeros([self.Num_Bin,self.Num_Hei])
760 ETAd = numpy.zeros([self.Num_Bin,self.Num_Hei])
772 ETAd = numpy.zeros([self.Num_Bin,self.Num_Hei])
761
773
762 Pr = self.spc[0,:,:]
774 Pr = SPCmean[:,:]
763
775
764 VelMeteoro = numpy.mean(SPCmean,axis=0)
776 VelMeteoro = numpy.mean(SPCmean,axis=0)
765
777
@@ -774,23 +786,31 class PrecipitationProc(Operation):
774 Ze = numpy.zeros(self.Num_Hei)
786 Ze = numpy.zeros(self.Num_Hei)
775 RR = numpy.zeros(self.Num_Hei)
787 RR = numpy.zeros(self.Num_Hei)
776
788
789 Range = dataOut.heightList*1000.
777
790
778 for R in range(self.Num_Hei):
791 for R in range(self.Num_Hei):
779
792
780 h = R*75 + Altitude #Range from ground to radar pulse altitude
793 h = Range[R] + Altitude #Range from ground to radar pulse altitude
781 del_V[R] = 1 + 3.68 * 10**-5 * h + 1.71 * 10**-9 * h**2 #Density change correction for velocity
794 del_V[R] = 1 + 3.68 * 10**-5 * h + 1.71 * 10**-9 * h**2 #Density change correction for velocity
782
795
783 D_range[:,R] = numpy.log( (9.65 - (Velrange[0:self.Num_Bin] / del_V[R])) / 10.3 ) / -0.6 #Range of Diameter of drops related to velocity
796 D_range[:,R] = numpy.log( (9.65 - (Velrange[0:self.Num_Bin] / del_V[R])) / 10.3 ) / -0.6 #Diameter range [m]x10**-3
797
798 '''NOTA: ETA(n) dn = ETA(f) df
799
800 dn = 1 Diferencial de muestreo
801 df = ETA(n) / ETA(f)
802
803 '''
784
804
785 ETAf[:,R] = 1/RadarConstant * Pr[:,R] * (R*0.075)**2 #Reflectivity (ETA)
805 ETAn[:,R] = RadarConstant * Pr[:,R] * (Range[R] )**2 #Reflectivity (ETA)
786
806
787 ETAv[:,R]=ETAf[:,R]*dF/dV
807 ETAv[:,R]=ETAn[:,R]/dV
788
808
789 ETAd[:,R]=ETAv[:,R]*6.18*exp(-0.6*D_range[:,R])
809 ETAd[:,R]=ETAv[:,R]*6.18*exp(-0.6*D_range[:,R])
790
810
791 SIGMA[:,R] = numpy.pi**5 / Lambda**4 * Km * D_range[:,R]**6 #Equivalent Section of drops (sigma)
811 SIGMA[:,R] = Km * (D_range[:,R] * 1e-3 )**6 * numpy.pi**5 / Lambda**4 #Equivalent Section of drops (sigma)
792
812
793 N_dist[:,R] = ETAd[:,R] / SIGMA[:,R]
813 N_dist[:,R] = ETAn[:,R] / SIGMA[:,R]
794
814
795 DMoments = self.Moments(Pr[:,R], D_range[:,R])
815 DMoments = self.Moments(Pr[:,R], D_range[:,R])
796
816
@@ -801,11 +821,11 class PrecipitationProc(Operation):
801 popt01[1]= DMoments[1]
821 popt01[1]= DMoments[1]
802 D_mean[R]=popt01[1]
822 D_mean[R]=popt01[1]
803
823
804 Z[R] = numpy.nansum( N_dist[:,R] * D_range[:,R]**6 )
824 Z[R] = numpy.nansum( N_dist[:,R] * (D_range[:,R])**6 )*1e-18
805
825
806 RR[R] = 6*10**-4.*numpy.pi * numpy.nansum( D_range[:,R]**3 * N_dist[:,R] * Velrange[0:self.Num_Bin] ) #Rainfall rate
826 RR[R] = 6*10**-4.*numpy.pi * numpy.nansum( D_range[:,R]**3 * N_dist[:,R] * Velrange[0:self.Num_Bin] ) #Rainfall rate
807
827
808 Ze[R] = (numpy.nansum(ETAd[:,R]) * Lambda**4) / (numpy.pi * Km)
828 Ze[R] = (numpy.nansum( ETAn[:,R]) * Lambda**4) / ( numpy.pi**5 * Km)
809
829
810
830
811
831
@@ -822,12 +842,24 class PrecipitationProc(Operation):
822
842
823 dataOut.data_param[0]=dBZ
843 dataOut.data_param[0]=dBZ
824 dataOut.data_param[1]=dBZe
844 dataOut.data_param[1]=dBZe
825 dataOut.data_param[2]=dBRR2
845 dataOut.data_param[2]=RR
826
846
827 print 'RR SHAPE', dBRR.shape
847 #print 'VELRANGE', Velrange
828 #print 'Ze ', dBZe
848 print 'Range', len(Range)
849 print 'delv',del_V
850 #print 'DRANGE', D_range[:,50]
851 print 'NOISE', dataOut.noise[0]
852 print 'radarconstant', RadarConstant
853 print 'Range', Range
854 print 'ETAn SHAPE', ETAn.shape
855 print 'ETAn ', numpy.nansum(ETAn, axis=0)
856 print 'ETAd ', numpy.nansum(ETAd, axis=0)
857 print 'Pr ', numpy.nansum(Pr, axis=0)
858 print 'dataOut.SPCparam[1]', numpy.nansum(dataOut.SPCparam[1][0], axis=0)
859 print 'Ze ', dBZe
829 print 'Z ', dBZ
860 print 'Z ', dBZ
830 print 'RR ', dBRR
861 #print 'RR2 ', RR2
862 #print 'RR ', RR
831 #print 'RR2 ', dBRR2
863 #print 'RR2 ', dBRR2
832 #print 'D_mean', D_mean
864 #print 'D_mean', D_mean
833 #print 'del_V', del_V
865 #print 'del_V', del_V
@@ -937,9 +969,9 class FullSpectralAnalysis(Operation):
937
969
938 dataOut.data_SNR = (numpy.mean(spc,axis=1)- noise[0]) / noise[0]
970 dataOut.data_SNR = (numpy.mean(spc,axis=1)- noise[0]) / noise[0]
939
971
972 dataOut.data_SNR[numpy.where( dataOut.data_SNR <0 )] = 1e-20
973
940
974
941
942 print dataOut.data_SNR.shape
943 #FirstMoment = dataOut.moments[0,1,:]#numpy.average(dataOut.data_param[:,1,:],0)
975 #FirstMoment = dataOut.moments[0,1,:]#numpy.average(dataOut.data_param[:,1,:],0)
944 #SecondMoment = numpy.average(dataOut.moments[:,2,:],0)
976 #SecondMoment = numpy.average(dataOut.moments[:,2,:],0)
945
977
@@ -1023,7 +1055,6 class FullSpectralAnalysis(Operation):
1023 def Moments(self, ySamples, xSamples):
1055 def Moments(self, ySamples, xSamples):
1024 Pot = numpy.nansum( ySamples ) # Potencia, momento 0
1056 Pot = numpy.nansum( ySamples ) # Potencia, momento 0
1025 yNorm = ySamples / Pot
1057 yNorm = ySamples / Pot
1026
1027 Vr = numpy.nansum( yNorm * xSamples ) # Velocidad radial, mu, corrimiento doppler, primer momento
1058 Vr = numpy.nansum( yNorm * xSamples ) # Velocidad radial, mu, corrimiento doppler, primer momento
1028 Sigma2 = abs(numpy.nansum( yNorm * ( xSamples - Vr )**2 )) # Segundo Momento
1059 Sigma2 = abs(numpy.nansum( yNorm * ( xSamples - Vr )**2 )) # Segundo Momento
1029 Desv = Sigma2**0.5 # Desv. Estandar, Ancho espectral
1060 Desv = Sigma2**0.5 # Desv. Estandar, Ancho espectral
@@ -1032,9 +1063,7 class FullSpectralAnalysis(Operation):
1032
1063
1033 def WindEstimation(self, spc, cspc, pairsList, ChanDist, Height, noise, AbbsisaRange, dbSNR, SNRlimit):
1064 def WindEstimation(self, spc, cspc, pairsList, ChanDist, Height, noise, AbbsisaRange, dbSNR, SNRlimit):
1034
1065
1035 # print ' '
1066
1036 # print '######################## Height',Height, (1000 + 75*Height), '##############################'
1037 # print ' '
1038
1067
1039 ySamples=numpy.ones([spc.shape[0],spc.shape[1]])
1068 ySamples=numpy.ones([spc.shape[0],spc.shape[1]])
1040 phase=numpy.ones([spc.shape[0],spc.shape[1]])
1069 phase=numpy.ones([spc.shape[0],spc.shape[1]])
@@ -1113,7 +1142,7 class FullSpectralAnalysis(Operation):
1113 # print CSPCmoments
1142 # print CSPCmoments
1114 # print '#######################'
1143 # print '#######################'
1115
1144
1116 popt=[1e-10,1e-10,1e-10]
1145 popt=[1e-10,0,1e-10]
1117 popt01, popt02, popt12 = [1e-10,1e-10,1e-10], [1e-10,1e-10,1e-10] ,[1e-10,1e-10,1e-10]
1146 popt01, popt02, popt12 = [1e-10,1e-10,1e-10], [1e-10,1e-10,1e-10] ,[1e-10,1e-10,1e-10]
1118 FitGauss01, FitGauss02, FitGauss12 = numpy.empty(len(xSamples))*0, numpy.empty(len(xSamples))*0, numpy.empty(len(xSamples))*0
1147 FitGauss01, FitGauss02, FitGauss12 = numpy.empty(len(xSamples))*0, numpy.empty(len(xSamples))*0, numpy.empty(len(xSamples))*0
1119
1148
@@ -1134,7 +1163,7 class FullSpectralAnalysis(Operation):
1134
1163
1135
1164
1136 '''***Fit Gauss CSPC01***'''
1165 '''***Fit Gauss CSPC01***'''
1137 if dbSNR > SNRlimit:
1166 if dbSNR > SNRlimit and numpy.abs(SPCmoments[1])<3 :
1138 try:
1167 try:
1139 popt01,pcov = curve_fit(self.gaus,xSamples[mask01],numpy.abs(CSPCMask01),p0=CSPCmoments[0])
1168 popt01,pcov = curve_fit(self.gaus,xSamples[mask01],numpy.abs(CSPCMask01),p0=CSPCmoments[0])
1140 popt02,pcov = curve_fit(self.gaus,xSamples[mask02],numpy.abs(CSPCMask02),p0=CSPCmoments[1])
1169 popt02,pcov = curve_fit(self.gaus,xSamples[mask02],numpy.abs(CSPCMask02),p0=CSPCmoments[1])
@@ -1160,7 +1189,7 class FullSpectralAnalysis(Operation):
1160
1189
1161 yMoments = self.Moments(yMean, xSamples)
1190 yMoments = self.Moments(yMean, xSamples)
1162
1191
1163 if dbSNR > SNRlimit: # and abs(meanGauss/sigma2) > 0.00001:
1192 if dbSNR > SNRlimit and numpy.abs(SPCmoments[1])<3: # and abs(meanGauss/sigma2) > 0.00001:
1164 try:
1193 try:
1165 popt,pcov = curve_fit(self.gaus,xSamples,yMean,p0=yMoments)
1194 popt,pcov = curve_fit(self.gaus,xSamples,yMean,p0=yMoments)
1166 FitGauss=self.gaus(xSamples,*popt)
1195 FitGauss=self.gaus(xSamples,*popt)
@@ -1177,7 +1206,7 class FullSpectralAnalysis(Operation):
1177 '''****** Getting Fij ******'''
1206 '''****** Getting Fij ******'''
1178 Fijcspc = CSPCopt[:,2]/2*3
1207 Fijcspc = CSPCopt[:,2]/2*3
1179
1208
1180 #GauWidth = (popt[2]/2)*3
1209
1181 GaussCenter = popt[1] #xFrec[GCpos]
1210 GaussCenter = popt[1] #xFrec[GCpos]
1182 #Punto en Eje X de la Gaussiana donde se encuentra el centro
1211 #Punto en Eje X de la Gaussiana donde se encuentra el centro
1183 ClosestCenter = xSamples[numpy.abs(xSamples-GaussCenter).argmin()]
1212 ClosestCenter = xSamples[numpy.abs(xSamples-GaussCenter).argmin()]
@@ -1242,7 +1271,7 class FullSpectralAnalysis(Operation):
1242
1271
1243 for i in range(spc.shape[0]):
1272 for i in range(spc.shape[0]):
1244
1273
1245 if len(FrecRange)>5 and len(FrecRange)<spc.shape[1]*0.6:
1274 if len(FrecRange)>5 and len(FrecRange)<spc.shape[1]*0.3:
1246 PhaseRange=self.moving_average(phase[i,Range[0]:Range[1]],N=3)
1275 PhaseRange=self.moving_average(phase[i,Range[0]:Range[1]],N=3)
1247
1276
1248 #print 'Ancho espectral Frecuencias', FrecRange[-1]-FrecRange[0], 'Hz'
1277 #print 'Ancho espectral Frecuencias', FrecRange[-1]-FrecRange[0], 'Hz'
@@ -1310,7 +1339,10 class FullSpectralAnalysis(Operation):
1310 Vmer = Vx
1339 Vmer = Vx
1311 Vmag=numpy.sqrt(Vzon**2+Vmer**2)
1340 Vmag=numpy.sqrt(Vzon**2+Vmer**2)
1312 Vang=numpy.arctan2(Vmer,Vzon)
1341 Vang=numpy.arctan2(Vmer,Vzon)
1313 Vver=SPCmoments[1]
1342 if numpy.abs( popt[1] ) < 3.5 and len(FrecRange)>4:
1343 Vver=popt[1]
1344 else:
1345 Vver=numpy.NaN
1314 FitGaussCSPC = numpy.array([FitGauss01,FitGauss02,FitGauss12])
1346 FitGaussCSPC = numpy.array([FitGauss01,FitGauss02,FitGauss12])
1315
1347
1316
1348
@@ -1458,6 +1490,7 class SpectralMoments(Operation):
1458 valid = numpy.asarray(range(int(m + bb0 - ss1 + 1))) + ss1
1490 valid = numpy.asarray(range(int(m + bb0 - ss1 + 1))) + ss1
1459 power = ( (spec2[valid] - n0) * fwindow[valid] ).sum()
1491 power = ( (spec2[valid] - n0) * fwindow[valid] ).sum()
1460 fd = ( (spec2[valid]- n0) * freq[valid] * fwindow[valid] ).sum() / power
1492 fd = ( (spec2[valid]- n0) * freq[valid] * fwindow[valid] ).sum() / power
1493
1461 w = math.sqrt(((spec2[valid] - n0)*fwindow[valid]*(freq[valid]- fd)**2).sum()/power)
1494 w = math.sqrt(((spec2[valid] - n0)*fwindow[valid]*(freq[valid]- fd)**2).sum()/power)
1462 snr = (spec2.mean()-n0)/n0
1495 snr = (spec2.mean()-n0)/n0
1463
1496
@@ -1,1 +1,1
1 <Project description="Segundo Test" id="191" name="test01"><ReadUnit datatype="SpectraReader" id="1911" inputId="0" name="SpectraReader"><Operation id="19111" name="run" priority="1" type="self"><Parameter format="str" id="191111" name="datatype" value="SpectraReader" /><Parameter format="str" id="191112" name="path" value="/media/erick/6F60F7113095A154/CLAIRE/CLAIRE_WINDS_2MHZ/DATA/pdataCLAIRE/Extra" /><Parameter format="date" id="191113" name="startDate" value="2018/02/01" /><Parameter format="date" id="191114" name="endDate" value="2018/02/01" /><Parameter format="time" id="191115" name="startTime" value="17:00:00" /><Parameter format="time" id="191116" name="endTime" value="20:00:00" /><Parameter format="int" id="191118" name="online" value="0" /><Parameter format="int" id="191119" name="walk" value="1" /></Operation><Operation id="19112" name="printInfo" priority="2" type="self" /><Operation id="19113" name="printNumberOfBlock" priority="3" type="self" /></ReadUnit><ProcUnit datatype="Parameters" id="1913" inputId="1912" name="ParametersProc"><Operation id="19131" name="run" priority="1" type="self" /><Operation id="19132" name="SpectralFilters" priority="2" type="other"><Parameter format="float" id="191321" name="Wind_Velocity_Limit" value="2.5" /><Parameter format="float" id="191322" name="Rain_Velocity_Limit" value="1.5" /></Operation><Operation id="19133" name="FullSpectralAnalysis" priority="3" type="other"><Parameter format="float" id="191331" name="SNRlimit" value="-16" /><Parameter format="float" id="191332" name="E01" value="1.500" /><Parameter format="float" id="191333" name="E02" value="1.500" /><Parameter format="float" id="191334" name="E12" value="0" /><Parameter format="float" id="191335" name="N01" value="0.875" /><Parameter format="float" id="191336" name="N02" value="-0.875" /><Parameter format="float" id="191337" name="N12" value="-1.750" /></Operation><Operation id="19134" name="WindProfilerPlot" priority="4" type="other"><Parameter format="int" id="191341" name="id" value="4" /><Parameter format="str" id="191342" name="wintitle" value="Wind Profiler" /><Parameter format="float" id="191343" name="xmin" value="17" /><Parameter format="float" id="191344" name="xmax" value="20" /><Parameter format="float" id="191345" name="ymin" value="0" /><Parameter format="int" id="191346" name="ymax" value="8" /><Parameter format="float" id="191347" name="zmin" value="-20" /><Parameter format="float" id="191348" name="zmax" value="20" /><Parameter format="float" id="191349" name="SNRmin" value="-20" /><Parameter format="float" id="191350" name="SNRmax" value="20" /><Parameter format="float" id="191351" name="zmin_ver" value="-200" /><Parameter format="float" id="191352" name="zmax_ver" value="200" /><Parameter format="float" id="191353" name="SNRthresh" value="-20" /><Parameter format="int" id="191354" name="save" value="1" /><Parameter format="str" id="191355" name="figpath" value="/media/erick/6F60F7113095A154/CLAIRE/CLAIRE_WINDS_2MHZ/DATA/pdataCLAIRE/Extra" /></Operation><Operation id="19135" name="PrecipitationProc" priority="5" type="other" /><Operation id="19136" name="ParametersPlot" priority="6" type="other"><Parameter format="int" id="191361" name="id" value="10" /><Parameter format="str" id="191362" name="wintitle" value="First_gg" /><Parameter format="int" id="191363" name="zmin" value="-20" /><Parameter format="int" id="191364" name="zmax" value="60" /><Parameter format="int" id="191365" name="ymin" value="0" /><Parameter format="int" id="191366" name="ymax" value="8" /><Parameter format="int" id="191367" name="xmin" value="17" /><Parameter format="int" id="191368" name="xmax" value="20" /><Parameter format="int" id="191369" name="save" value="1" /><Parameter format="str" id="191370" name="figpath" value="/media/erick/6F60F7113095A154/CLAIRE/CLAIRE_WINDS_2MHZ/DATA/pdataCLAIRE/Extra" /></Operation><Operation id="19137" name="ParamWriter" priority="7" type="other"><Parameter format="str" id="191371" name="path" value="/media/erick/6F60F7113095A154/CLAIRE/CLAIRE_WINDS_2MHZ/DATA/pdatatest/test1024" /><Parameter format="int" id="191372" name="blocksPerFile" value="100" /><Parameter format="list" id="191373" name="metadataList" value="heightList,timeZone,paramInterval" /><Parameter format="list" id="191374" name="dataList" value="data_output,data_SNR,utctime,utctimeInit" /></Operation></ProcUnit><ProcUnit datatype="SpectraProc" id="1912" inputId="1911" name="SpectraProc"><Operation id="19121" name="run" priority="1" type="self" /><Operation id="19122" name="setRadarFrequency" priority="2" type="self"><Parameter format="float" id="191221" name="frequency" value="445.09e6" /></Operation></ProcUnit></Project> No newline at end of file
1 <Project description="Segundo Test" id="191" name="test01"><ReadUnit datatype="SpectraReader" id="1911" inputId="0" name="SpectraReader"><Operation id="19111" name="run" priority="1" type="self"><Parameter format="str" id="191111" name="datatype" value="SpectraReader" /><Parameter format="str" id="191112" name="path" value="/media/erick/6F60F7113095A154/CLAIRE/CLAIRE_WINDS_2MHZ/DATA/pdataCLAIRE/Extra" /><Parameter format="date" id="191113" name="startDate" value="2018/02/01" /><Parameter format="date" id="191114" name="endDate" value="2018/02/01" /><Parameter format="time" id="191115" name="startTime" value="17:00:00" /><Parameter format="time" id="191116" name="endTime" value="20:00:00" /><Parameter format="int" id="191118" name="online" value="0" /><Parameter format="int" id="191119" name="walk" value="1" /></Operation><Operation id="19112" name="printInfo" priority="2" type="self" /><Operation id="19113" name="printNumberOfBlock" priority="3" type="self" /></ReadUnit><ProcUnit datatype="Parameters" id="1913" inputId="1912" name="ParametersProc"><Operation id="19131" name="run" priority="1" type="self" /><Operation id="19132" name="SpectralFilters" priority="2" type="other"><Parameter format="float" id="191321" name="PositiveLimit" value="1.5" /><Parameter format="float" id="191322" name="NegativeLimit" value="3.5" /></Operation><Operation id="19133" name="FullSpectralAnalysis" priority="3" type="other"><Parameter format="float" id="191331" name="SNRlimit" value="-16" /><Parameter format="float" id="191332" name="E01" value="1.500" /><Parameter format="float" id="191333" name="E02" value="1.500" /><Parameter format="float" id="191334" name="E12" value="0" /><Parameter format="float" id="191335" name="N01" value="0.875" /><Parameter format="float" id="191336" name="N02" value="-0.875" /><Parameter format="float" id="191337" name="N12" value="-1.750" /></Operation><Operation id="19134" name="WindProfilerPlot" priority="4" type="other"><Parameter format="int" id="191341" name="id" value="4" /><Parameter format="str" id="191342" name="wintitle" value="Wind Profiler" /><Parameter format="float" id="191343" name="xmin" value="17" /><Parameter format="float" id="191344" name="xmax" value="20" /><Parameter format="float" id="191345" name="ymin" value="0" /><Parameter format="int" id="191346" name="ymax" value="11" /><Parameter format="float" id="191347" name="zmin" value="-20" /><Parameter format="float" id="191348" name="zmax" value="20" /><Parameter format="float" id="191349" name="SNRmin" value="-20" /><Parameter format="float" id="191350" name="SNRmax" value="20" /><Parameter format="float" id="191351" name="zmin_ver" value="-200" /><Parameter format="float" id="191352" name="zmax_ver" value="200" /><Parameter format="float" id="191353" name="SNRthresh" value="-20" /><Parameter format="int" id="191354" name="save" value="1" /><Parameter format="str" id="191355" name="figpath" value="/media/erick/6F60F7113095A154/CLAIRE/CLAIRE_WINDS_2MHZ/DATA/pdataCLAIRE/Extra" /></Operation><Operation id="19135" name="PrecipitationProc" priority="5" type="other" /><Operation id="19136" name="ParametersPlot" priority="6" type="other"><Parameter format="int" id="191361" name="id" value="10" /><Parameter format="str" id="191362" name="wintitle" value="First_gg" /><Parameter format="str" id="191363" name="colormap" value="ocean_r" /><Parameter format="int" id="191364" name="zmin" value="50" /><Parameter format="int" id="191365" name="zmax" value="100" /><Parameter format="int" id="191366" name="ymin" value="0" /><Parameter format="int" id="191367" name="ymax" value="11" /><Parameter format="int" id="191368" name="xmin" value="17" /><Parameter format="int" id="191369" name="xmax" value="20" /><Parameter format="int" id="191370" name="save" value="1" /><Parameter format="str" id="191371" name="figpath" value="/media/erick/6F60F7113095A154/CLAIRE/CLAIRE_WINDS_2MHZ/DATA/pdataCLAIRE/Extra" /></Operation><Operation id="19137" name="SpcParamPlot" priority="7" type="other"><Parameter format="int" id="191371" name="id" value="21" /><Parameter format="str" id="191372" name="wintitle" value="Primer eco removido" /><Parameter format="str" id="191373" name="xaxis" value="velocity" /><Parameter format="int" id="191374" name="showprofile" value="1" /><Parameter format="int" id="191375" name="zmin" value="10" /><Parameter format="int" id="191376" name="zmax" value="40" /><Parameter format="int" id="191377" name="Selector" value="1" /></Operation><Operation id="19138" name="ParamWriter" priority="8" type="other"><Parameter format="str" id="191381" name="path" value="/media/erick/6F60F7113095A154/CLAIRE/CLAIRE_WINDS_2MHZ/DATA/pdatatest/test1024" /><Parameter format="int" id="191382" name="blocksPerFile" value="100" /><Parameter format="list" id="191383" name="metadataList" value="heightList,timeZone,paramInterval" /><Parameter format="list" id="191384" name="dataList" value="data_output,data_SNR,utctime,utctimeInit" /></Operation></ProcUnit><ProcUnit datatype="SpectraProc" id="1912" inputId="1911" name="SpectraProc"><Operation id="19121" name="run" priority="1" type="self" /><Operation id="19122" name="setRadarFrequency" priority="2" type="self"><Parameter format="float" id="191221" name="frequency" value="445.09e6" /></Operation></ProcUnit></Project> No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now