@@ -0,0 +1,213 | |||
|
1 | # Ing. AVP | |
|
2 | # 06/10/2021 | |
|
3 | # ARCHIVO DE LECTURA | |
|
4 | import os, sys | |
|
5 | import datetime | |
|
6 | import time | |
|
7 | from schainpy.controller import Project | |
|
8 | #### NOTA########################################### | |
|
9 | # INPUT : | |
|
10 | # VELOCIDAD PARAMETRO : V = 2Β°/seg | |
|
11 | # MODO PULSE PAIR O MOMENTOS: 0 : Pulse Pair ,1 : Momentos | |
|
12 | ###################################################### | |
|
13 | ##### PROCESAMIENTO ################################## | |
|
14 | ##### OJO TENER EN CUENTA EL n= para el Pulse Pair ## | |
|
15 | ##### O EL n= nFFTPoints ### | |
|
16 | ###################################################### | |
|
17 | ######## BUSCAMOS EL numero de IPP equivalente 1Β°##### | |
|
18 | ######## Sea V la velocidad del Pedestal en Β°/seg##### | |
|
19 | ######## 1Β° sera Recorrido en un tiempo de 1/V ###### | |
|
20 | ######## IPP del Radar 400 useg --> 60 Km ############ | |
|
21 | ######## n = 1/(V(Β°/seg)*IPP(Km)) , NUMERO DE IPP ## | |
|
22 | ######## n = 1/(V*IPP) ############################# | |
|
23 | ######## VELOCIDAD DEL PEDESTAL ###################### | |
|
24 | print("SETUP- RADAR METEOROLOGICO") | |
|
25 | V = 10 | |
|
26 | mode = 1 | |
|
27 | #path = '/DATA_RM/23/6v' | |
|
28 | path = '/DATA_RM/TEST_INTEGRACION_2M' | |
|
29 | path_ped='/DATA_RM/TEST_PEDESTAL/P20211012-082745' | |
|
30 | figpath_pp = "/home/soporte/Pictures/TEST_PP" | |
|
31 | figpath_mom = "/home/soporte/Pictures/TEST_MOM" | |
|
32 | plot = 0 | |
|
33 | integration = 1 | |
|
34 | save = 0 | |
|
35 | if save == 1: | |
|
36 | if mode==0: | |
|
37 | path_save = '/DATA_RM/TEST_HDF5_PP_23/6v' | |
|
38 | path_save = '/DATA_RM/TEST_HDF5_PP' | |
|
39 | path_save = '/DATA_RM/TEST_HDF5_PP_100' | |
|
40 | else: | |
|
41 | path_save = '/DATA_RM/TEST_HDF5_SPEC_23_V2/6v' | |
|
42 | ||
|
43 | print("* PATH data ADQ :", path) | |
|
44 | print("* Velocidad Pedestal :",V,"Β°/seg") | |
|
45 | ############################ NRO Perfiles PROCESAMIENTO ################### | |
|
46 | V=V | |
|
47 | IPP=400*1e-6 | |
|
48 | n= int(1/(V*IPP)) | |
|
49 | print("* n - NRO Perfiles Proc:", n ) | |
|
50 | ################################## MODE ################################### | |
|
51 | print("* Modo de Operacion :",mode) | |
|
52 | if mode ==0: | |
|
53 | print("* Met. Seleccionado : Pulse Pair") | |
|
54 | else: | |
|
55 | print("* Met. Momentos : Momentos") | |
|
56 | ||
|
57 | ################################## MODE ################################### | |
|
58 | print("* Grabado de datos :",save) | |
|
59 | if save ==1: | |
|
60 | if mode==0: | |
|
61 | ope= "Pulse Pair" | |
|
62 | else: | |
|
63 | ope= "Momentos" | |
|
64 | print("* Path-Save Data -", ope , path_save) | |
|
65 | ||
|
66 | print("* Integracion de datos :",integration) | |
|
67 | ||
|
68 | time.sleep(15) | |
|
69 | #remotefolder = "/home/wmaster/graficos" | |
|
70 | ####################################################################### | |
|
71 | ################# RANGO DE PLOTEO###################################### | |
|
72 | dBmin = '1' | |
|
73 | dBmax = '85' | |
|
74 | xmin = '15' | |
|
75 | xmax = '15.25' | |
|
76 | ymin = '0' | |
|
77 | ymax = '600' | |
|
78 | ####################################################################### | |
|
79 | ########################FECHA########################################## | |
|
80 | str = datetime.date.today() | |
|
81 | today = str.strftime("%Y/%m/%d") | |
|
82 | str2 = str - datetime.timedelta(days=1) | |
|
83 | yesterday = str2.strftime("%Y/%m/%d") | |
|
84 | ####################################################################### | |
|
85 | ########################SIGNAL CHAIN ################################## | |
|
86 | ####################################################################### | |
|
87 | desc = "USRP_test" | |
|
88 | filename = "USRP_processing.xml" | |
|
89 | controllerObj = Project() | |
|
90 | controllerObj.setup(id = '191', name='Test_USRP', description=desc) | |
|
91 | ####################################################################### | |
|
92 | ######################## UNIDAD DE LECTURA############################# | |
|
93 | ####################################################################### | |
|
94 | readUnitConfObj = controllerObj.addReadUnit(datatype='DigitalRFReader', | |
|
95 | path=path, | |
|
96 | startDate="2021/01/01",#today, | |
|
97 | endDate="2021/12/30",#today, | |
|
98 | startTime='00:00:00', | |
|
99 | endTime='23:59:59', | |
|
100 | delay=0, | |
|
101 | #set=0, | |
|
102 | online=0, | |
|
103 | walk=1, | |
|
104 | ippKm = 60) | |
|
105 | ||
|
106 | opObj11 = readUnitConfObj.addOperation(name='printInfo') | |
|
107 | ||
|
108 | procUnitConfObjA = controllerObj.addProcUnit(datatype='VoltageProc', inputId=readUnitConfObj.getId()) | |
|
109 | ||
|
110 | if mode ==0: | |
|
111 | ####################### METODO PULSE PAIR ###################################################################### | |
|
112 | opObj11 = procUnitConfObjA.addOperation(name='PulsePair', optype='other') | |
|
113 | opObj11.addParameter(name='n', value=int(n), format='int')#10 VOY A USAR 250 DADO QUE LA VELOCIDAD ES 10 GRADOS | |
|
114 | #opObj11.addParameter(name='removeDC', value=1, format='int') | |
|
115 | ####################### METODO Parametros ###################################################################### | |
|
116 | procUnitConfObjB= controllerObj.addProcUnit(datatype='ParametersProc',inputId=procUnitConfObjA.getId()) | |
|
117 | if plot==1: | |
|
118 | opObj11 = procUnitConfObjB.addOperation(name='GenericRTIPlot',optype='external') | |
|
119 | opObj11.addParameter(name='attr_data', value='dataPP_POW') | |
|
120 | opObj11.addParameter(name='colormap', value='jet') | |
|
121 | opObj11.addParameter(name='xmin', value=xmin) | |
|
122 | opObj11.addParameter(name='xmax', value=xmax) | |
|
123 | opObj11.addParameter(name='zmin', value=dBmin) | |
|
124 | opObj11.addParameter(name='zmax', value=dBmax) | |
|
125 | opObj11.addParameter(name='save', value=figpath_pp) | |
|
126 | opObj11.addParameter(name='showprofile', value=0) | |
|
127 | opObj11.addParameter(name='save_period', value=50) | |
|
128 | ||
|
129 | ####################### METODO ESCRITURA ####################################################################### | |
|
130 | if save==1: | |
|
131 | opObj10 = procUnitConfObjB.addOperation(name='HDFWriter') | |
|
132 | opObj10.addParameter(name='path',value=path_save) | |
|
133 | #opObj10.addParameter(name='mode',value=0) | |
|
134 | opObj10.addParameter(name='blocksPerFile',value='100',format='int') | |
|
135 | opObj10.addParameter(name='metadataList',value='utctimeInit,timeZone,paramInterval,profileIndex,channelList,heightList,flagDataAsBlock',format='list') | |
|
136 | opObj10.addParameter(name='dataList',value='dataPP_POW,dataPP_DOP,utctime',format='list')#,format='list' | |
|
137 | if integration==1: | |
|
138 | V=10 | |
|
139 | blocksPerfile=360 | |
|
140 | print("* Velocidad del Pedestal:",V) | |
|
141 | tmp_blocksPerfile = 100 | |
|
142 | f_a_p= int(tmp_blocksPerfile/V) | |
|
143 | ||
|
144 | opObj11 = procUnitConfObjB.addOperation(name='PedestalInformation') | |
|
145 | opObj11.addParameter(name='path_ped', value=path_ped) | |
|
146 | #opObj11.addParameter(name='path_adq', value=path_adq) | |
|
147 | opObj11.addParameter(name='t_Interval_p', value='0.01', format='float') | |
|
148 | opObj11.addParameter(name='blocksPerfile', value=blocksPerfile, format='int') | |
|
149 | opObj11.addParameter(name='n_Muestras_p', value='100', format='float') | |
|
150 | opObj11.addParameter(name='f_a_p', value=f_a_p, format='int') | |
|
151 | opObj11.addParameter(name='online', value='0', format='int') | |
|
152 | ||
|
153 | opObj11 = procUnitConfObjB.addOperation(name='Block360') | |
|
154 | opObj11.addParameter(name='n', value='10', format='int') | |
|
155 | opObj11.addParameter(name='mode', value=mode, format='int') | |
|
156 | ||
|
157 | # este bloque funciona bien con divisores de 360 no olvidar 0 10 20 30 40 60 90 120 180 | |
|
158 | ||
|
159 | opObj11= procUnitConfObjB.addOperation(name='WeatherPlot',optype='other') | |
|
160 | ||
|
161 | ||
|
162 | else: | |
|
163 | ####################### METODO SPECTROS ###################################################################### | |
|
164 | procUnitConfObjB = controllerObj.addProcUnit(datatype='SpectraProc', inputId=procUnitConfObjA.getId()) | |
|
165 | procUnitConfObjB.addParameter(name='nFFTPoints', value=n, format='int') | |
|
166 | procUnitConfObjB.addParameter(name='nProfiles' , value=n, format='int') | |
|
167 | ||
|
168 | procUnitConfObjC = controllerObj.addProcUnit(datatype='ParametersProc',inputId=procUnitConfObjB.getId()) | |
|
169 | procUnitConfObjC.addOperation(name='SpectralMoments') | |
|
170 | if plot==1: | |
|
171 | dBmin = '1' | |
|
172 | dBmax = '65' | |
|
173 | opObj11 = procUnitConfObjC.addOperation(name='PowerPlot',optype='external') | |
|
174 | opObj11.addParameter(name='xmin', value=xmin) | |
|
175 | opObj11.addParameter(name='xmax', value=xmax) | |
|
176 | opObj11.addParameter(name='zmin', value=dBmin) | |
|
177 | opObj11.addParameter(name='zmax', value=dBmax) | |
|
178 | opObj11.addParameter(name='save', value=figpath_mom) | |
|
179 | opObj11.addParameter(name='showprofile', value=0) | |
|
180 | opObj11.addParameter(name='save_period', value=100) | |
|
181 | ||
|
182 | if save==1: | |
|
183 | opObj10 = procUnitConfObjC.addOperation(name='HDFWriter') | |
|
184 | opObj10.addParameter(name='path',value=path_save) | |
|
185 | #opObj10.addParameter(name='mode',value=0) | |
|
186 | opObj10.addParameter(name='blocksPerFile',value='360',format='int') | |
|
187 | #opObj10.addParameter(name='metadataList',value='utctimeInit,heightList,nIncohInt,nCohInt,nProfiles,channelList',format='list')#profileIndex | |
|
188 | opObj10.addParameter(name='metadataList',value='utctimeInit,heightList,nIncohInt,nCohInt,nProfiles,channelList',format='list')#profileIndex | |
|
189 | opObj10.addParameter(name='dataList',value='data_pow,data_dop,utctime',format='list')#,format='list' | |
|
190 | ||
|
191 | if integration==1: | |
|
192 | V=10 | |
|
193 | blocksPerfile=360 | |
|
194 | print("* Velocidad del Pedestal:",V) | |
|
195 | tmp_blocksPerfile = 100 | |
|
196 | f_a_p= int(tmp_blocksPerfile/V) | |
|
197 | ||
|
198 | opObj11 = procUnitConfObjC.addOperation(name='PedestalInformation') | |
|
199 | opObj11.addParameter(name='path_ped', value=path_ped) | |
|
200 | #opObj11.addParameter(name='path_adq', value=path_adq) | |
|
201 | opObj11.addParameter(name='t_Interval_p', value='0.01', format='float') | |
|
202 | opObj11.addParameter(name='blocksPerfile', value=blocksPerfile, format='int') | |
|
203 | opObj11.addParameter(name='n_Muestras_p', value='100', format='float') | |
|
204 | opObj11.addParameter(name='f_a_p', value=f_a_p, format='int') | |
|
205 | opObj11.addParameter(name='online', value='0', format='int') | |
|
206 | ||
|
207 | opObj11 = procUnitConfObjC.addOperation(name='Block360') | |
|
208 | opObj11.addParameter(name='n', value='10', format='int') | |
|
209 | opObj11.addParameter(name='mode', value=mode, format='int') | |
|
210 | ||
|
211 | # este bloque funciona bien con divisores de 360 no olvidar 0 10 20 30 40 60 90 120 180 | |
|
212 | opObj11= procUnitConfObjC.addOperation(name='WeatherPlot',optype='other') | |
|
213 | controllerObj.start() |
@@ -0,0 +1,112 | |||
|
1 | # Ing-AlexanderValdez | |
|
2 | # Monitoreo de Pedestal | |
|
3 | ||
|
4 | ############## IMPORTA LIBRERIAS ################### | |
|
5 | import os,numpy,h5py | |
|
6 | import sys,time | |
|
7 | import matplotlib.pyplot as plt | |
|
8 | #################################################### | |
|
9 | path_ped = '/DATA_RM/TEST_PEDESTAL/P20211012-082745' | |
|
10 | # Metodo para verificar numero | |
|
11 | def isNumber(str): | |
|
12 | try: | |
|
13 | float(str) | |
|
14 | return True | |
|
15 | except: | |
|
16 | return False | |
|
17 | # Metodo para extraer el arreglo | |
|
18 | def getDatavaluefromDirFilename(path,file,value): | |
|
19 | dir_file= path+"/"+file | |
|
20 | fp = h5py.File(dir_file,'r') | |
|
21 | array = fp['Data'].get(value)[()] | |
|
22 | fp.close() | |
|
23 | return array | |
|
24 | ||
|
25 | # LISTA COMPLETA DE ARCHIVOS HDF5 Pedestal | |
|
26 | LIST= sorted(os.listdir(path_ped)) | |
|
27 | m=len(LIST) | |
|
28 | print("TOTAL DE ARCHIVOS DE PEDESTAL:",m) | |
|
29 | # Contadores temporales | |
|
30 | k= 0 | |
|
31 | l= 0 | |
|
32 | t= 0 | |
|
33 | # Marca de tiempo temporal | |
|
34 | time_ = numpy.zeros([m]) | |
|
35 | # creacion de | |
|
36 | for i in range(m): | |
|
37 | tmp_azi_pos = getDatavaluefromDirFilename(path=path_ped,file=LIST[i],value="azi_pos") | |
|
38 | tmp_ele_pos = getDatavaluefromDirFilename(path=path_ped,file=LIST[i],value="ele_pos") | |
|
39 | tmp_azi_vel = getDatavaluefromDirFilename(path=path_ped,file=LIST[i],value="azi_vel") | |
|
40 | tmp_ele_vel = getDatavaluefromDirFilename(path=path_ped,file=LIST[i],value="azi_vel")# nuevo :D | |
|
41 | ||
|
42 | time_[i] = getDatavaluefromDirFilename(path=path_ped,file=LIST[i],value="utc") | |
|
43 | ||
|
44 | k=k +tmp_azi_pos.shape[0] | |
|
45 | l=l +tmp_ele_pos.shape[0] | |
|
46 | t=t +tmp_azi_vel.shape[0] | |
|
47 | ||
|
48 | print("TOTAL DE MUESTRAS, ARCHIVOS X100:",k) | |
|
49 | time.sleep(5) | |
|
50 | ######CREACION DE ARREGLOS CANTIDAD DE VALORES POR MUESTRA################# | |
|
51 | azi_pos = numpy.zeros([k]) | |
|
52 | ele_pos = numpy.zeros([l]) | |
|
53 | time_azi_pos= numpy.zeros([k]) | |
|
54 | # Contadores temporales | |
|
55 | p=0 | |
|
56 | r=0 | |
|
57 | z=0 | |
|
58 | # VARIABLES TMP para almacenar azimuth, elevacion y tiempo | |
|
59 | ||
|
60 | #for filename in sorted(os.listdir(path_ped)): | |
|
61 | # CONDICION POR LEER EN TIEMPO REAL NO OFFLINE | |
|
62 | ||
|
63 | for filename in LIST: | |
|
64 | tmp_azi_pos = getDatavaluefromDirFilename(path=path_ped,file=filename,value="azi_pos") | |
|
65 | tmp_ele_pos = getDatavaluefromDirFilename(path=path_ped,file=filename,value="ele_pos") | |
|
66 | # CONDICION POR LEER EN TIEMPO REAL NO OFFLINE | |
|
67 | ||
|
68 | if z==(m-1): | |
|
69 | tmp_azi_time=numpy.arange(time_[z],time_[z]+1,1/(tmp_azi_pos.shape[0])) | |
|
70 | else: | |
|
71 | tmp_azi_time=numpy.arange(time_[z],time_[z+1],(time_[z+1]-time_[z])/(tmp_azi_pos.shape[0])) | |
|
72 | ||
|
73 | print(filename,time_[z]) | |
|
74 | print(z,tmp_azi_pos.shape[0]) | |
|
75 | ||
|
76 | i=0 | |
|
77 | for i in range(tmp_azi_pos.shape[0]): | |
|
78 | index=p+i | |
|
79 | azi_pos[index]=tmp_azi_pos[i] | |
|
80 | time_azi_pos[index]=tmp_azi_time[i] | |
|
81 | p=p+tmp_azi_pos.shape[0] | |
|
82 | i=0 | |
|
83 | for i in range(tmp_ele_pos.shape[0]): | |
|
84 | index=r+i | |
|
85 | ele_pos[index]=tmp_ele_pos[i] | |
|
86 | r=r+tmp_ele_pos.shape[0] | |
|
87 | ||
|
88 | ||
|
89 | z+=1 | |
|
90 | ||
|
91 | ||
|
92 | ######## GRAFIQUEMOS Y VEAMOS LOS DATOS DEL Pedestal | |
|
93 | fig, ax = plt.subplots(figsize=(16,8)) | |
|
94 | print(time_azi_pos.shape) | |
|
95 | print(azi_pos.shape) | |
|
96 | t=numpy.arange(time_azi_pos.shape[0])*0.01/(60.0) | |
|
97 | plt.plot(t,azi_pos,label='AZIMUTH_POS',color='blue') | |
|
98 | ||
|
99 | # AQUI ESTOY ADICIONANDO LA POSICION EN elevaciont=numpy.arange(len(ele_pos))*0.01/60.0 | |
|
100 | t=numpy.arange(len(ele_pos))*0.01/60.0 | |
|
101 | plt.plot(t,ele_pos,label='ELEVATION_POS',color='red')#*10 | |
|
102 | ||
|
103 | #ax.set_xlim(0, 9) | |
|
104 | ax.set_ylim(-5, 400) | |
|
105 | plt.ylabel("Azimuth Position") | |
|
106 | plt.xlabel("Muestra") | |
|
107 | plt.title('Azimuth Position vs Muestra ', fontsize=20) | |
|
108 | axes = plt.gca() | |
|
109 | axes.yaxis.grid() | |
|
110 | plt.xticks(fontsize=16) | |
|
111 | plt.yticks(fontsize=16) | |
|
112 | plt.show() |
@@ -0,0 +1,90 | |||
|
1 | import os,sys,json | |
|
2 | import datetime | |
|
3 | import time | |
|
4 | from schainpy.controller import Project | |
|
5 | ''' | |
|
6 | NOTA: | |
|
7 | Este script de prueba. | |
|
8 | - Unidad del lectura 'HDFReader'. | |
|
9 | - Unidad de procesamiento ParametersProc | |
|
10 | - Operacion SpectralMomentsPlot | |
|
11 | ||
|
12 | ''' | |
|
13 | ||
|
14 | ####################################################################### | |
|
15 | ################# RANGO DE PLOTEO###################################### | |
|
16 | ####################################################################### | |
|
17 | dBmin = '1' | |
|
18 | dBmax = '65' | |
|
19 | xmin = '0' | |
|
20 | xmax ='24' | |
|
21 | #tmmin = 16.2 | |
|
22 | #tmmax = 16.25 | |
|
23 | tmmin =15 | |
|
24 | tmmax =15.5 | |
|
25 | ymin = '0' | |
|
26 | ymax = '600' | |
|
27 | ####################################################################### | |
|
28 | ####################################################################### | |
|
29 | ####################################################################### | |
|
30 | #path = '/DATA_RM/TEST_HDF5_SPEC' | |
|
31 | path = '/DATA_RM/TEST_HDF5_SPEC_23/6v/' | |
|
32 | figpath = '/home/soporte/Downloads/23/6v' | |
|
33 | path="/home/soporte/Downloads/params-20211015T174046Z-001/params" | |
|
34 | desc = "Simulator Test" | |
|
35 | desc_data = { | |
|
36 | 'Data': { | |
|
37 | 'data_spc': ['Data/data_spc/channel00','Data/data_spc/channel01'\ | |
|
38 | ,'Data/data_spc/channel02','Data/data_spc/channel03'\ | |
|
39 | ,'Data/data_spc/channel04','Data/data_spc/channel05'\ | |
|
40 | ,'Data/data_spc/channel06','Data/data_spc/channel07'\ | |
|
41 | ,'Data/data_spc/channel08','Data/data_spc/channel09'], | |
|
42 | 'utctime':'Data/utctime' | |
|
43 | }, | |
|
44 | 'Metadata': { | |
|
45 | 'type' :'Metadata/type', | |
|
46 | 'channelList' :'Metadata/channelList', | |
|
47 | 'heightList' :'Metadata/heightList', | |
|
48 | 'ippSeconds' :'Metadata/ippSeconds', | |
|
49 | 'nProfiles' :'Metadata/nProfiles', | |
|
50 | 'codeList' :'Metadata/codeList', | |
|
51 | 'timeZone' :'Metadata/timeZone', | |
|
52 | 'azimuthList' :'Metadata/azimuthList', | |
|
53 | 'elevationList' :'Metadata/elevationList', | |
|
54 | 'nCohInt' :'Metadata/nCohInt', | |
|
55 | 'nIncohInt' :'Metadata/nIncohInt', | |
|
56 | 'nFFTPoints' :'Metadata/nFFTPoints' | |
|
57 | ||
|
58 | } | |
|
59 | } | |
|
60 | ||
|
61 | controllerObj = Project() | |
|
62 | ||
|
63 | controllerObj.setup(id='10',name='Test Simulator',description=desc) | |
|
64 | ||
|
65 | readUnitConfObj = controllerObj.addReadUnit(datatype='HDFReader', | |
|
66 | path=path, | |
|
67 | startDate="2021/01/01", #"2020/01/01",#today, | |
|
68 | endDate= "2021/12/01", #"2020/12/30",#today, | |
|
69 | startTime='00:00:00', | |
|
70 | endTime='23:59:59', | |
|
71 | delay=0, | |
|
72 | #set=0, | |
|
73 | online=0, | |
|
74 | walk=0, | |
|
75 | description= json.dumps(desc_data))#1 | |
|
76 | ||
|
77 | procUnitConfObjA = controllerObj.addProcUnit(datatype='ParametersProc',inputId=readUnitConfObj.getId()) | |
|
78 | procUnitConfObjA.addOperation(name='SpectralMoments') | |
|
79 | ||
|
80 | ''' | |
|
81 | opObj11 = readUnitConfObj.addOperation(name='SpectraPlot',optype='external') | |
|
82 | opObj11.addParameter(name='xmin', value=tmmin) | |
|
83 | opObj11.addParameter(name='xmax', value=tmmax) | |
|
84 | opObj11.addParameter(name='zmin', value=dBmin) | |
|
85 | opObj11.addParameter(name='zmax', value=dBmax) | |
|
86 | opObj11.addParameter(name='save', value=figpath) | |
|
87 | opObj11.addParameter(name='showprofile', value=0) | |
|
88 | opObj11.addParameter(name='save_period', value=10) | |
|
89 | ''' | |
|
90 | controllerObj.start() |
@@ -399,8 +399,9 class WeatherPlot(Plot): | |||
|
399 | 399 | |
|
400 | 400 | data = {} |
|
401 | 401 | meta = {} |
|
402 | data['weather'] = 10*numpy.log10(dataOut.data_360[0]/(250**2)) | |
|
403 | print(data['weather']) | |
|
402 | print("aprox",dataOut.data_360[0]) | |
|
403 | data['weather'] = 10*numpy.log10(dataOut.data_360[0]/(250.0)) | |
|
404 | #print(data['weather']) | |
|
404 | 405 | data['azi'] = dataOut.data_azi |
|
405 | 406 | print("UPDATE",data['azi']) |
|
406 | 407 | return data, meta |
@@ -507,7 +508,7 class WeatherPlot(Plot): | |||
|
507 | 508 | cgax, pm = wrl.vis.plot_ppi(self.res_weather,r=r,az=self.res_azi,fig=self.figures[0], proj='cg', vmin=1, vmax=60) |
|
508 | 509 | else: |
|
509 | 510 | plt.clf() |
|
510 |
cgax, pm = wrl.vis.plot_ppi(self.res_weather,r=r,az=self.res_azi,fig=self.figures[0], proj='cg', vmin= |
|
|
511 | cgax, pm = wrl.vis.plot_ppi(self.res_weather,r=r,az=self.res_azi,fig=self.figures[0], proj='cg', vmin=0, vmax=60) | |
|
511 | 512 | caax = cgax.parasites[0] |
|
512 | 513 | paax = cgax.parasites[1] |
|
513 | 514 | cbar = plt.gcf().colorbar(pm, pad=0.075) |
@@ -198,10 +198,12 class ParametersProc(ProcessingUnit): | |||
|
198 | 198 | if self.dataIn.type == "Parameters": |
|
199 | 199 | self.dataOut.copy(self.dataIn) |
|
200 | 200 | self.dataOut.flagNoData = False |
|
201 | #print("yo si entre") | |
|
201 | 202 | |
|
202 | 203 | return True |
|
203 | 204 | |
|
204 | 205 | self.__updateObjFromInput() |
|
206 | #print("yo si entre2") | |
|
205 | 207 | |
|
206 | 208 | self.dataOut.utctimeInit = self.dataIn.utctime |
|
207 | 209 | self.dataOut.paramInterval = self.dataIn.timeInterval |
@@ -4088,30 +4090,34 class PedestalInformation(Operation): | |||
|
4088 | 4090 | break |
|
4089 | 4091 | return flag |
|
4090 | 4092 | |
|
4091 | def setup_offline(self,dataOut,list_pedestal,list_adq): | |
|
4093 | #def setup_offline(self,dataOut,list_pedestal,list_adq): | |
|
4094 | def setup_offline(self,dataOut,list_pedestal): | |
|
4095 | ||
|
4092 | 4096 | print("SETUP OFFLINE") |
|
4093 | 4097 | print(self.path_ped) |
|
4094 | print(self.path_adq) | |
|
4098 | #print(self.path_adq) | |
|
4095 | 4099 | print(len(self.list_pedestal)) |
|
4096 | print(len(self.list_adq)) | |
|
4100 | #print(len(self.list_adq)) | |
|
4097 | 4101 | utc_ped_list=[] |
|
4098 | 4102 | for i in range(len(self.list_pedestal)): |
|
4103 | print(i) | |
|
4099 | 4104 | utc_ped_list.append(self.gettimeutcfromDirFilename(path=self.path_ped,file=self.list_pedestal[i])) |
|
4100 | 4105 | |
|
4101 | 4106 | #utc_ped_list= utc_ped_list |
|
4102 | utc_adq = self.gettimeutcadqfromDirFilename(path=self.path_adq,file=self.list_adq[0]) | |
|
4107 | ###utc_adq = self.gettimeutcadqfromDirFilename(path=self.path_adq,file=self.list_adq[0]) | |
|
4103 | 4108 | print("dios existe donde esta") |
|
4109 | ||
|
4104 | 4110 | #print("utc_ped_list",utc_ped_list) |
|
4105 | print("utc_adq",utc_adq) | |
|
4111 | ###print("utc_adq",utc_adq) | |
|
4106 | 4112 | # utc_adq_dataOut |
|
4107 | 4113 | utc_adq_dataOut =dataOut.utctime |
|
4108 | 4114 | print("Offline-utc_adq_dataout",utc_adq_dataOut) |
|
4109 | 4115 | |
|
4110 | nro_file,utc_ped,utc_ped_1 = self.getNROFile(utc_adq=utc_adq, utc_ped_list= utc_ped_list) | |
|
4116 | nro_file,utc_ped,utc_ped_1 = self.getNROFile(utc_adq=utc_adq_dataOut, utc_ped_list= utc_ped_list) | |
|
4111 | 4117 | |
|
4112 | 4118 | print("nro_file",nro_file,"utc_ped",utc_ped) |
|
4113 | 4119 | print("nro_file",i) |
|
4114 | nro_key_p = int((utc_adq-utc_ped)/self.t_Interval_p)-1 # ojito al -1 estimado alex | |
|
4120 | nro_key_p = int((utc_adq_dataOut-utc_ped)/self.t_Interval_p)-1 # ojito al -1 estimado alex | |
|
4115 | 4121 | print("nro_key_p",nro_key_p) |
|
4116 | 4122 | |
|
4117 | 4123 | ff_pedestal = self.list_pedestal[nro_file] |
@@ -4147,10 +4153,12 class PedestalInformation(Operation): | |||
|
4147 | 4153 | self.nro_file = nro_file |
|
4148 | 4154 | self.nro_key_p = nro_key_p |
|
4149 | 4155 | |
|
4150 | def setup(self,dataOut,path_ped,path_adq,t_Interval_p,n_Muestras_p,blocksPerfile,f_a_p,online): | |
|
4156 | #def setup(self,dataOut,path_ped,path_adq,t_Interval_p,n_Muestras_p,blocksPerfile,f_a_p,online): | |
|
4157 | def setup(self,dataOut,path_ped,t_Interval_p,n_Muestras_p,blocksPerfile,f_a_p,online): | |
|
4158 | print("SETUP PEDESTAL") | |
|
4151 | 4159 | self.__dataReady = False |
|
4152 | 4160 | self.path_ped = path_ped |
|
4153 | self.path_adq = path_adq | |
|
4161 | #self.path_adq = path_adq | |
|
4154 | 4162 | self.t_Interval_p = t_Interval_p |
|
4155 | 4163 | self.n_Muestras_p = n_Muestras_p |
|
4156 | 4164 | self.blocksPerfile= blocksPerfile |
@@ -4161,17 +4169,19 class PedestalInformation(Operation): | |||
|
4161 | 4169 | self.tmp = 0 |
|
4162 | 4170 | self.c_ped = 0 |
|
4163 | 4171 | print(self.path_ped) |
|
4164 | print(self.path_adq) | |
|
4172 | #print(self.path_adq) | |
|
4165 | 4173 | self.list_pedestal = self.getfirstFilefromPath(path=self.path_ped,meta="PE",ext=".hdf5") |
|
4166 | 4174 | print("LIST NEW", self.list_pedestal[:20]) |
|
4167 | self.list_adq = self.getfirstFilefromPath(path=self.path_adq,meta="D",ext=".hdf5") | |
|
4175 | #self.list_adq = self.getfirstFilefromPath(path=self.path_adq,meta="D",ext=".hdf5") | |
|
4168 | 4176 | print("*************Longitud list pedestal****************",len(self.list_pedestal)) |
|
4169 | 4177 | |
|
4170 | 4178 | if self.online: |
|
4171 | 4179 | print("Enable Online") |
|
4172 | 4180 | self.setup_online(dataOut) |
|
4173 | 4181 | else: |
|
4174 | self.setup_offline(dataOut,list_pedestal=self.list_pedestal,list_adq=self.list_adq) | |
|
4182 | #self.setup_offline(dataOut,list_pedestal=self.list_pedestal,list_adq=self.list_adq) | |
|
4183 | self.setup_offline(dataOut,list_pedestal=self.list_pedestal) | |
|
4184 | ||
|
4175 | 4185 | |
|
4176 | 4186 | def setNextFileP(self,dataOut): |
|
4177 | 4187 | if self.online: |
@@ -4192,7 +4202,7 class PedestalInformation(Operation): | |||
|
4192 | 4202 | iterador = self.nro_key_p +self.f_a_p*self.c_ped |
|
4193 | 4203 | self.c_ped = self.c_ped +1 |
|
4194 | 4204 | |
|
4195 |
|
|
|
4205 | print("iterador------------->",iterador) | |
|
4196 | 4206 | if iterador < self.n_Muestras_p: |
|
4197 | 4207 | self.nro_file = self.nro_file |
|
4198 | 4208 | else: |
@@ -4203,17 +4213,19 class PedestalInformation(Operation): | |||
|
4203 | 4213 | print("utc_pedestal",utc_ped_setnext) |
|
4204 | 4214 | print("utc_adq",utc_adq_setnext) |
|
4205 | 4215 | |
|
4216 | print("self.c_ped",self.c_ped) | |
|
4217 | #dif = self.blocksPerfile-(self.nro_key_p+self.f_a_p*(self.c_ped-2)) | |
|
4218 | dif = self.n_Muestras_p-(self.nro_key_p+self.f_a_p*(self.c_ped-2)) | |
|
4206 | 4219 | |
|
4207 | dif = self.blocksPerfile-(self.nro_key_p+self.f_a_p*(self.c_ped-2)) | |
|
4208 | 4220 | self.c_ped = 1 |
|
4209 | 4221 | ##tmp = j |
|
4210 | 4222 | ##print("tmp else",tmp) |
|
4211 | 4223 | self.nro_key_p= self.f_a_p-dif |
|
4212 | 4224 | iterador = self.nro_key_p |
|
4213 |
|
|
|
4225 | print("iterador else",iterador) | |
|
4214 | 4226 | #self.c_ped = self.c_ped +1 |
|
4215 | 4227 | |
|
4216 |
|
|
|
4228 | print("nro_file",self.nro_file) | |
|
4217 | 4229 | #print("tmp",tmp) |
|
4218 | 4230 | try: |
|
4219 | 4231 | ff_pedestal = self.list_pedestal[self.nro_file] |
@@ -4286,24 +4298,28 class PedestalInformation(Operation): | |||
|
4286 | 4298 | return self.angulo_adq |
|
4287 | 4299 | |
|
4288 | 4300 | |
|
4289 | def run(self, dataOut,path_ped,path_adq,t_Interval_p,n_Muestras_p,blocksPerfile,f_a_p,online): | |
|
4301 | #def run(self, dataOut,path_ped,path_adq,t_Interval_p,n_Muestras_p,blocksPerfile,f_a_p,online): | |
|
4302 | def run(self, dataOut,path_ped,t_Interval_p,n_Muestras_p,blocksPerfile,f_a_p,online): | |
|
4303 | ||
|
4290 | 4304 | if not self.isConfig: |
|
4291 | 4305 | print("######################SETUP#########################################") |
|
4292 | self.setup( dataOut, path_ped,path_adq,t_Interval_p,n_Muestras_p,blocksPerfile,f_a_p,online) | |
|
4306 | #self.setup( dataOut, path_ped,path_adq,t_Interval_p,n_Muestras_p,blocksPerfile,f_a_p,online) | |
|
4307 | self.setup( dataOut, path_ped,t_Interval_p,n_Muestras_p,blocksPerfile,f_a_p,online) | |
|
4293 | 4308 | self.isConfig = True |
|
4294 | 4309 | |
|
4295 | 4310 | dataOut.flagNoData = True |
|
4296 |
|
|
|
4311 | print("profIndex",self.__profIndex) | |
|
4297 | 4312 | |
|
4298 | 4313 | if self.__profIndex==0: |
|
4299 | 4314 | angulo_adq = self.setNextFileP(dataOut) |
|
4300 | 4315 | dataOut.azimuth = angulo_adq |
|
4301 | 4316 | print("TIEMPO:",dataOut.utctime) |
|
4302 | 4317 | ##print("####################################################################") |
|
4303 |
|
|
|
4318 | print("angulos",dataOut.azimuth,len(dataOut.azimuth)) | |
|
4304 | 4319 | self.__dataReady = True |
|
4305 | 4320 | self.__profIndex += 1 |
|
4306 | 4321 | print("TIEMPO_bucle:",dataOut.utctime) |
|
4322 | print("profIndex",self.__profIndex) | |
|
4307 | 4323 | if self.__profIndex== blocksPerfile: |
|
4308 | 4324 | self.__profIndex = 0 |
|
4309 | 4325 | if self.__dataReady: |
@@ -4325,11 +4341,12 class Block360(Operation): | |||
|
4325 | 4341 | __nch = 0 |
|
4326 | 4342 | __nHeis = 0 |
|
4327 | 4343 | index = 0 |
|
4344 | mode = 0 | |
|
4328 | 4345 | |
|
4329 | 4346 | def __init__(self,**kwargs): |
|
4330 | 4347 | Operation.__init__(self,**kwargs) |
|
4331 | 4348 | |
|
4332 | def setup(self, dataOut, n = None): | |
|
4349 | def setup(self, dataOut, n = None, mode = None): | |
|
4333 | 4350 | ''' |
|
4334 | 4351 | n= Numero de PRF's de entrada |
|
4335 | 4352 | ''' |
@@ -4346,23 +4363,31 class Block360(Operation): | |||
|
4346 | 4363 | if n == None: |
|
4347 | 4364 | raise ValueError("n should be specified.") |
|
4348 | 4365 | |
|
4366 | if mode == None: | |
|
4367 | raise ValueError("mode should be specified.") | |
|
4368 | ||
|
4349 | 4369 | if n != None: |
|
4350 | 4370 | if n<1: |
|
4351 | 4371 | print("n should be greater than 2") |
|
4352 | 4372 | raise ValueError("n should be greater than 2") |
|
4353 | 4373 | |
|
4354 | 4374 | self.n = n |
|
4375 | self.mode = mode | |
|
4376 | print("self.mode",self.mode) | |
|
4355 | 4377 | #print("nHeights") |
|
4356 | 4378 | self.__buffer = numpy.zeros(( dataOut.nChannels,n, dataOut.nHeights)) |
|
4357 | 4379 | self.__buffer2= numpy.zeros(n) |
|
4358 | 4380 | |
|
4359 | def putData(self,data): | |
|
4381 | def putData(self,data,mode): | |
|
4360 | 4382 | ''' |
|
4361 | 4383 | Add a profile to he __buffer and increase in one the __profiel Index |
|
4362 | 4384 | ''' |
|
4363 | 4385 | #print("line 4049",data.dataPP_POW.shape,data.dataPP_POW[:10]) |
|
4364 | 4386 | #print("line 4049",data.azimuth.shape,data.azimuth) |
|
4365 | self.__buffer[:,self.__profIndex,:]= data.dataPP_POW | |
|
4387 | if self.mode==0: | |
|
4388 | self.__buffer[:,self.__profIndex,:]= data.dataPP_POW | |
|
4389 | if self.mode==1: | |
|
4390 | self.__buffer[:,self.__profIndex,:]= data.data_pow | |
|
4366 | 4391 | #print("me casi",self.index,data.azimuth[self.index]) |
|
4367 | 4392 | #print(self.__profIndex, self.index , data.azimuth[self.index] ) |
|
4368 | 4393 | #print("magic",data.profileIndex) |
@@ -4400,7 +4425,7 class Block360(Operation): | |||
|
4400 | 4425 | data_360 = None |
|
4401 | 4426 | data_p = None |
|
4402 | 4427 | #print("dataOu",dataOut.dataPP_POW) |
|
4403 | self.putData(data=dataOut) | |
|
4428 | self.putData(data=dataOut,mode = self.mode) | |
|
4404 | 4429 | #print("profIndex",self.__profIndex) |
|
4405 | 4430 | if self.__profIndex == self.n: |
|
4406 | 4431 | data_360,n,data_p = self.pushData(data=dataOut) |
@@ -4424,10 +4449,10 class Block360(Operation): | |||
|
4424 | 4449 | #print(data_360.shape,avgdatatime,data_p.shape) |
|
4425 | 4450 | return data_360,avgdatatime,data_p |
|
4426 | 4451 | |
|
4427 | def run(self, dataOut,n = None,**kwargs): | |
|
4428 | ||
|
4452 | def run(self, dataOut,n = None,mode=None,**kwargs): | |
|
4453 | print("BLOCK 360 HERE WE GO MOMENTOS") | |
|
4429 | 4454 | if not self.isConfig: |
|
4430 | self.setup(dataOut = dataOut, n = n , **kwargs) | |
|
4455 | self.setup(dataOut = dataOut, n = n ,mode= mode ,**kwargs) | |
|
4431 | 4456 | self.index = 0 |
|
4432 | 4457 | #print("comova",self.isConfig) |
|
4433 | 4458 | self.isConfig = True |
@@ -13,6 +13,10 path='/DATA_RM/TEST_HDF5/d2021231' | |||
|
13 | 13 | #path='/DATA_RM/TEST_14_HDF5/d2021257' |
|
14 | 14 | ## TEST ULTIMA PRUEBA 22 DE SEPTIEMBRE |
|
15 | 15 | path = '/DATA_RM/TEST_HDF5_PP_22/d2021265' |
|
16 | #path = '/DATA_RM/TEST_HDF5_PP_100/d2021285' | |
|
17 | path = '/DATA_RM/TEST_HDF5_PP/d2021285' | |
|
18 | ||
|
19 | ||
|
16 | 20 | path_adq=path |
|
17 | 21 | #path_ped='/DATA_RM/TEST_PEDESTAL/P2021200' |
|
18 | 22 | #path_ped='/DATA_RM/TEST_PEDESTAL/P2021214' |
@@ -24,7 +28,7 path_adq=path | |||
|
24 | 28 | #pruebas con perdida de datos |
|
25 | 29 | #path_ped='/DATA_RM/TEST_PEDESTAL/PEDESTAL_OFFLINE/P20210819-161524_TEST' |
|
26 | 30 | ## TEST ULTIMA PRUEBA 22 DE SEPTIEMBRE |
|
27 |
path_ped='/DATA_RM/TEST_PEDESTAL/P2021 |
|
|
31 | path_ped='/DATA_RM/TEST_PEDESTAL/P20211012-082745' | |
|
28 | 32 | |
|
29 | 33 | |
|
30 | 34 | figpath = '/home/soporte/Pictures' |
@@ -47,23 +51,25 readUnitConfObj = controllerObj.addReadUnit(datatype='HDFReader', | |||
|
47 | 51 | nTries=6)#1 |
|
48 | 52 | |
|
49 | 53 | procUnitConfObjA = controllerObj.addProcUnit(datatype='ParametersProc',inputId=readUnitConfObj.getId()) |
|
50 | V=2 | |
|
51 |
blocksPerfile= |
|
|
54 | V=10 | |
|
55 | blocksPerfile=360 | |
|
52 | 56 | print("Velocidad del Pedestal",V) |
|
53 | f_a_p= int(blocksPerfile/V) | |
|
57 | tmp_blocksPerfile=100 | |
|
58 | f_a_p= int(tmp_blocksPerfile/V) | |
|
54 | 59 | |
|
55 | 60 | opObj11 = procUnitConfObjA.addOperation(name='PedestalInformation') |
|
56 | 61 | opObj11.addParameter(name='path_ped', value=path_ped) |
|
57 | opObj11.addParameter(name='path_adq', value=path_adq) | |
|
62 | #opObj11.addParameter(name='path_adq', value=path_adq) | |
|
58 | 63 | opObj11.addParameter(name='t_Interval_p', value='0.01', format='float') |
|
64 | opObj11.addParameter(name='blocksPerfile', value=blocksPerfile, format='int') | |
|
59 | 65 | opObj11.addParameter(name='n_Muestras_p', value='100', format='float') |
|
60 | opObj11.addParameter(name='blocksPerfile', value='100', format='int') | |
|
61 | 66 | opObj11.addParameter(name='f_a_p', value=f_a_p, format='int') |
|
62 | 67 | opObj11.addParameter(name='online', value='0', format='int')# habilitar el enable aqui tambien |
|
63 | 68 | |
|
64 | 69 | |
|
65 | 70 | opObj11 = procUnitConfObjA.addOperation(name='Block360') |
|
66 | 71 | opObj11.addParameter(name='n', value='10', format='int') |
|
72 | opObj11.addParameter(name='mode', value=0, format='int') | |
|
67 | 73 | # este bloque funciona bien con divisores de 360 no olvidar 0 10 20 30 40 60 90 120 180 |
|
68 | 74 | |
|
69 | 75 | opObj11= procUnitConfObjA.addOperation(name='WeatherPlot',optype='other') |
General Comments 0
You need to be logged in to leave comments.
Login now