@@ -0,0 +1,31 | |||||
|
1 | import os,sys | |||
|
2 | import datetime | |||
|
3 | import time | |||
|
4 | from schainpy.controller import Project | |||
|
5 | path='/DATA_RM/TEST_HDF5' | |||
|
6 | path_adq=path | |||
|
7 | path_ped='/DATA_RM/TEST_PEDESTAL/P2021200' | |||
|
8 | figpath = '/home/soporte/Pictures' | |||
|
9 | desc = "Simulator Test" | |||
|
10 | ||||
|
11 | controllerObj = Project() | |||
|
12 | controllerObj.setup(id='10',name='Test Simulator',description=desc) | |||
|
13 | readUnitConfObj = controllerObj.addReadUnit(datatype='HDFReader', | |||
|
14 | path=path, | |||
|
15 | startDate="2021/01/01", #"2020/01/01",#today, | |||
|
16 | endDate= "2021/12/01", #"2020/12/30",#today, | |||
|
17 | startTime='00:00:00', | |||
|
18 | endTime='23:59:59', | |||
|
19 | t_Interval_p=0.01, | |||
|
20 | n_Muestras_p=100, | |||
|
21 | delay=5, | |||
|
22 | #set=0, | |||
|
23 | online=0, | |||
|
24 | walk=1)#1 | |||
|
25 | ||||
|
26 | procUnitConfObjA = controllerObj.addProcUnit(datatype='ParametersProc',inputId=readUnitConfObj.getId()) | |||
|
27 | ||||
|
28 | ||||
|
29 | controllerObj.start() | |||
|
30 | #online 1 utc_adq 1617490240.48 | |||
|
31 | #online 0 utc_adq 1617489815.4804 |
@@ -0,0 +1,92 | |||||
|
1 | import numpy | |||
|
2 | import sys | |||
|
3 | import zmq | |||
|
4 | import time | |||
|
5 | import h5py | |||
|
6 | import os | |||
|
7 | ||||
|
8 | timetuple=time.localtime() | |||
|
9 | meta='P' | |||
|
10 | dir="%s%4.4d%3.3d"%(meta,timetuple.tm_year,timetuple.tm_yday) | |||
|
11 | ||||
|
12 | path="/home/soporte/Downloads/PEDESTAL/"+dir | |||
|
13 | ||||
|
14 | ext=".hdf5" | |||
|
15 | ||||
|
16 | port ="5556" | |||
|
17 | if len(sys.argv)>1: | |||
|
18 | port = sys.argv[1] | |||
|
19 | int(port) | |||
|
20 | ||||
|
21 | if len(sys.argv)>2: | |||
|
22 | port1 = sys.argv[2] | |||
|
23 | int(port1) | |||
|
24 | ||||
|
25 | #Socket to talk to server | |||
|
26 | context = zmq.Context() | |||
|
27 | socket = context.socket(zmq.SUB) | |||
|
28 | ||||
|
29 | print("Collecting updates from weather server...") | |||
|
30 | socket.connect("tcp://localhost:%s"%port) | |||
|
31 | ||||
|
32 | if len(sys.argv)>2: | |||
|
33 | socket.connect("tcp://localhost:%s"%port1) | |||
|
34 | ||||
|
35 | #Subscribe to zipcode, default is NYC,10001 | |||
|
36 | topicfilter = "10001" | |||
|
37 | socket.setsockopt_string(zmq.SUBSCRIBE,topicfilter) | |||
|
38 | #Process 5 updates | |||
|
39 | total_value=0 | |||
|
40 | count= -1 | |||
|
41 | azi= [] | |||
|
42 | elev=[] | |||
|
43 | time0=[] | |||
|
44 | #for update_nbr in range(250): | |||
|
45 | while(True): | |||
|
46 | string= socket.recv() | |||
|
47 | topic,ang_elev,ang_elev_dec,ang_azi,ang_azi_dec,seconds,seconds_dec= string.split() | |||
|
48 | ang_azi =float(ang_azi)+1e-3*float(ang_azi_dec) | |||
|
49 | ang_elev =float(ang_elev)+1e-3*float(ang_elev_dec) | |||
|
50 | seconds =float(seconds) +1e-6*float(seconds_dec) | |||
|
51 | azi.append(ang_azi) | |||
|
52 | elev.append(ang_elev) | |||
|
53 | time0.append(seconds) | |||
|
54 | count +=1 | |||
|
55 | if count == 100: | |||
|
56 | timetuple=time.localtime() | |||
|
57 | epoc = time.mktime(timetuple) | |||
|
58 | #print(epoc) | |||
|
59 | fullpath = path + ("/" if path[-1]!="/" else "") | |||
|
60 | ||||
|
61 | if not os.path.exists(fullpath): | |||
|
62 | os.mkdir(fullpath) | |||
|
63 | ||||
|
64 | azi_array = numpy.array(azi) | |||
|
65 | elev_array = numpy.array(elev) | |||
|
66 | time0_array= numpy.array(time0) | |||
|
67 | pedestal_array=numpy.array([azi,elev,time0]) | |||
|
68 | count=0 | |||
|
69 | azi= [] | |||
|
70 | elev=[] | |||
|
71 | time0=[] | |||
|
72 | #print(pedestal_array[0]) | |||
|
73 | #print(pedestal_array[1]) | |||
|
74 | ||||
|
75 | meta='PE' | |||
|
76 | filex="%s%4.4d%3.3d%10.4d%s"%(meta,timetuple.tm_year,timetuple.tm_yday,epoc,ext) | |||
|
77 | filename = os.path.join(fullpath,filex) | |||
|
78 | fp = h5py.File(filename,'w') | |||
|
79 | #print("Escribiendo HDF5...",epoc) | |||
|
80 | #·················· Data·....······································ | |||
|
81 | grp = fp.create_group("Data") | |||
|
82 | dset = grp.create_dataset("azimuth" , data=pedestal_array[0]) | |||
|
83 | dset = grp.create_dataset("elevacion", data=pedestal_array[1]) | |||
|
84 | dset = grp.create_dataset("utc" , data=pedestal_array[2]) | |||
|
85 | #·················· Metadata······································· | |||
|
86 | grp = fp.create_group("Metadata") | |||
|
87 | dset = grp.create_dataset("utctimeInit", data=pedestal_array[2][0]) | |||
|
88 | timeInterval = pedestal_array[2][1]-pedestal_array[2][0] | |||
|
89 | dset = grp.create_dataset("timeInterval", data=timeInterval) | |||
|
90 | fp.close() | |||
|
91 | ||||
|
92 | #print ("Average messagedata value for topic '%s' was %dF" % ( topicfilter,total_value / update_nbr)) |
@@ -0,0 +1,48 | |||||
|
1 | ########################################################################### | |||
|
2 | ############################### SERVIDOR################################### | |||
|
3 | ######################### SIMULADOR DE PEDESTAL############################ | |||
|
4 | ########################################################################### | |||
|
5 | import time | |||
|
6 | import math | |||
|
7 | import numpy | |||
|
8 | import struct | |||
|
9 | from time import sleep | |||
|
10 | import zmq | |||
|
11 | import pickle | |||
|
12 | port="5556" | |||
|
13 | context = zmq.Context() | |||
|
14 | socket = context.socket(zmq.PUB) | |||
|
15 | socket.bind("tcp://*:%s"%port) | |||
|
16 | ###### PARAMETROS DE ENTRADA################################ | |||
|
17 | print("PEDESTAL RESOLUCION 0.01") | |||
|
18 | print("MAXIMA VELOCIDAD DEL PEDESTAL") | |||
|
19 | ang_elev = 4.12 | |||
|
20 | ang_azi = 30 | |||
|
21 | velocidad= input ("Ingresa velocidad:") | |||
|
22 | velocidad= float(velocidad) | |||
|
23 | print (velocidad) | |||
|
24 | ############################################################ | |||
|
25 | sleep(3) | |||
|
26 | print("Start program") | |||
|
27 | t1 = time.time() | |||
|
28 | count=0 | |||
|
29 | while(True): | |||
|
30 | tmp_vuelta = int(360/velocidad) | |||
|
31 | t1=t1+tmp_vuelta*count | |||
|
32 | count= count+1 | |||
|
33 | muestras_seg = 100 | |||
|
34 | t2 = time.time() | |||
|
35 | for i in range(tmp_vuelta): | |||
|
36 | for j in range(muestras_seg): | |||
|
37 | tmp_variable = (i+j/100.0) | |||
|
38 | ang_azi = (tmp_variable)*float(velocidad) | |||
|
39 | seconds = t1+ tmp_variable | |||
|
40 | topic=10001 | |||
|
41 | print ("Azim°: ","%.4f"%ang_azi,"Time:" ,"%.5f"%seconds) | |||
|
42 | seconds_dec=(seconds-int(seconds))*1e6 | |||
|
43 | ang_azi_dec= (ang_azi-int(ang_azi))*1e3 | |||
|
44 | ang_elev_dec=(ang_elev-int(ang_elev))*1e3 | |||
|
45 | sleep(0.0088) | |||
|
46 | socket.send_string("%d %d %d %d %d %d %d"%(topic,ang_elev,ang_elev_dec,ang_azi,ang_azi_dec,seconds,seconds_dec)) | |||
|
47 | t3 = time.time() | |||
|
48 | print ("Total time for 1 vuelta in Seconds",t3-t2) |
@@ -0,0 +1,275 | |||||
|
1 | #!python | |||
|
2 | ''' | |||
|
3 | ''' | |||
|
4 | ||||
|
5 | import os, sys | |||
|
6 | import datetime | |||
|
7 | import time | |||
|
8 | ||||
|
9 | #path = os.path.dirname(os.getcwd()) | |||
|
10 | #path = os.path.dirname(path) | |||
|
11 | #sys.path.insert(0, path) | |||
|
12 | ||||
|
13 | from schainpy.controller import Project | |||
|
14 | ||||
|
15 | desc = "USRP_test" | |||
|
16 | filename = "USRP_processing.xml" | |||
|
17 | controllerObj = Project() | |||
|
18 | controllerObj.setup(id = '191', name='Test_USRP', description=desc) | |||
|
19 | ||||
|
20 | ############## USED TO PLOT IQ VOLTAGE, POWER AND SPECTRA ############# | |||
|
21 | ||||
|
22 | ####################################################################### | |||
|
23 | ######PATH DE LECTURA, ESCRITURA, GRAFICOS Y ENVIO WEB################# | |||
|
24 | ####################################################################### | |||
|
25 | #path = '/media/data/data/vientos/57.2063km/echoes/NCO_Woodman' | |||
|
26 | #path = '/DATA_RM/TEST_INTEGRACION' | |||
|
27 | #path = '/DATA_RM/PRUEBA_USRP_RP' | |||
|
28 | path = '/DATA_RM/PRUEBA_USRP_RP' | |||
|
29 | ||||
|
30 | figpath = '/home/soporte/Pictures/TEST_RP_0001' | |||
|
31 | figpath = '/home/soporte/Pictures/TEST_RP_6000' | |||
|
32 | figpath = '/home/soporte/Pictures/USRP' | |||
|
33 | #remotefolder = "/home/wmaster/graficos" | |||
|
34 | ####################################################################### | |||
|
35 | ################# RANGO DE PLOTEO###################################### | |||
|
36 | ####################################################################### | |||
|
37 | dBmin = '-5' | |||
|
38 | dBmax = '20' | |||
|
39 | xmin = '0' | |||
|
40 | xmax ='24' | |||
|
41 | ymin = '0' | |||
|
42 | ymax = '600' | |||
|
43 | ####################################################################### | |||
|
44 | ########################FECHA########################################## | |||
|
45 | ####################################################################### | |||
|
46 | str = datetime.date.today() | |||
|
47 | today = str.strftime("%Y/%m/%d") | |||
|
48 | str2 = str - datetime.timedelta(days=1) | |||
|
49 | yesterday = str2.strftime("%Y/%m/%d") | |||
|
50 | ####################################################################### | |||
|
51 | ######################## UNIDAD DE LECTURA############################# | |||
|
52 | ####################################################################### | |||
|
53 | readUnitConfObj = controllerObj.addReadUnit(datatype='DigitalRFReader', | |||
|
54 | path=path, | |||
|
55 | startDate="2021/07/02",#today, | |||
|
56 | endDate="2021/07/02",#today, | |||
|
57 | startTime='14:50:00',# inicio libre | |||
|
58 | #startTime='00:00:00', | |||
|
59 | endTime='14:55:59', | |||
|
60 | delay=0, | |||
|
61 | #set=0, | |||
|
62 | online=0, | |||
|
63 | walk=1, | |||
|
64 | ippKm = 6000) | |||
|
65 | ||||
|
66 | opObj11 = readUnitConfObj.addOperation(name='printInfo') | |||
|
67 | #opObj11 = readUnitConfObj.addOperation(name='printNumberOfBlock') | |||
|
68 | ####################################################################### | |||
|
69 | ################ OPERACIONES DOMINIO DEL TIEMPO######################## | |||
|
70 | ####################################################################### | |||
|
71 | ||||
|
72 | procUnitConfObjA = controllerObj.addProcUnit(datatype='VoltageProc', inputId=readUnitConfObj.getId()) | |||
|
73 | ||||
|
74 | opObj11 = procUnitConfObjA.addOperation(name='selectHeights') | |||
|
75 | opObj11.addParameter(name='minIndex', value='1', format='int') | |||
|
76 | # opObj11.addParameter(name='maxIndex', value='10000', format='int') | |||
|
77 | opObj11.addParameter(name='maxIndex', value='39980', format='int') | |||
|
78 | ||||
|
79 | # | |||
|
80 | # codigo64='1,1,1,0,1,1,0,1,1,1,1,0,0,0,1,0,1,1,1,0,1,1,0,1,0,0,0,1,1,1,0,1,1,1,1,0,1,1,0,1,1,1,1,0,0,0,1,0,0,0,0,1,0,0,1,0,1,1,1,0,0,0,1,0,'+\ | |||
|
81 | # '1,1,1,0,1,1,0,1,1,1,1,0,0,0,1,0,1,1,1,0,1,1,0,1,0,0,0,1,1,1,0,1,0,0,0,1,0,0,1,0,0,0,0,1,1,1,0,1,1,1,1,0,1,1,0,1,0,0,0,1,1,1,0,1' | |||
|
82 | ||||
|
83 | #opObj11 = procUnitConfObjA.addOperation(name='setRadarFrequency') | |||
|
84 | #opObj11.addParameter(name='frequency', value='49920000') | |||
|
85 | ||||
|
86 | ''' | |||
|
87 | opObj11 = procUnitConfObjA.addOperation(name='PulsePair', optype='other') | |||
|
88 | opObj11.addParameter(name='n', value='625', format='int')#10 | |||
|
89 | opObj11.addParameter(name='removeDC', value=1, format='int') | |||
|
90 | ''' | |||
|
91 | ||||
|
92 | # Ploteo TEST | |||
|
93 | ''' | |||
|
94 | opObj11 = procUnitConfObjA.addOperation(name='PulsepairPowerPlot', optype='other') | |||
|
95 | opObj11 = procUnitConfObjA.addOperation(name='PulsepairSignalPlot', optype='other') | |||
|
96 | opObj11 = procUnitConfObjA.addOperation(name='PulsepairVelocityPlot', optype='other') | |||
|
97 | #opObj11.addParameter(name='xmax', value=8) | |||
|
98 | opObj11 = procUnitConfObjA.addOperation(name='PulsepairSpecwidthPlot', optype='other') | |||
|
99 | ''' | |||
|
100 | # OJO SCOPE | |||
|
101 | #opObj10 = procUnitConfObjA.addOperation(name='ScopePlot', optype='external') | |||
|
102 | #opObj10.addParameter(name='id', value='10', format='int') | |||
|
103 | ##opObj10.addParameter(name='xmin', value='0', format='int') | |||
|
104 | ##opObj10.addParameter(name='xmax', value='50', format='int') | |||
|
105 | #opObj10.addParameter(name='type', value='iq') | |||
|
106 | ##opObj10.addParameter(name='ymin', value='-5000', format='int') | |||
|
107 | ##opObj10.addParameter(name='ymax', value='8500', format='int') | |||
|
108 | #opObj11.addParameter(name='save', value=figpath, format='str') | |||
|
109 | #opObj11.addParameter(name='save_period', value=10, format='int') | |||
|
110 | ||||
|
111 | #opObj10 = procUnitConfObjA.addOperation(name='setH0') | |||
|
112 | #opObj10.addParameter(name='h0', value='-5000', format='float') | |||
|
113 | ||||
|
114 | #opObj11 = procUnitConfObjA.addOperation(name='filterByHeights') | |||
|
115 | #opObj11.addParameter(name='window', value='1', format='int') | |||
|
116 | ||||
|
117 | #codigo='1,1,-1,1,1,-1,1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,1,1,1,-1,-1,-1' | |||
|
118 | #opObj11 = procUnitConfObjSousy.addOperation(name='Decoder', optype='other') | |||
|
119 | #opObj11.addParameter(name='code', value=codigo, format='floatlist') | |||
|
120 | #opObj11.addParameter(name='nCode', value='1', format='int') | |||
|
121 | #opObj11.addParameter(name='nBaud', value='28', format='int') | |||
|
122 | ||||
|
123 | #opObj11 = procUnitConfObjA.addOperation(name='CohInt', optype='other') | |||
|
124 | #opObj11.addParameter(name='n', value='100', format='int') | |||
|
125 | ||||
|
126 | ####################################################################### | |||
|
127 | ########## OPERACIONES ParametersProc######################## | |||
|
128 | ####################################################################### | |||
|
129 | ###procUnitConfObjB= controllerObj.addProcUnit(datatype='ParametersProc',inputId=procUnitConfObjA.getId()) | |||
|
130 | ''' | |||
|
131 | ||||
|
132 | opObj11 = procUnitConfObjA.addOperation(name='PedestalInformation') | |||
|
133 | opObj11.addParameter(name='path_ped', value=path_ped) | |||
|
134 | opObj11.addParameter(name='path_adq', value=path_adq) | |||
|
135 | opObj11.addParameter(name='t_Interval_p', value='0.01', format='float') | |||
|
136 | opObj11.addParameter(name='n_Muestras_p', value='100', format='float') | |||
|
137 | opObj11.addParameter(name='blocksPerfile', value='100', format='int') | |||
|
138 | opObj11.addParameter(name='f_a_p', value='25', format='int') | |||
|
139 | opObj11.addParameter(name='online', value='0', format='int') | |||
|
140 | ||||
|
141 | opObj11 = procUnitConfObjA.addOperation(name='Block360') | |||
|
142 | opObj11.addParameter(name='n', value='40', format='int') | |||
|
143 | ||||
|
144 | opObj11= procUnitConfObjA.addOperation(name='WeatherPlot',optype='other') | |||
|
145 | opObj11.addParameter(name='save', value=figpath) | |||
|
146 | opObj11.addParameter(name='save_period', value=1) | |||
|
147 | ||||
|
148 | 8 | |||
|
149 | ''' | |||
|
150 | ||||
|
151 | ####################################################################### | |||
|
152 | ########## OPERACIONES DOMINIO DE LA FRECUENCIA######################## | |||
|
153 | ####################################################################### | |||
|
154 | ||||
|
155 | #procUnitConfObjB = controllerObj.addProcUnit(datatype='SpectraProc', inputId=procUnitConfObjA.getId()) | |||
|
156 | #procUnitConfObjB.addParameter(name='nFFTPoints', value='32', format='int') | |||
|
157 | #procUnitConfObjB.addParameter(name='nProfiles', value='32', format='int') | |||
|
158 | ||||
|
159 | procUnitConfObjC = controllerObj.addProcUnit(datatype='SpectraHeisProc', inputId=procUnitConfObjA.getId()) | |||
|
160 | #procUnitConfObjB.addParameter(name='nFFTPoints', value='64', format='int') | |||
|
161 | #procUnitConfObjB.addParameter(name='nProfiles', value='64', format='int') | |||
|
162 | opObj11 = procUnitConfObjC.addOperation(name='IncohInt4SpectraHeis', optype='other') | |||
|
163 | #opObj11.addParameter(name='timeInterval', value='4', format='int') | |||
|
164 | opObj11.addParameter(name='n', value='100', format='int') | |||
|
165 | ||||
|
166 | #procUnitConfObjB.addParameter(name='pairsList', value='(0,0),(1,1),(0,1)', format='pairsList') | |||
|
167 | ||||
|
168 | #opObj13 = procUnitConfObjB.addOperation(name='removeDC') | |||
|
169 | #opObj13.addParameter(name='mode', value='2', format='int') | |||
|
170 | ||||
|
171 | #opObj11 = procUnitConfObjB.addOperation(name='IncohInt', optype='other') | |||
|
172 | #opObj11.addParameter(name='n', value='8', format='float') | |||
|
173 | ####################################################################### | |||
|
174 | ########## PLOTEO DOMINIO DE LA FRECUENCIA############################# | |||
|
175 | ####################################################################### | |||
|
176 | #---- | |||
|
177 | ||||
|
178 | opObj11 = procUnitConfObjC.addOperation(name='SpectraHeisPlot') | |||
|
179 | opObj11.addParameter(name='id', value='10', format='int') | |||
|
180 | opObj11.addParameter(name='wintitle', value='Spectra_Alturas', format='str') | |||
|
181 | #opObj11.addParameter(name='xmin', value=-100000, format='float') | |||
|
182 | #opObj11.addParameter(name='xmax', value=100000, format='float') | |||
|
183 | opObj11.addParameter(name='oneFigure', value=False,format='bool') | |||
|
184 | #opObj11.addParameter(name='zmin', value=-10, format='int') | |||
|
185 | #opObj11.addParameter(name='zmax', value=40, format='int') | |||
|
186 | opObj11.addParameter(name='ymin', value=10, format='int') | |||
|
187 | opObj11.addParameter(name='ymax', value=55, format='int') | |||
|
188 | opObj11.addParameter(name='grid', value=True, format='bool') | |||
|
189 | #opObj11.addParameter(name='showprofile', value='1', format='int') | |||
|
190 | opObj11.addParameter(name='save', value=figpath, format='str') | |||
|
191 | #opObj11.addParameter(name='save_period', value=10, format='int') | |||
|
192 | ||||
|
193 | ''' | |||
|
194 | opObj11 = procUnitConfObjC.addOperation(name='RTIHeisPlot') | |||
|
195 | opObj11.addParameter(name='id', value='10', format='int') | |||
|
196 | opObj11.addParameter(name='wintitle', value='RTI_Alturas', format='str') | |||
|
197 | opObj11.addParameter(name='xmin', value=11.0, format='float') | |||
|
198 | opObj11.addParameter(name='xmax', value=18.0, format='float') | |||
|
199 | opObj11.addParameter(name='zmin', value=10, format='int') | |||
|
200 | opObj11.addParameter(name='zmax', value=30, format='int') | |||
|
201 | opObj11.addParameter(name='ymin', value=5, format='int') | |||
|
202 | opObj11.addParameter(name='ymax', value=28, format='int') | |||
|
203 | opObj11.addParameter(name='showprofile', value='1', format='int') | |||
|
204 | opObj11.addParameter(name='save', value=figpath, format='str') | |||
|
205 | opObj11.addParameter(name='save_period', value=10, format='int') | |||
|
206 | ''' | |||
|
207 | ''' | |||
|
208 | #SpectraPlot | |||
|
209 | ||||
|
210 | opObj11 = procUnitConfObjB.addOperation(name='SpectraPlot', optype='external') | |||
|
211 | opObj11.addParameter(name='id', value='1', format='int') | |||
|
212 | opObj11.addParameter(name='wintitle', value='Spectra', format='str') | |||
|
213 | #opObj11.addParameter(name='xmin', value=-0.01, format='float') | |||
|
214 | #opObj11.addParameter(name='xmax', value=0.01, format='float') | |||
|
215 | opObj11.addParameter(name='zmin', value=dBmin, format='int') | |||
|
216 | opObj11.addParameter(name='zmax', value=dBmax, format='int') | |||
|
217 | #opObj11.addParameter(name='ymin', value=ymin, format='int') | |||
|
218 | #opObj11.addParameter(name='ymax', value=ymax, format='int') | |||
|
219 | opObj11.addParameter(name='showprofile', value='1', format='int') | |||
|
220 | opObj11.addParameter(name='save', value=figpath, format='str') | |||
|
221 | opObj11.addParameter(name='save_period', value=10, format='int') | |||
|
222 | ||||
|
223 | #RTIPLOT | |||
|
224 | ||||
|
225 | opObj11 = procUnitConfObjB.addOperation(name='RTIPlot', optype='external') | |||
|
226 | opObj11.addParameter(name='id', value='2', format='int') | |||
|
227 | opObj11.addParameter(name='wintitle', value='RTIPlot', format='str') | |||
|
228 | opObj11.addParameter(name='zmin', value=dBmin, format='int') | |||
|
229 | opObj11.addParameter(name='zmax', value=dBmax, format='int') | |||
|
230 | #opObj11.addParameter(name='ymin', value=ymin, format='int') | |||
|
231 | #opObj11.addParameter(name='ymax', value=ymax, format='int') | |||
|
232 | #opObj11.addParameter(name='xmin', value=15, format='int') | |||
|
233 | #opObj11.addParameter(name='xmax', value=16, format='int') | |||
|
234 | ||||
|
235 | opObj11.addParameter(name='showprofile', value='1', format='int') | |||
|
236 | opObj11.addParameter(name='save', value=figpath, format='str') | |||
|
237 | opObj11.addParameter(name='save_period', value=10, format='int') | |||
|
238 | ||||
|
239 | ''' | |||
|
240 | # opObj11 = procUnitConfObjB.addOperation(name='CrossSpectraPlot', optype='other') | |||
|
241 | # opObj11.addParameter(name='id', value='3', format='int') | |||
|
242 | # opObj11.addParameter(name='wintitle', value='CrossSpectraPlot', format='str') | |||
|
243 | # opObj11.addParameter(name='ymin', value=ymin, format='int') | |||
|
244 | # opObj11.addParameter(name='ymax', value=ymax, format='int') | |||
|
245 | # opObj11.addParameter(name='phase_cmap', value='jet', format='str') | |||
|
246 | # opObj11.addParameter(name='zmin', value=dBmin, format='int') | |||
|
247 | # opObj11.addParameter(name='zmax', value=dBmax, format='int') | |||
|
248 | # opObj11.addParameter(name='figpath', value=figures_path, format='str') | |||
|
249 | # opObj11.addParameter(name='save', value=0, format='bool') | |||
|
250 | # opObj11.addParameter(name='pairsList', value='(0,1)', format='pairsList') | |||
|
251 | # # | |||
|
252 | # opObj11 = procUnitConfObjB.addOperation(name='CoherenceMap', optype='other') | |||
|
253 | # opObj11.addParameter(name='id', value='4', format='int') | |||
|
254 | # opObj11.addParameter(name='wintitle', value='Coherence', format='str') | |||
|
255 | # opObj11.addParameter(name='phase_cmap', value='jet', format='str') | |||
|
256 | # opObj11.addParameter(name='xmin', value=xmin, format='float') | |||
|
257 | # opObj11.addParameter(name='xmax', value=xmax, format='float') | |||
|
258 | # opObj11.addParameter(name='figpath', value=figures_path, format='str') | |||
|
259 | # opObj11.addParameter(name='save', value=0, format='bool') | |||
|
260 | # opObj11.addParameter(name='pairsList', value='(0,1)', format='pairsList') | |||
|
261 | # | |||
|
262 | ||||
|
263 | ''' | |||
|
264 | ####################################################################### | |||
|
265 | ############### UNIDAD DE ESCRITURA ################################### | |||
|
266 | ####################################################################### | |||
|
267 | #opObj11 = procUnitConfObjB.addOperation(name='SpectraWriter', optype='other') | |||
|
268 | #opObj11.addParameter(name='path', value=wr_path) | |||
|
269 | #opObj11.addParameter(name='blocksPerFile', value='50', format='int') | |||
|
270 | print ("Escribiendo el archivo XML") | |||
|
271 | print ("Leyendo el archivo XML") | |||
|
272 | ''' | |||
|
273 | ||||
|
274 | ||||
|
275 | controllerObj.start() |
@@ -0,0 +1,126 | |||||
|
1 | #!python | |||
|
2 | ''' | |||
|
3 | ''' | |||
|
4 | ||||
|
5 | import os, sys | |||
|
6 | import datetime | |||
|
7 | import time | |||
|
8 | ||||
|
9 | #path = os.path.dirname(os.getcwd()) | |||
|
10 | #path = os.path.dirname(path) | |||
|
11 | #sys.path.insert(0, path) | |||
|
12 | ||||
|
13 | from schainpy.controller import Project | |||
|
14 | ||||
|
15 | desc = "USRP_test" | |||
|
16 | filename = "USRP_processing.xml" | |||
|
17 | controllerObj = Project() | |||
|
18 | controllerObj.setup(id = '191', name='Test_USRP', description=desc) | |||
|
19 | ||||
|
20 | ############## USED TO PLOT IQ VOLTAGE, POWER AND SPECTRA ############# | |||
|
21 | ||||
|
22 | ####################################################################### | |||
|
23 | ######PATH DE LECTURA, ESCRITURA, GRAFICOS Y ENVIO WEB################# | |||
|
24 | ####################################################################### | |||
|
25 | #path = '/media/data/data/vientos/57.2063km/echoes/NCO_Woodman' | |||
|
26 | #path = '/DATA_RM/TEST_INTEGRACION' | |||
|
27 | path = '/DATA_RM/TEST_ONLINE' | |||
|
28 | path_pp = '/DATA_RM/TEST_HDF5' | |||
|
29 | ||||
|
30 | figpath = '/home/soporte/Pictures/TEST_INTEGRACION_IMG' | |||
|
31 | #remotefolder = "/home/wmaster/graficos" | |||
|
32 | ####################################################################### | |||
|
33 | ################# RANGO DE PLOTEO###################################### | |||
|
34 | ####################################################################### | |||
|
35 | dBmin = '-5' | |||
|
36 | dBmax = '20' | |||
|
37 | xmin = '0' | |||
|
38 | xmax ='24' | |||
|
39 | ymin = '0' | |||
|
40 | ymax = '600' | |||
|
41 | ####################################################################### | |||
|
42 | ########################FECHA########################################## | |||
|
43 | ####################################################################### | |||
|
44 | str = datetime.date.today() | |||
|
45 | today = str.strftime("%Y/%m/%d") | |||
|
46 | str2 = str - datetime.timedelta(days=1) | |||
|
47 | yesterday = str2.strftime("%Y/%m/%d") | |||
|
48 | ####################################################################### | |||
|
49 | ######################## UNIDAD DE LECTURA############################# | |||
|
50 | ####################################################################### | |||
|
51 | readUnitConfObj = controllerObj.addReadUnit(datatype='DigitalRFReader', | |||
|
52 | path=path, | |||
|
53 | startDate="2021/01/01",#today, | |||
|
54 | endDate="2021/12/30",#today, | |||
|
55 | startTime='00:00:00', | |||
|
56 | endTime='23:59:59', | |||
|
57 | delay=0, | |||
|
58 | #set=0, | |||
|
59 | online=1, | |||
|
60 | walk=1, | |||
|
61 | ippKm = 60) | |||
|
62 | ||||
|
63 | opObj11 = readUnitConfObj.addOperation(name='printInfo') | |||
|
64 | #opObj11 = readUnitConfObj.addOperation(name='printNumberOfBlock') | |||
|
65 | ####################################################################### | |||
|
66 | ################ OPERACIONES DOMINIO DEL TIEMPO######################## | |||
|
67 | ####################################################################### | |||
|
68 | ||||
|
69 | procUnitConfObjA = controllerObj.addProcUnit(datatype='VoltageProc', inputId=readUnitConfObj.getId()) | |||
|
70 | ||||
|
71 | # | |||
|
72 | # codigo64='1,1,1,0,1,1,0,1,1,1,1,0,0,0,1,0,1,1,1,0,1,1,0,1,0,0,0,1,1,1,0,1,1,1,1,0,1,1,0,1,1,1,1,0,0,0,1,0,0,0,0,1,0,0,1,0,1,1,1,0,0,0,1,0,'+\ | |||
|
73 | # '1,1,1,0,1,1,0,1,1,1,1,0,0,0,1,0,1,1,1,0,1,1,0,1,0,0,0,1,1,1,0,1,0,0,0,1,0,0,1,0,0,0,0,1,1,1,0,1,1,1,1,0,1,1,0,1,0,0,0,1,1,1,0,1' | |||
|
74 | ||||
|
75 | #opObj11 = procUnitConfObjA.addOperation(name='setRadarFrequency') | |||
|
76 | #opObj11.addParameter(name='frequency', value='70312500') | |||
|
77 | opObj11 = procUnitConfObjA.addOperation(name='PulsePair', optype='other') | |||
|
78 | opObj11.addParameter(name='n', value='625', format='int')#10 | |||
|
79 | opObj11.addParameter(name='removeDC', value=1, format='int') | |||
|
80 | # Ploteo TEST | |||
|
81 | ''' | |||
|
82 | opObj11 = procUnitConfObjA.addOperation(name='PulsepairPowerPlot', optype='other') | |||
|
83 | opObj11 = procUnitConfObjA.addOperation(name='PulsepairSignalPlot', optype='other') | |||
|
84 | opObj11 = procUnitConfObjA.addOperation(name='PulsepairVelocityPlot', optype='other') | |||
|
85 | #opObj11.addParameter(name='xmax', value=8) | |||
|
86 | opObj11 = procUnitConfObjA.addOperation(name='PulsepairSpecwidthPlot', optype='other') | |||
|
87 | ''' | |||
|
88 | # OJO SCOPE | |||
|
89 | #opObj10 = procUnitConfObjA.addOperation(name='ScopePlot', optype='external') | |||
|
90 | #opObj10.addParameter(name='id', value='10', format='int') | |||
|
91 | ##opObj10.addParameter(name='xmin', value='0', format='int') | |||
|
92 | ##opObj10.addParameter(name='xmax', value='50', format='int') | |||
|
93 | #opObj10.addParameter(name='type', value='iq') | |||
|
94 | ##opObj10.addParameter(name='ymin', value='-5000', format='int') | |||
|
95 | ##opObj10.addParameter(name='ymax', value='8500', format='int') | |||
|
96 | #opObj11.addParameter(name='save', value=figpath, format='str') | |||
|
97 | #opObj11.addParameter(name='save_period', value=10, format='int') | |||
|
98 | ||||
|
99 | #opObj10 = procUnitConfObjA.addOperation(name='setH0') | |||
|
100 | #opObj10.addParameter(name='h0', value='-5000', format='float') | |||
|
101 | ||||
|
102 | #opObj11 = procUnitConfObjA.addOperation(name='filterByHeights') | |||
|
103 | #opObj11.addParameter(name='window', value='1', format='int') | |||
|
104 | ||||
|
105 | #codigo='1,1,-1,1,1,-1,1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,1,1,1,-1,-1,-1' | |||
|
106 | #opObj11 = procUnitConfObjSousy.addOperation(name='Decoder', optype='other') | |||
|
107 | #opObj11.addParameter(name='code', value=codigo, formatyesterday='floatlist') | |||
|
108 | #opObj11.addParameter(name='nCode', value='1', format='int') | |||
|
109 | #opObj11.addParameter(name='nBaud', value='28', format='int') | |||
|
110 | ||||
|
111 | #opObj11 = procUnitConfObjA.addOperation(name='CohInt', optype='other') | |||
|
112 | #opObj11.addParameter(name='n', value='100', format='int') | |||
|
113 | ||||
|
114 | ####################################################################### | |||
|
115 | ########## OPERACIONES ParametersProc######################## | |||
|
116 | ####################################################################### | |||
|
117 | ||||
|
118 | procUnitConfObjB= controllerObj.addProcUnit(datatype='ParametersProc',inputId=procUnitConfObjA.getId()) | |||
|
119 | opObj10 = procUnitConfObjB.addOperation(name='HDFWriter') | |||
|
120 | opObj10.addParameter(name='path',value=path_pp) | |||
|
121 | #opObj10.addParameter(name='mode',value=0) | |||
|
122 | opObj10.addParameter(name='blocksPerFile',value='100',format='int') | |||
|
123 | opObj10.addParameter(name='metadataList',value='utctimeInit,timeZone,paramInterval,profileIndex,channelList,heightList,flagDataAsBlock',format='list') | |||
|
124 | opObj10.addParameter(name='dataList',value='dataPP_POW,dataPP_DOP,utctime',format='list')#,format='list' | |||
|
125 | ||||
|
126 | controllerObj.start() |
@@ -0,0 +1,126 | |||||
|
1 | #!python | |||
|
2 | ''' | |||
|
3 | ''' | |||
|
4 | ||||
|
5 | import os, sys | |||
|
6 | import datetime | |||
|
7 | import time | |||
|
8 | ||||
|
9 | #path = os.path.dirname(os.getcwd()) | |||
|
10 | #path = os.path.dirname(path) | |||
|
11 | #sys.path.insert(0, path) | |||
|
12 | ||||
|
13 | from schainpy.controller import Project | |||
|
14 | ||||
|
15 | desc = "USRP_test" | |||
|
16 | filename = "USRP_processing.xml" | |||
|
17 | controllerObj = Project() | |||
|
18 | controllerObj.setup(id = '191', name='Test_USRP', description=desc) | |||
|
19 | ||||
|
20 | ############## USED TO PLOT IQ VOLTAGE, POWER AND SPECTRA ############# | |||
|
21 | ||||
|
22 | ####################################################################### | |||
|
23 | ######PATH DE LECTURA, ESCRITURA, GRAFICOS Y ENVIO WEB################# | |||
|
24 | ####################################################################### | |||
|
25 | #path = '/media/data/data/vientos/57.2063km/echoes/NCO_Woodman' | |||
|
26 | #path = '/DATA_RM/TEST_INTEGRACION' | |||
|
27 | path = '/DATA_RM/TEST_ONLINE' | |||
|
28 | path_pp = '/DATA_RM/TEST_HDF5' | |||
|
29 | ||||
|
30 | figpath = '/home/soporte/Pictures/TEST_INTEGRACION_IMG' | |||
|
31 | #remotefolder = "/home/wmaster/graficos" | |||
|
32 | ####################################################################### | |||
|
33 | ################# RANGO DE PLOTEO###################################### | |||
|
34 | ####################################################################### | |||
|
35 | dBmin = '-5' | |||
|
36 | dBmax = '20' | |||
|
37 | xmin = '0' | |||
|
38 | xmax ='24' | |||
|
39 | ymin = '0' | |||
|
40 | ymax = '600' | |||
|
41 | ####################################################################### | |||
|
42 | ########################FECHA########################################## | |||
|
43 | ####################################################################### | |||
|
44 | str = datetime.date.today() | |||
|
45 | today = str.strftime("%Y/%m/%d") | |||
|
46 | str2 = str - datetime.timedelta(days=1) | |||
|
47 | yesterday = str2.strftime("%Y/%m/%d") | |||
|
48 | ####################################################################### | |||
|
49 | ######################## UNIDAD DE LECTURA############################# | |||
|
50 | ####################################################################### | |||
|
51 | readUnitConfObj = controllerObj.addReadUnit(datatype='DigitalRFReader', | |||
|
52 | path=path, | |||
|
53 | startDate="2021/01/01",#today, | |||
|
54 | endDate="2021/12/30",#today, | |||
|
55 | startTime='00:00:00', | |||
|
56 | endTime='23:59:59', | |||
|
57 | delay=0, | |||
|
58 | #set=0, | |||
|
59 | online=1, | |||
|
60 | walk=1, | |||
|
61 | ippKm = 60) | |||
|
62 | ||||
|
63 | opObj11 = readUnitConfObj.addOperation(name='printInfo') | |||
|
64 | #opObj11 = readUnitConfObj.addOperation(name='printNumberOfBlock') | |||
|
65 | ####################################################################### | |||
|
66 | ################ OPERACIONES DOMINIO DEL TIEMPO######################## | |||
|
67 | ####################################################################### | |||
|
68 | ||||
|
69 | procUnitConfObjA = controllerObj.addProcUnit(datatype='VoltageProc', inputId=readUnitConfObj.getId()) | |||
|
70 | ||||
|
71 | # | |||
|
72 | # codigo64='1,1,1,0,1,1,0,1,1,1,1,0,0,0,1,0,1,1,1,0,1,1,0,1,0,0,0,1,1,1,0,1,1,1,1,0,1,1,0,1,1,1,1,0,0,0,1,0,0,0,0,1,0,0,1,0,1,1,1,0,0,0,1,0,'+\ | |||
|
73 | # '1,1,1,0,1,1,0,1,1,1,1,0,0,0,1,0,1,1,1,0,1,1,0,1,0,0,0,1,1,1,0,1,0,0,0,1,0,0,1,0,0,0,0,1,1,1,0,1,1,1,1,0,1,1,0,1,0,0,0,1,1,1,0,1' | |||
|
74 | ||||
|
75 | #opObj11 = procUnitConfObjA.addOperation(name='setRadarFrequency') | |||
|
76 | #opObj11.addParameter(name='frequency', value='70312500') | |||
|
77 | opObj11 = procUnitConfObjA.addOperation(name='PulsePair', optype='other') | |||
|
78 | opObj11.addParameter(name='n', value='625', format='int')#10 | |||
|
79 | opObj11.addParameter(name='removeDC', value=1, format='int') | |||
|
80 | # Ploteo TEST | |||
|
81 | ''' | |||
|
82 | opObj11 = procUnitConfObjA.addOperation(name='PulsepairPowerPlot', optype='other') | |||
|
83 | opObj11 = procUnitConfObjA.addOperation(name='PulsepairSignalPlot', optype='other') | |||
|
84 | opObj11 = procUnitConfObjA.addOperation(name='PulsepairVelocityPlot', optype='other') | |||
|
85 | #opObj11.addParameter(name='xmax', value=8) | |||
|
86 | opObj11 = procUnitConfObjA.addOperation(name='PulsepairSpecwidthPlot', optype='other') | |||
|
87 | ''' | |||
|
88 | # OJO SCOPE | |||
|
89 | #opObj10 = procUnitConfObjA.addOperation(name='ScopePlot', optype='external') | |||
|
90 | #opObj10.addParameter(name='buffer_sizeid', value='10', format='int') | |||
|
91 | ##opObj10.addParameter(name='xmin', value='0', format='int') | |||
|
92 | ##opObj10.addParameter(name='xmax', value='50', format='int') | |||
|
93 | #opObj10.addParameter(name='type', value='iq') | |||
|
94 | ##opObj10.addParameter(name='ymin', value='-5000', format='int') | |||
|
95 | ##opObj10.addParameter(name='ymax', value='8500', format='int') | |||
|
96 | #opObj11.addParameter(name='save', value=figpath, format='str') | |||
|
97 | #opObj11.addParameter(name='save_period', value=10, format='int') | |||
|
98 | ||||
|
99 | #opObj10 = procUnitConfObjA.addOperation(name='setH0') | |||
|
100 | #opObj10.addParameter(name='h0', value='-5000', format='float') | |||
|
101 | ||||
|
102 | #opObj11 = procUnitConfObjA.addOperation(name='filterByHeights') | |||
|
103 | #opObj11.addParameter(name='window', value='1', format='int') | |||
|
104 | ||||
|
105 | #codigo='1,1,-1,1,1,-1,1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,1,1,1,-1,-1,-1' | |||
|
106 | #opObj11 = procUnitConfObjSousy.addOperation(name='Decoder', optype='other') | |||
|
107 | #opObj11.addParameter(name='code', value=codigo, formatyesterday='floatlist') | |||
|
108 | #opObj11.addParameter(name='nCode', value='1', format='int') | |||
|
109 | #opObj11.addParameter(name='nBaud', value='28', format='int') | |||
|
110 | ||||
|
111 | #opObj11 = procUnitConfObjA.addOperation(name='CohInt', optype='other') | |||
|
112 | #opObj11.addParameter(name='n', value='100', format='int') | |||
|
113 | ||||
|
114 | ####################################################################### | |||
|
115 | ########## OPERACIONES ParametersProc######################## | |||
|
116 | ####################################################################### | |||
|
117 | ||||
|
118 | procUnitConfObjB= controllerObj.addProcUnit(datatype='ParametersProc',inputId=procUnitConfObjA.getId()) | |||
|
119 | opObj10 = procUnitConfObjB.addOperation(name='HDFWriter') | |||
|
120 | opObj10.addParameter(name='path',value=path_pp) | |||
|
121 | #opObj10.addParameter(name='mode',value=0) | |||
|
122 | opObj10.addParameter(name='blocksPerFile',value='100',format='int') | |||
|
123 | opObj10.addParameter(name='metadataList',value='utctimeInit,timeZone,paramInterval,profileIndex,channelList,heightList,flagDataAsBlock',format='list') | |||
|
124 | opObj10.addParameter(name='dataList',value='dataPP_POW,dataPP_DOP,utctime',format='list')#,format='list' | |||
|
125 | ||||
|
126 | controllerObj.start() |
@@ -0,0 +1,52 | |||||
|
1 | import os,sys | |||
|
2 | import datetime | |||
|
3 | import time | |||
|
4 | from schainpy.controller import Project | |||
|
5 | #path='/DATA_RM/TEST_HDF5/d2021200' | |||
|
6 | #path='/DATA_RM/TEST_HDF5/d2021200' | |||
|
7 | path='/DATA_RM/TEST_HDF5/d2021203' | |||
|
8 | ||||
|
9 | path_adq=path | |||
|
10 | #path_ped='/DATA_RM/TEST_PEDESTAL/P2021200' | |||
|
11 | path_ped='/DATA_RM/TEST_PEDESTAL/P2021203' | |||
|
12 | ||||
|
13 | figpath = '/home/soporte/Pictures' | |||
|
14 | desc = "Simulator Test" | |||
|
15 | ||||
|
16 | controllerObj = Project() | |||
|
17 | controllerObj.setup(id='10',name='Test Simulator',description=desc) | |||
|
18 | readUnitConfObj = controllerObj.addReadUnit(datatype='HDFReader', | |||
|
19 | path=path, | |||
|
20 | startDate="2021/01/01", #"2020/01/01",#today, | |||
|
21 | endDate= "2021/12/01", #"2020/12/30",#today, | |||
|
22 | startTime='00:00:00', | |||
|
23 | endTime='23:59:59', | |||
|
24 | t_Interval_p=0.01, | |||
|
25 | n_Muestras_p=100, | |||
|
26 | delay=5, | |||
|
27 | #set=0, | |||
|
28 | online=0, | |||
|
29 | walk=0)#1 | |||
|
30 | ||||
|
31 | procUnitConfObjA = controllerObj.addProcUnit(datatype='ParametersProc',inputId=readUnitConfObj.getId()) | |||
|
32 | ||||
|
33 | opObj11 = procUnitConfObjA.addOperation(name='PedestalInformation') | |||
|
34 | opObj11.addParameter(name='path_ped', value=path_ped) | |||
|
35 | opObj11.addParameter(name='path_adq', value=path_adq) | |||
|
36 | opObj11.addParameter(name='t_Interval_p', value='0.01', format='float') | |||
|
37 | opObj11.addParameter(name='n_Muestras_p', value='100', format='float') | |||
|
38 | opObj11.addParameter(name='blocksPerfile', value='100', format='int') | |||
|
39 | opObj11.addParameter(name='f_a_p', value='25', format='int') | |||
|
40 | opObj11.addParameter(name='online', value='0', format='int') | |||
|
41 | ||||
|
42 | ||||
|
43 | opObj11 = procUnitConfObjA.addOperation(name='Block360') | |||
|
44 | opObj11.addParameter(name='n', value='40', format='int') | |||
|
45 | ||||
|
46 | opObj11= procUnitConfObjA.addOperation(name='WeatherPlot',optype='other') | |||
|
47 | opObj11.addParameter(name='save', value=figpath) | |||
|
48 | opObj11.addParameter(name='save_period', value=1) | |||
|
49 | ||||
|
50 | controllerObj.start() | |||
|
51 | #online 1 utc_adq 1617490240.48 | |||
|
52 | #online 0 utc_adq 1617489815.4804 |
@@ -0,0 +1,59 | |||||
|
1 | import os,sys | |||
|
2 | import datetime | |||
|
3 | import time | |||
|
4 | from schainpy.controller import Project | |||
|
5 | #path='/DATA_RM/TEST_HDF5/d2021200' | |||
|
6 | #path='/DATA_RM/TEST_HDF5/d2021200' | |||
|
7 | #path='/DATA_RM/TEST_HDF5/d2021214' | |||
|
8 | #path='/DATA_RM/TEST_HDF5/d2021229' | |||
|
9 | ||||
|
10 | path='/DATA_RM/TEST_HDF5/d2021231' | |||
|
11 | ||||
|
12 | ||||
|
13 | path_adq=path | |||
|
14 | #path_ped='/DATA_RM/TEST_PEDESTAL/P2021200' | |||
|
15 | #path_ped='/DATA_RM/TEST_PEDESTAL/P2021214' | |||
|
16 | #path_ped='/DATA_RM/TEST_PEDESTAL/P2021230' | |||
|
17 | path_ped='/DATA_RM/TEST_PEDESTAL/P20210819' | |||
|
18 | figpath = '/home/soporte/Pictures' | |||
|
19 | desc = "Simulator Test" | |||
|
20 | ||||
|
21 | controllerObj = Project() | |||
|
22 | controllerObj.setup(id='10',name='Test Simulator',description=desc) | |||
|
23 | readUnitConfObj = controllerObj.addReadUnit(datatype='HDFReader', | |||
|
24 | path=path, | |||
|
25 | startDate="2021/01/01", #"2020/01/01",#today, | |||
|
26 | endDate= "2021/12/01", #"2020/12/30",#today, | |||
|
27 | startTime='00:00:00', | |||
|
28 | endTime='23:59:59', | |||
|
29 | t_Interval_p=0.01, | |||
|
30 | n_Muestras_p=100, | |||
|
31 | delay=30, | |||
|
32 | #set=0, | |||
|
33 | online=1, | |||
|
34 | walk=0, | |||
|
35 | nTries=6)#1 | |||
|
36 | ||||
|
37 | procUnitConfObjA = controllerObj.addProcUnit(datatype='ParametersProc',inputId=readUnitConfObj.getId()) | |||
|
38 | ||||
|
39 | opObj11 = procUnitConfObjA.addOperation(name='PedestalInformation') | |||
|
40 | opObj11.addParameter(name='path_ped', value=path_ped) | |||
|
41 | opObj11.addParameter(name='path_adq', value=path_adq) | |||
|
42 | opObj11.addParameter(name='t_Interval_p', value='0.01', format='float') | |||
|
43 | opObj11.addParameter(name='n_Muestras_p', value='100', format='float') | |||
|
44 | opObj11.addParameter(name='blocksPerfile', value='100', format='int') | |||
|
45 | opObj11.addParameter(name='f_a_p', value='25', format='int') | |||
|
46 | opObj11.addParameter(name='online', value='1', format='int')# habilitar el enable aqui tambien | |||
|
47 | ||||
|
48 | ||||
|
49 | opObj11 = procUnitConfObjA.addOperation(name='Block360') | |||
|
50 | opObj11.addParameter(name='n', value='40', format='int') | |||
|
51 | # este bloque funciona bien con divisores de 360 no olvidar 0 10 20 30 40 60 90 120 180 | |||
|
52 | ||||
|
53 | opObj11= procUnitConfObjA.addOperation(name='WeatherPlot',optype='other') | |||
|
54 | opObj11.addParameter(name='save', value=figpath) | |||
|
55 | opObj11.addParameter(name='save_period', value=1) | |||
|
56 | ||||
|
57 | controllerObj.start() | |||
|
58 | #online 1 utc_adq 1617490240.48 | |||
|
59 | #online 0 utc_adq 1617489815.4804 |
@@ -0,0 +1,35 | |||||
|
1 | #******************************************************************************* | |||
|
2 | #*************ARCHIVO DE CONFIGURACION - RADAR METEOROLOGICO******************** | |||
|
3 | #******************************************************************************* | |||
|
4 | # 1-Resolucion_angular(Grados º)-F | |||
|
5 | 1.0 | |||
|
6 | # 2-Velocidad_Pedestal Azimuth(º/s)-F | |||
|
7 | 4.0 | |||
|
8 | # 3-Posicion_Pedestal Azimuth(º/s)-F | |||
|
9 | 0.0 | |||
|
10 | # 4-Posicion_Pedestal Elevacion(º/s)-F | |||
|
11 | 30.0 | |||
|
12 | # 5-IPP(useg)-F | |||
|
13 | 400 | |||
|
14 | # n-PulsePair-nFFTPoints-R | |||
|
15 | 625 | |||
|
16 | # 6-Cantidad_Muestras_archivo_pedestal-F | |||
|
17 | 100 | |||
|
18 | # 7-Tiempo_por_muestra_pedestal-F | |||
|
19 | 0.01 | |||
|
20 | # Tiempo_archivo_por_pedestal-R | |||
|
21 | 1.0 | |||
|
22 | # 8-Bloques_por_arhivo_adquisicion-F | |||
|
23 | 100.0 | |||
|
24 | # tiempo_por_archivo_adquisicion-R | |||
|
25 | 25.0 | |||
|
26 | # mode Time Domain(T , 1) or Frequency Domain(F , 0) | |||
|
27 | 1 | |||
|
28 | # path_p | |||
|
29 | /home/developer/Downloads/Pedestal/P2021093 | |||
|
30 | # path_a | |||
|
31 | /home/developer/Downloads/HDF5_TESTPP2V3/d2021093 | |||
|
32 | # online | |||
|
33 | 0 | |||
|
34 | # Directorio final | |||
|
35 | /home/developer/Downloads/HDF5_WR/ |
@@ -0,0 +1,70 | |||||
|
1 | print("LECTURA DE ARCHIVOS DE CONFIGURACION") | |||
|
2 | class ReadfileWR(): | |||
|
3 | def __init__(self,filename): | |||
|
4 | f = open(filename, "r") | |||
|
5 | i=0 | |||
|
6 | self.dict={'paht_ped':None,'path_adq':None,'path_res':None,'resolution':None,'vel_ped_azi':None,'pos_ped_azi':None,'pos_ped_ele':None,'ipp':None,'n':None,'len_ped':None,\ | |||
|
7 | 't_s_ped':None,'t_f_ped':None,'b_f_adq':None,'t_f_adq':None,'mode':None,'online':None} | |||
|
8 | while(True): | |||
|
9 | ##print(i) | |||
|
10 | linea = f.readline() | |||
|
11 | if i==4: | |||
|
12 | resolution=float(linea) | |||
|
13 | self.dict['resolution']=resolution | |||
|
14 | if i==6: | |||
|
15 | vel_pedestal_a=float(linea) | |||
|
16 | self.dict['vel_ped_azi']=vel_pedestal_a | |||
|
17 | if i==8: | |||
|
18 | pos_pedestal_a=float(linea) | |||
|
19 | self.dict['pos_ped_azi']=pos_pedestal_a | |||
|
20 | if i==10: | |||
|
21 | pos_pedestal_e=float(linea) | |||
|
22 | self.dict['pos_ped_ele']=pos_pedestal_e | |||
|
23 | if i==12: | |||
|
24 | ipp = float(linea) | |||
|
25 | self.dict['ipp']= round(ipp,5) | |||
|
26 | if i==14: | |||
|
27 | n = float(linea) | |||
|
28 | self.dict['n']= n | |||
|
29 | if i==16: | |||
|
30 | len_pedestal= float(linea) | |||
|
31 | self.dict['len_ped']= len_pedestal | |||
|
32 | if i==18: | |||
|
33 | time_x_sample_ped=float(linea) | |||
|
34 | self.dict['t_s_ped']= time_x_sample_ped | |||
|
35 | if i==20: | |||
|
36 | time_x_file_ped = float(linea) | |||
|
37 | self.dict['t_f_ped']= time_x_file_ped | |||
|
38 | if i==22: | |||
|
39 | bloques_x_file_adq= float(linea) | |||
|
40 | self.dict['b_f_adq']=bloques_x_file_adq | |||
|
41 | if i==24: | |||
|
42 | time_x_file_adq = float(linea) | |||
|
43 | self.dict['t_f_adq'] = time_x_file_adq | |||
|
44 | if i==26: | |||
|
45 | mode= int(linea) | |||
|
46 | self.dict['mode'] = mode | |||
|
47 | if i==28: | |||
|
48 | path_p= str(linea) | |||
|
49 | self.dict['path_ped'] = path_p | |||
|
50 | if i==30: | |||
|
51 | path_a= str(linea) | |||
|
52 | self.dict['path_adq'] = path_a | |||
|
53 | if i==32: | |||
|
54 | online= int(linea) | |||
|
55 | self.dict['online'] = online | |||
|
56 | if i==34: | |||
|
57 | path_r= str(linea) | |||
|
58 | self.dict['path_res'] = path_r | |||
|
59 | #print(linea) | |||
|
60 | if not linea: | |||
|
61 | break | |||
|
62 | i+=1 | |||
|
63 | f.close() | |||
|
64 | def getDict(self): | |||
|
65 | return self.dict | |||
|
66 | ||||
|
67 | ||||
|
68 | #filename= "/home/developer/Downloads/config_WR.txt" | |||
|
69 | #dict= ReadfileWR(filename).getDict() | |||
|
70 | #print(dict) |
@@ -0,0 +1,118 | |||||
|
1 | #!python | |||
|
2 | ''' | |||
|
3 | ''' | |||
|
4 | ||||
|
5 | import os, sys | |||
|
6 | import datetime | |||
|
7 | import time | |||
|
8 | ||||
|
9 | ||||
|
10 | from schainpy.controller import Project | |||
|
11 | ||||
|
12 | desc = "USRP_test" | |||
|
13 | filename = "USRP_processing.xml" | |||
|
14 | controllerObj = Project() | |||
|
15 | controllerObj.setup(id = '191', name='Test_USRP', description=desc) | |||
|
16 | ||||
|
17 | ############## USED TO PLOT IQ VOLTAGE, POWER AND SPECTRA ############# | |||
|
18 | ||||
|
19 | ####################################################################### | |||
|
20 | ######PATH DE LECTURA, ESCRITURA, GRAFICOS Y ENVIO WEB################# | |||
|
21 | ####################################################################### | |||
|
22 | # path IVAN | |||
|
23 | path = '/home/soporte/jarsjuliahigh/high' | |||
|
24 | ||||
|
25 | figpath = '/home/soporte/Pictures/IVAN' | |||
|
26 | #remotefolder = "/home/wmaster/graficos" | |||
|
27 | ####################################################################### | |||
|
28 | ################# RANGO DE PLOTEO###################################### | |||
|
29 | ####################################################################### | |||
|
30 | dBmin = '10' | |||
|
31 | dBmax = '55' | |||
|
32 | xmin = '0' | |||
|
33 | xmax ='24' | |||
|
34 | ymin = '0' | |||
|
35 | ymax = '600' | |||
|
36 | ####################################################################### | |||
|
37 | ########################FECHA########################################## | |||
|
38 | ####################################################################### | |||
|
39 | str = datetime.date.today() | |||
|
40 | today = str.strftime("%Y/%m/%d") | |||
|
41 | str2 = str - datetime.timedelta(days=1) | |||
|
42 | yesterday = str2.strftime("%Y/%m/%d") | |||
|
43 | ####################################################################### | |||
|
44 | ######################## UNIDAD DE LECTURA############################# | |||
|
45 | ####################################################################### | |||
|
46 | readUnitConfObj = controllerObj.addReadUnit(datatype='VoltageReader', | |||
|
47 | path=path, | |||
|
48 | startDate="2021/07/02",#today, | |||
|
49 | endDate="2021/07/02",#today, | |||
|
50 | startTime='14:50:01',# inicio libre | |||
|
51 | endTime='14:55:59', | |||
|
52 | delay=0, | |||
|
53 | #set=0, | |||
|
54 | online=0, | |||
|
55 | walk=0) | |||
|
56 | ||||
|
57 | opObj11 = readUnitConfObj.addOperation(name='printInfo') | |||
|
58 | #opObj11 = readUnitConfObj.addOperation(name='printNumberOfBlock') | |||
|
59 | ####################################################################### | |||
|
60 | ################ OPERACIONES DOMINIO DEL TIEMPO######################## | |||
|
61 | ####################################################################### | |||
|
62 | ||||
|
63 | procUnitConfObjA = controllerObj.addProcUnit(datatype='VoltageProc', inputId=readUnitConfObj.getId()) | |||
|
64 | ||||
|
65 | #opObj10 = procUnitConfObjA.addOperation(name='selectChannels') | |||
|
66 | #opObj10.addParameter(name='channelList', value=[0]) | |||
|
67 | ||||
|
68 | ''' | |||
|
69 | opObj10 = procUnitConfObjA.addOperation(name='ScopePlot', optype='external') | |||
|
70 | opObj10.addParameter(name='id', value='10', format='int') | |||
|
71 | #opObj10.addParameter(name='xmin', value='0', format='int') | |||
|
72 | ##opObj10.addParameter(name='xmax', value='50', format='int') | |||
|
73 | opObj10.addParameter(name='type', value='iq') | |||
|
74 | ##opObj10.addParameter(name='ymin', value='-5000', format='int') | |||
|
75 | ##opObj10.addParameter(name='ymax', value='8500', format='int') | |||
|
76 | #opObj11.addParameter(name='save', value=figpath, format='str') | |||
|
77 | #opObj11.addParameter(name='save_period', value=10, format='int') | |||
|
78 | ''' | |||
|
79 | ###opObj11 = procUnitConfObjA.addOperation(name='selectHeights') | |||
|
80 | ###opObj11.addParameter(name='minIndex', value='1', format='int') | |||
|
81 | #### opObj11.addParameter(name='maxIndex', value='10000', format='int') | |||
|
82 | ####opObj11.addParameter(name='maxIndex', value='39980', format='int') | |||
|
83 | ||||
|
84 | ####################################################################### | |||
|
85 | ########## OPERACIONES DOMINIO DE LA FRECUENCIA######################## | |||
|
86 | ####################################################################### | |||
|
87 | ||||
|
88 | #procUnitConfObjB = controllerObj.addProcUnit(datatype='SpectraProc', inputId=procUnitConfObjA.getId()) | |||
|
89 | #procUnitConfObjB.addParameter(name='nFFTPoints', value='32', format='int') | |||
|
90 | #procUnitConfObjB.addParameter(name='nProfiles', value='32', format='int') | |||
|
91 | ||||
|
92 | procUnitConfObjC = controllerObj.addProcUnit(datatype='SpectraHeisProc', inputId=procUnitConfObjA.getId()) | |||
|
93 | ||||
|
94 | opObj11 = procUnitConfObjC.addOperation(name='IncohInt4SpectraHeis', optype='other') | |||
|
95 | #opObj11.addParameter(name='timeInterval', value='4', format='int') | |||
|
96 | opObj11.addParameter(name='n', value='100', format='int') | |||
|
97 | ||||
|
98 | #opObj11.addParameter(name='overlapping', value=True, format='bool') | |||
|
99 | ||||
|
100 | opObj11 = procUnitConfObjC.addOperation(name='SpectraHeisPlot') | |||
|
101 | opObj11.addParameter(name='id', value='10', format='int') | |||
|
102 | opObj11.addParameter(name='wintitle', value='Spectra_Alturas', format='str') | |||
|
103 | ||||
|
104 | #opObj11.addParameter(name='xmin', value=-100000, format='float') | |||
|
105 | #opObj11.addParameter(name='xmax', value=100000, format='float') | |||
|
106 | opObj11.addParameter(name='oneFigure', value=False,format='bool') | |||
|
107 | #opObj11.addParameter(name='zmin', value=-10, format='int') | |||
|
108 | #opObj11.addParameter(name='zmax', value=40, format='int') | |||
|
109 | opObj11.addParameter(name='ymin', value=dBmin, format='int') | |||
|
110 | opObj11.addParameter(name='ymax', value=dBmax, format='int') | |||
|
111 | opObj11.addParameter(name='grid', value=True, format='bool') | |||
|
112 | #opObj11.addParameter(name='showprofile', value='1', format='int') | |||
|
113 | opObj11.addParameter(name='save', value=figpath, format='str') | |||
|
114 | #opObj11.addParameter(name='save_period', value=10, format='int') | |||
|
115 | ||||
|
116 | ||||
|
117 | ||||
|
118 | controllerObj.start() |
@@ -0,0 +1,103 | |||||
|
1 | #!python | |||
|
2 | ''' | |||
|
3 | ''' | |||
|
4 | ||||
|
5 | import os, sys | |||
|
6 | import datetime | |||
|
7 | import time | |||
|
8 | ||||
|
9 | ||||
|
10 | from schainpy.controller import Project | |||
|
11 | ||||
|
12 | desc = "USRP_test" | |||
|
13 | filename = "USRP_processing.xml" | |||
|
14 | controllerObj = Project() | |||
|
15 | controllerObj.setup(id = '191', name='Test_USRP', description=desc) | |||
|
16 | ||||
|
17 | ############## USED TO PLOT IQ VOLTAGE, POWER AND SPECTRA ############# | |||
|
18 | ||||
|
19 | ####################################################################### | |||
|
20 | ######PATH DE LECTURA, ESCRITURA, GRAFICOS Y ENVIO WEB################# | |||
|
21 | ####################################################################### | |||
|
22 | # path JHON | |||
|
23 | path = '/home/soporte/jars2' | |||
|
24 | ||||
|
25 | figpath = '/home/soporte/Pictures/JHON' | |||
|
26 | #remotefolder = "/home/wmaster/graficos" | |||
|
27 | ####################################################################### | |||
|
28 | ################# RANGO DE PLOTEO###################################### | |||
|
29 | ####################################################################### | |||
|
30 | dBmin = '0' | |||
|
31 | dBmax = '50' | |||
|
32 | xmin = '0' | |||
|
33 | xmax ='24' | |||
|
34 | ymin = '0' | |||
|
35 | ymax = '600' | |||
|
36 | ####################################################################### | |||
|
37 | ########################FECHA########################################## | |||
|
38 | ####################################################################### | |||
|
39 | str = datetime.date.today() | |||
|
40 | today = str.strftime("%Y/%m/%d") | |||
|
41 | str2 = str - datetime.timedelta(days=1) | |||
|
42 | yesterday = str2.strftime("%Y/%m/%d") | |||
|
43 | ####################################################################### | |||
|
44 | ######################## UNIDAD DE LECTURA############################# | |||
|
45 | ####################################################################### | |||
|
46 | readUnitConfObj = controllerObj.addReadUnit(datatype='VoltageReader', | |||
|
47 | path=path, | |||
|
48 | startDate="2021/07/02",#today, | |||
|
49 | endDate="2021/07/02",#today, | |||
|
50 | startTime='19:45:00',# inicio libre | |||
|
51 | endTime='19:50:59', | |||
|
52 | delay=0, | |||
|
53 | #set=0, | |||
|
54 | online=0, | |||
|
55 | walk=0) | |||
|
56 | ||||
|
57 | opObj11 = readUnitConfObj.addOperation(name='printInfo') | |||
|
58 | #opObj11 = readUnitConfObj.addOperation(name='printNumberOfBlock') | |||
|
59 | ####################################################################### | |||
|
60 | ################ OPERACIONES DOMINIO DEL TIEMPO######################## | |||
|
61 | ####################################################################### | |||
|
62 | ||||
|
63 | procUnitConfObjA = controllerObj.addProcUnit(datatype='VoltageProc', inputId=readUnitConfObj.getId()) | |||
|
64 | ||||
|
65 | opObj11 = procUnitConfObjA.addOperation(name='selectHeights') | |||
|
66 | opObj11.addParameter(name='minIndex', value='1', format='int') | |||
|
67 | # opObj11.addParameter(name='maxIndex', value='10000', format='int') | |||
|
68 | opObj11.addParameter(name='maxIndex', value='39980', format='int') | |||
|
69 | ||||
|
70 | ||||
|
71 | ####################################################################### | |||
|
72 | ########## OPERACIONES DOMINIO DE LA FRECUENCIA######################## | |||
|
73 | ####################################################################### | |||
|
74 | ||||
|
75 | #procUnitConfObjB = controllerObj.addProcUnit(datatype='SpectraProc', inputId=procUnitConfObjA.getId()) | |||
|
76 | #procUnitConfObjB.addParameter(name='nFFTPoints', value='32', format='int') | |||
|
77 | #procUnitConfObjB.addParameter(name='nProfiles', value='32', format='int') | |||
|
78 | ||||
|
79 | procUnitConfObjC = controllerObj.addProcUnit(datatype='SpectraHeisProc', inputId=procUnitConfObjA.getId()) | |||
|
80 | ||||
|
81 | #opObj11 = procUnitConfObjC.addOperation(name='IncohInt4SpectraHeis', optype='other') | |||
|
82 | #opObj11.addParameter(name='timeInterval', value='4', format='int') | |||
|
83 | opObj11 = procUnitConfObjC.addOperation(name='IncohInt4SpectraHeis', optype='other') | |||
|
84 | #opObj11.addParameter(name='timeInterval', value='4', format='int') | |||
|
85 | opObj11.addParameter(name='n', value='100', format='int') | |||
|
86 | ||||
|
87 | ||||
|
88 | opObj11 = procUnitConfObjC.addOperation(name='SpectraHeisPlot') | |||
|
89 | opObj11.addParameter(name='id', value='10', format='int') | |||
|
90 | opObj11.addParameter(name='wintitle', value='Spectra_Alturas', format='str') | |||
|
91 | #opObj11.addParameter(name='xmin', value=-100000, format='float') | |||
|
92 | #opObj11.addParameter(name='xmax', value=100000, format='float') | |||
|
93 | opObj11.addParameter(name='oneFigure', value=False,format='bool') | |||
|
94 | #opObj11.addParameter(name='zmin', value=-10, format='int') | |||
|
95 | #opObj11.addParameter(name='zmax', value=40, format='int') | |||
|
96 | opObj11.addParameter(name='ymin', value=dBmin, format='int') | |||
|
97 | opObj11.addParameter(name='ymax', value=dBmax, format='int') | |||
|
98 | opObj11.addParameter(name='grid', value=True, format='bool') | |||
|
99 | #opObj11.addParameter(name='showprofile', value='1', format='int') | |||
|
100 | opObj11.addParameter(name='save', value=figpath, format='str') | |||
|
101 | #opObj11.addParameter(name='save_period', value=10, format='int') | |||
|
102 | ||||
|
103 | controllerObj.start() |
@@ -0,0 +1,47 | |||||
|
1 | import os,sys | |||
|
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 VoltageProc | |||
|
10 | - Unidad de procesamiento SpectraProc | |||
|
11 | - Operacion removeDC. | |||
|
12 | - Unidad de procesamiento ParametersProc | |||
|
13 | - Operacion SpectralMoments | |||
|
14 | - Operacion SpectralMomentsPlot | |||
|
15 | - Unidad de escrituda 'HDFWriter'. | |||
|
16 | ''' | |||
|
17 | path='/home/developer/Downloads/HDF5_WR' | |||
|
18 | figpath = path | |||
|
19 | desc = "Simulator Test" | |||
|
20 | ||||
|
21 | controllerObj = Project() | |||
|
22 | ||||
|
23 | controllerObj.setup(id='10',name='Test Simulator',description=desc) | |||
|
24 | ||||
|
25 | readUnitConfObj = controllerObj.addReadUnit(datatype='HDFReader', | |||
|
26 | path=path, | |||
|
27 | startDate="2021/01/01", #"2020/01/01",#today, | |||
|
28 | endDate= "2021/12/01", #"2020/12/30",#today, | |||
|
29 | startTime='00:00:00', | |||
|
30 | endTime='23:59:59', | |||
|
31 | delay=0, | |||
|
32 | #set=0, | |||
|
33 | online=0, | |||
|
34 | walk=0)#1 | |||
|
35 | ||||
|
36 | procUnitConfObjA = controllerObj.addProcUnit(datatype='ParametersProc',inputId=readUnitConfObj.getId()) | |||
|
37 | ||||
|
38 | opObj11 = procUnitConfObjA.addOperation(name='Block360') | |||
|
39 | opObj11.addParameter(name='n', value='40', format='int') | |||
|
40 | ||||
|
41 | opObj11= procUnitConfObjA.addOperation(name='WeatherPlot',optype='other') | |||
|
42 | opObj11.addParameter(name='save', value=figpath) | |||
|
43 | opObj11.addParameter(name='save_period', value=1) | |||
|
44 | #opObj11 = procUnitConfObjA.addOperation(name='PowerPlot', optype='other')#PulsepairPowerPlot | |||
|
45 | #opObj11 = procUnitConfObjA.addOperation(name='PPSignalPlot', optype='other') | |||
|
46 | ||||
|
47 | controllerObj.start() |
@@ -0,0 +1,51 | |||||
|
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 | path = '/home/soporte/Downloads/RAWDATA_PP' | |||
|
14 | path='/DATA_RM/TEST_HDF5/d2021203' | |||
|
15 | figpath = '/home/soporte/Downloads/IMAGE' | |||
|
16 | desc = "Simulator Test" | |||
|
17 | desc_data = { | |||
|
18 | 'Data': { | |||
|
19 | 'dataPP_POW': 'Data/dataPP_POW/channel00', | |||
|
20 | 'utctime':'Data/utctime' | |||
|
21 | }, | |||
|
22 | 'Metadata': { | |||
|
23 | 'heightList' :'Metadata/heightList', | |||
|
24 | 'flagDataAsBlock':'Metadata/flagDataAsBlock', | |||
|
25 | 'profileIndex':'Metadata/profileIndex' | |||
|
26 | } | |||
|
27 | } | |||
|
28 | ||||
|
29 | controllerObj = Project() | |||
|
30 | ||||
|
31 | controllerObj.setup(id='10',name='Test Simulator',description=desc) | |||
|
32 | ||||
|
33 | readUnitConfObj = controllerObj.addReadUnit(datatype='HDFReader', | |||
|
34 | path=path, | |||
|
35 | startDate="2021/01/01", #"2020/01/01",#today, | |||
|
36 | endDate= "2021/12/01", #"2020/12/30",#today, | |||
|
37 | startTime='00:00:00', | |||
|
38 | endTime='23:59:59', | |||
|
39 | delay=0, | |||
|
40 | #set=0, | |||
|
41 | online=0, | |||
|
42 | walk=0, | |||
|
43 | description= json.dumps(desc_data))#1 | |||
|
44 | ||||
|
45 | procUnitConfObjA = controllerObj.addProcUnit(datatype='ParametersProc',inputId=readUnitConfObj.getId()) | |||
|
46 | ||||
|
47 | #opObj11 = procUnitConfObjA.addOperation(name='PulsepairPowerPlot', optype='other')#PulsepairPowerPlot | |||
|
48 | opObj11 = procUnitConfObjA.addOperation(name='PulsepairSignalPlot', optype='other') | |||
|
49 | ||||
|
50 | ||||
|
51 | controllerObj.start() |
@@ -0,0 +1,56 | |||||
|
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 | path = '/home/soporte/Downloads/RAWDATA' | |||
|
14 | figpath = '/home/soporte/Downloads/IMAGE' | |||
|
15 | desc = "Simulator Test" | |||
|
16 | desc_data = { | |||
|
17 | 'Data': { | |||
|
18 | 'data_pow': 'Data/data_pow/channel00', | |||
|
19 | 'data_dop': 'Data/data_dop/channel00', | |||
|
20 | 'utctime':'Data/utctime' | |||
|
21 | }, | |||
|
22 | 'Metadata': { | |||
|
23 | 'heightList':'Metadata/heightList', | |||
|
24 | 'nIncohInt' :'Metadata/nIncohInt', | |||
|
25 | 'nCohInt' :'Metadata/nCohInt', | |||
|
26 | 'nProfiles' :'Metadata/nProfiles', | |||
|
27 | 'channelList' :'Metadata/channelList' | |||
|
28 | } | |||
|
29 | } | |||
|
30 | ||||
|
31 | controllerObj = Project() | |||
|
32 | ||||
|
33 | controllerObj.setup(id='10',name='Test Simulator',description=desc) | |||
|
34 | ||||
|
35 | readUnitConfObj = controllerObj.addReadUnit(datatype='HDFReader', | |||
|
36 | path=path, | |||
|
37 | startDate="2021/01/01", #"2020/01/01",#today, | |||
|
38 | endDate= "2021/12/01", #"2020/12/30",#today, | |||
|
39 | startTime='00:00:00', | |||
|
40 | endTime='23:59:59', | |||
|
41 | delay=0, | |||
|
42 | #set=0, | |||
|
43 | online=0, | |||
|
44 | walk=1, | |||
|
45 | description= json.dumps(desc_data))#1 | |||
|
46 | ||||
|
47 | procUnitConfObjA = controllerObj.addProcUnit(datatype='ParametersProc',inputId=readUnitConfObj.getId()) | |||
|
48 | ''' | |||
|
49 | opObj11 = procUnitConfObjA.addOperation(name='DopplerPlot',optype='external') | |||
|
50 | #opObj11.addParameter(name='xmin', value=0) | |||
|
51 | #opObj11.addParameter(name='xmax', value=23) | |||
|
52 | opObj11.addParameter(name='save', value=figpath) | |||
|
53 | opObj11.addParameter(name='showprofile', value=0) | |||
|
54 | opObj11.addParameter(name='save_period', value=10) | |||
|
55 | ''' | |||
|
56 | controllerObj.start() |
@@ -0,0 +1,55 | |||||
|
1 | import os,sys | |||
|
2 | import datetime | |||
|
3 | import time | |||
|
4 | from schainpy.controller import Project | |||
|
5 | ||||
|
6 | #************************************************************************* | |||
|
7 | #**************************LECTURA config_WR.txt************************** | |||
|
8 | #************************************************************************* | |||
|
9 | from readFileconfig import ReadfileWR | |||
|
10 | filename= "/home/soporte/schainv3/schain/schainpy/scripts/config_WR.txt" | |||
|
11 | dict= ReadfileWR(filename).getDict() | |||
|
12 | ||||
|
13 | FixRCP_IPP = dict['ipp']*0.15 #equivalencia | |||
|
14 | dataBlocksPerFile= dict['b_f_adq'] | |||
|
15 | profilesPerBlock= int(dict['n']) | |||
|
16 | pulsepair = int(dict['n']) | |||
|
17 | #************************************************************************* | |||
|
18 | path = '/home/soporte/Downloads/RAWDATA_PP_C' | |||
|
19 | figpath = path | |||
|
20 | desc = "Simulator Test" | |||
|
21 | controllerObj = Project() | |||
|
22 | controllerObj.setup(id='10',name='Test Simulator',description=desc) | |||
|
23 | readUnitConfObj = controllerObj.addReadUnit(datatype='SimulatorReader', | |||
|
24 | frequency=9.345e9, | |||
|
25 | FixRCP_IPP= FixRCP_IPP, | |||
|
26 | Tau_0 = 30, | |||
|
27 | AcqH0_0=0, | |||
|
28 | samples=330, | |||
|
29 | AcqDH_0=0.15, | |||
|
30 | FixRCP_TXA=0.15, | |||
|
31 | FixRCP_TXB=0.15, | |||
|
32 | Fdoppler=600.0, | |||
|
33 | Hdoppler=36, | |||
|
34 | Adoppler=300,#300 | |||
|
35 | delay=0, | |||
|
36 | online=0, | |||
|
37 | walk=0, | |||
|
38 | profilesPerBlock=profilesPerBlock, | |||
|
39 | dataBlocksPerFile=dataBlocksPerFile)#,#nTotalReadFiles=2) | |||
|
40 | #opObj11 = readUnitConfObj.addOperation(name='printInfo') | |||
|
41 | procUnitConfObjA = controllerObj.addProcUnit(datatype='VoltageProc', inputId=readUnitConfObj.getId()) | |||
|
42 | ||||
|
43 | opObj11 = procUnitConfObjA.addOperation(name='PulsePair') | |||
|
44 | opObj11.addParameter(name='n', value=pulsepair, format='int')#10 | |||
|
45 | ||||
|
46 | procUnitConfObjB= controllerObj.addProcUnit(datatype='ParametersProc',inputId=procUnitConfObjA.getId()) | |||
|
47 | ||||
|
48 | opObj10 = procUnitConfObjB.addOperation(name='HDFWriter') | |||
|
49 | opObj10.addParameter(name='path',value=figpath) | |||
|
50 | #opObj10.addParameter(name='mode',value=2) | |||
|
51 | opObj10.addParameter(name='blocksPerFile',value='100',format='int') | |||
|
52 | opObj10.addParameter(name='metadataList',value='utctimeInit,paramInterval,heightList,profileIndex,flagDataAsBlock',format='list') | |||
|
53 | opObj10.addParameter(name='dataList',value='dataPP_POW,dataPP_DOP,utctime',format='list')#,format='list' | |||
|
54 | ||||
|
55 | controllerObj.start() |
@@ -0,0 +1,50 | |||||
|
1 | import os,sys | |||
|
2 | import datetime | |||
|
3 | import time | |||
|
4 | from schainpy.controller import Project | |||
|
5 | path = '/home/soporte/Downloads/RAWDATA_PP_Z' | |||
|
6 | figpath = path | |||
|
7 | desc = "Simulator Test" | |||
|
8 | ||||
|
9 | controllerObj = Project() | |||
|
10 | ||||
|
11 | controllerObj.setup(id='10',name='Test Simulator',description=desc) | |||
|
12 | ||||
|
13 | readUnitConfObj = controllerObj.addReadUnit(datatype='SimulatorReader', | |||
|
14 | frequency=9.345e9, | |||
|
15 | FixRCP_IPP= 60, | |||
|
16 | Tau_0 = 30, | |||
|
17 | AcqH0_0=0, | |||
|
18 | samples=330, | |||
|
19 | AcqDH_0=0.15, | |||
|
20 | FixRCP_TXA=0.15, | |||
|
21 | FixRCP_TXB=0.15, | |||
|
22 | Fdoppler=600.0, | |||
|
23 | Hdoppler=36, | |||
|
24 | Adoppler=300,#300 | |||
|
25 | delay=0, | |||
|
26 | online=0, | |||
|
27 | walk=0, | |||
|
28 | profilesPerBlock=625, | |||
|
29 | dataBlocksPerFile=360)#,#nTotalReadFiles=2) | |||
|
30 | ||||
|
31 | ### opObj11 = readUnitConfObj.addOperation(name='printInfo') | |||
|
32 | ||||
|
33 | procUnitConfObjA = controllerObj.addProcUnit(datatype='VoltageProc', inputId=readUnitConfObj.getId()) | |||
|
34 | ||||
|
35 | opObj11 = procUnitConfObjA.addOperation(name='PulsePair', optype='other') | |||
|
36 | opObj11.addParameter(name='n', value='625', format='int')#10 | |||
|
37 | opObj11.addParameter(name='removeDC', value=1, format='int') | |||
|
38 | ||||
|
39 | procUnitConfObjB= controllerObj.addProcUnit(datatype='ParametersProc',inputId=procUnitConfObjA.getId()) | |||
|
40 | ||||
|
41 | opObj10 = procUnitConfObjB.addOperation(name="WeatherRadar") | |||
|
42 | ||||
|
43 | opObj10 = procUnitConfObjB.addOperation(name='HDFWriter') | |||
|
44 | opObj10.addParameter(name='path',value=figpath) | |||
|
45 | #opObj10.addParameter(name='mode',value=0) | |||
|
46 | opObj10.addParameter(name='blocksPerFile',value='100',format='int') | |||
|
47 | opObj10.addParameter(name='metadataList',value='utctimeInit,timeInterval',format='list') | |||
|
48 | opObj10.addParameter(name='dataList',value='dataPP_POW,dataPP_DOP,dataPP_SNR,dataPP_WIDTH,factor_Zeh,utctime')#,format='list' | |||
|
49 | ||||
|
50 | controllerObj.start() |
1 | NO CONTENT: modified file |
|
NO CONTENT: modified file |
@@ -497,15 +497,15 class Plot(Operation): | |||||
497 | def save_figure(self, n): |
|
497 | def save_figure(self, n): | |
498 | ''' |
|
498 | ''' | |
499 | ''' |
|
499 | ''' | |
500 |
|
500 | if self.oneFigure: | ||
501 | if (self.data.max_time - self.save_time) <= self.save_period: |
|
501 | if (self.data.max_time - self.save_time) <= self.save_period: | |
502 | return |
|
502 | return | |
503 |
|
503 | |||
504 | self.save_time = self.data.max_time |
|
504 | self.save_time = self.data.max_time | |
505 |
|
505 | |||
506 | fig = self.figures[n] |
|
506 | fig = self.figures[n] | |
507 |
|
||||
508 | if self.throttle == 0: |
|
507 | if self.throttle == 0: | |
|
508 | if self.oneFigure: | |||
509 | figname = os.path.join( |
|
509 | figname = os.path.join( | |
510 | self.save, |
|
510 | self.save, | |
511 | self.save_code, |
|
511 | self.save_code, | |
@@ -516,6 +516,17 class Plot(Operation): | |||||
516 | ), |
|
516 | ), | |
517 | ) |
|
517 | ) | |
518 | ) |
|
518 | ) | |
|
519 | else: | |||
|
520 | figname = os.path.join( | |||
|
521 | self.save, | |||
|
522 | self.save_code, | |||
|
523 | '{}_ch{}_{}.png'.format( | |||
|
524 | self.save_code,n, | |||
|
525 | self.getDateTime(self.data.max_time).strftime( | |||
|
526 | '%Y%m%d_%H%M%S' | |||
|
527 | ), | |||
|
528 | ) | |||
|
529 | ) | |||
519 | log.log('Saving figure: {}'.format(figname), self.name) |
|
530 | log.log('Saving figure: {}'.format(figname), self.name) | |
520 | if not os.path.isdir(os.path.dirname(figname)): |
|
531 | if not os.path.isdir(os.path.dirname(figname)): | |
521 | os.makedirs(os.path.dirname(figname)) |
|
532 | os.makedirs(os.path.dirname(figname)) | |
@@ -530,6 +541,7 class Plot(Operation): | |||||
530 | ), |
|
541 | ), | |
531 | ) |
|
542 | ) | |
532 | ) |
|
543 | ) | |
|
544 | ||||
533 | log.log('Saving figure: {}'.format(figname), self.name) |
|
545 | log.log('Saving figure: {}'.format(figname), self.name) | |
534 | if not os.path.isdir(os.path.dirname(figname)): |
|
546 | if not os.path.isdir(os.path.dirname(figname)): | |
535 | os.makedirs(os.path.dirname(figname)) |
|
547 | os.makedirs(os.path.dirname(figname)) | |
@@ -690,4 +702,3 class Plot(Operation): | |||||
690 | self.__plot() |
|
702 | self.__plot() | |
691 | if self.data and not self.data.flagNoData and self.pause: |
|
703 | if self.data and not self.data.flagNoData and self.pause: | |
692 | figpause(10) |
|
704 | figpause(10) | |
693 |
|
@@ -41,6 +41,8 class SpectraHeisPlot(Plot): | |||||
41 | c = 3E8 |
|
41 | c = 3E8 | |
42 | deltaHeight = self.data.yrange[1] - self.data.yrange[0] |
|
42 | deltaHeight = self.data.yrange[1] - self.data.yrange[0] | |
43 | x = numpy.arange(-1*len(self.data.yrange)/2., len(self.data.yrange)/2.)*(c/(2*deltaHeight*len(self.data.yrange)*1000)) |
|
43 | x = numpy.arange(-1*len(self.data.yrange)/2., len(self.data.yrange)/2.)*(c/(2*deltaHeight*len(self.data.yrange)*1000)) | |
|
44 | #x = (1/1000.0)*numpy.arange(-1*len(self.data.yrange)/2., len(self.data.yrange)/2.)*(c/(2*deltaHeight*len(self.data.yrange)*1000)) | |||
|
45 | ||||
44 | self.y = self.data[-1]['spc_heis'] |
|
46 | self.y = self.data[-1]['spc_heis'] | |
45 | self.titles = [] |
|
47 | self.titles = [] | |
46 |
|
48 |
@@ -5,6 +5,8 import numpy | |||||
5 | from schainpy.model.graphics.jroplot_base import Plot, plt |
|
5 | from schainpy.model.graphics.jroplot_base import Plot, plt | |
6 | from schainpy.model.graphics.jroplot_spectra import SpectraPlot, RTIPlot, CoherencePlot, SpectraCutPlot |
|
6 | from schainpy.model.graphics.jroplot_spectra import SpectraPlot, RTIPlot, CoherencePlot, SpectraCutPlot | |
7 | from schainpy.utils import log |
|
7 | from schainpy.utils import log | |
|
8 | # libreria wradlib | |||
|
9 | import wradlib as wrl | |||
8 |
|
10 | |||
9 | EARTH_RADIUS = 6.3710e3 |
|
11 | EARTH_RADIUS = 6.3710e3 | |
10 |
|
12 | |||
@@ -368,3 +370,216 class PolarMapPlot(Plot): | |||||
368 | self.titles = ['{} {}'.format( |
|
370 | self.titles = ['{} {}'.format( | |
369 | self.data.parameters[x], title) for x in self.channels] |
|
371 | self.data.parameters[x], title) for x in self.channels] | |
370 |
|
372 | |||
|
373 | class WeatherPlot(Plot): | |||
|
374 | CODE = 'weather' | |||
|
375 | plot_name = 'weather' | |||
|
376 | plot_type = 'ppistyle' | |||
|
377 | buffering = False | |||
|
378 | ||||
|
379 | def setup(self): | |||
|
380 | self.ncols = 1 | |||
|
381 | self.nrows = 1 | |||
|
382 | self.nplots= 1 | |||
|
383 | self.ylabel= 'Range [Km]' | |||
|
384 | self.titles= ['Weather'] | |||
|
385 | self.colorbar=False | |||
|
386 | self.width =8 | |||
|
387 | self.height =8 | |||
|
388 | self.ini =0 | |||
|
389 | self.len_azi =0 | |||
|
390 | self.buffer_ini = None | |||
|
391 | self.buffer_azi = None | |||
|
392 | self.plots_adjust.update({'wspace': 0.4, 'hspace':0.4, 'left': 0.1, 'right': 0.9, 'bottom': 0.08}) | |||
|
393 | self.flag =0 | |||
|
394 | self.indicador= 0 | |||
|
395 | ||||
|
396 | def update(self, dataOut): | |||
|
397 | ||||
|
398 | data = {} | |||
|
399 | meta = {} | |||
|
400 | data['weather'] = 10*numpy.log10(dataOut.data_360[0]/(650**2)) | |||
|
401 | data['azi'] = dataOut.data_azi | |||
|
402 | ||||
|
403 | return data, meta | |||
|
404 | ||||
|
405 | def plot(self): | |||
|
406 | thisDatetime = datetime.datetime.utcfromtimestamp(self.data.times[-1]) | |||
|
407 | ||||
|
408 | data = self.data[-1] | |||
|
409 | tmp_h = (data['weather'].shape[1])/10.0 | |||
|
410 | stoprange = float(tmp_h*1.5)#stoprange = float(33*1.5) por ahora 400 | |||
|
411 | rangestep = float(0.15) | |||
|
412 | r = numpy.arange(0, stoprange, rangestep) | |||
|
413 | self.y = 2*r | |||
|
414 | ||||
|
415 | tmp_v = data['weather'] | |||
|
416 | print("tmp_v",tmp_v.shape) | |||
|
417 | tmp_z = data['azi'] | |||
|
418 | #print("tmp_z",tmp_z.shape) | |||
|
419 | res = 1 | |||
|
420 | step = (360/(res*tmp_v.shape[0])) | |||
|
421 | print("step",step) | |||
|
422 | mode = 1 | |||
|
423 | if mode==0: | |||
|
424 | #print("self.ini",self.ini) | |||
|
425 | val = numpy.mean(tmp_v[:,0]) | |||
|
426 | self.len_azi = len(tmp_z) | |||
|
427 | ones = numpy.ones([(360-tmp_v.shape[0]),tmp_v.shape[1]])*val | |||
|
428 | self.buffer_ini = numpy.vstack((tmp_v,ones)) | |||
|
429 | ||||
|
430 | n = ((360/res)-len(tmp_z)) | |||
|
431 | start = tmp_z[-1]+res | |||
|
432 | end = tmp_z[0]-res | |||
|
433 | if start>end: | |||
|
434 | end = end+360 | |||
|
435 | azi_zeros = numpy.linspace(start,end,int(n)) | |||
|
436 | azi_zeros = numpy.where(azi_zeros>360,azi_zeros-360,azi_zeros) | |||
|
437 | self.buffer_ini_azi = numpy.hstack((tmp_z,azi_zeros)) | |||
|
438 | self.ini = self.ini+1 | |||
|
439 | ||||
|
440 | if mode==1: | |||
|
441 | #print("self.ini",self.ini) | |||
|
442 | if self.ini==0: | |||
|
443 | res = 1 | |||
|
444 | step = (360/(res*tmp_v.shape[0])) | |||
|
445 | val = numpy.mean(tmp_v[:,0]) | |||
|
446 | self.len_azi = len(tmp_z) | |||
|
447 | self.buf_tmp = tmp_v | |||
|
448 | ones = numpy.ones([(360-tmp_v.shape[0]),tmp_v.shape[1]])*val | |||
|
449 | self.buffer_ini = numpy.vstack((tmp_v,ones)) | |||
|
450 | ||||
|
451 | n = ((360/res)-len(tmp_z)) | |||
|
452 | start = tmp_z[-1]+res | |||
|
453 | end = tmp_z[0]-res | |||
|
454 | if start>end: | |||
|
455 | end =end+360 | |||
|
456 | azi_zeros = numpy.linspace(start,end,int(n)) | |||
|
457 | azi_zeros = numpy.where(azi_zeros>360,azi_zeros-360,azi_zeros) | |||
|
458 | self.buf_azi = tmp_z | |||
|
459 | self.buffer_ini_azi = numpy.hstack((tmp_z,azi_zeros)) | |||
|
460 | self.ini = self.ini+1 | |||
|
461 | elif 0<self.ini<step: | |||
|
462 | ''' | |||
|
463 | if self.ini>31: | |||
|
464 | start= tmp_z[0] | |||
|
465 | end =tmp_z[-1] | |||
|
466 | print("start","end",start,end) | |||
|
467 | if self.ini==32: | |||
|
468 | tmp_v=tmp_v+20 | |||
|
469 | if self.ini==33: | |||
|
470 | tmp_v=tmp_v+10 | |||
|
471 | if self.ini==34: | |||
|
472 | tmp_v=tmp_v+20 | |||
|
473 | if self.ini==35: | |||
|
474 | tmp_v=tmp_v+20 | |||
|
475 | ''' | |||
|
476 | self.buf_tmp= numpy.vstack((self.buf_tmp,tmp_v)) | |||
|
477 | print("ERROR_INMINENTE",self.buf_tmp.shape) | |||
|
478 | if self.buf_tmp.shape[0]==360: | |||
|
479 | self.buffer_ini=self.buf_tmp | |||
|
480 | else: | |||
|
481 | val=30.0 | |||
|
482 | ones = numpy.ones([(360-self.buf_tmp.shape[0]),self.buf_tmp.shape[1]])*val | |||
|
483 | self.buffer_ini = numpy.vstack((self.buf_tmp,ones)) | |||
|
484 | ||||
|
485 | self.buf_azi = numpy.hstack((self.buf_azi,tmp_z)) | |||
|
486 | n = ((360/res)-len(self.buf_azi)) | |||
|
487 | if n==0: | |||
|
488 | self.buffer_ini_azi = self.buf_azi | |||
|
489 | else: | |||
|
490 | start = self.buf_azi[-1]+res | |||
|
491 | end = self.buf_azi[0]-res | |||
|
492 | if start>end: | |||
|
493 | end =end+360 | |||
|
494 | azi_zeros = numpy.linspace(start,end,int(n)) | |||
|
495 | azi_zeros = numpy.where(azi_zeros>360,azi_zeros-360,azi_zeros) | |||
|
496 | if tmp_z[0]<self.buf_azi[0] <tmp_z[-1]: | |||
|
497 | self.indicador=1 | |||
|
498 | if self.indicador==1: | |||
|
499 | azi_zeros = numpy.ones(360-len(self.buf_azi))*(tmp_z[-1]+res) | |||
|
500 | # self.indicador = True | |||
|
501 | #if self.indicador==True: | |||
|
502 | # azi_zeros = numpy.ones(360-len(self.buf_azi))*(tmp_z[-1]+res) | |||
|
503 | ||||
|
504 | #self.buf_azi = tmp_z | |||
|
505 | self.buffer_ini_azi = numpy.hstack((self.buf_azi,azi_zeros)) | |||
|
506 | ||||
|
507 | if self.ini==step-1: | |||
|
508 | start= tmp_z[0] | |||
|
509 | end = tmp_z[-1] | |||
|
510 | #print("start","end",start,end) | |||
|
511 | ###print(self.buffer_ini_azi[:80]) | |||
|
512 | self.ini = self.ini+1 | |||
|
513 | ||||
|
514 | else: | |||
|
515 | step = (360/(res*tmp_v.shape[0])) | |||
|
516 | tmp_v=tmp_v+5+(self.ini-step)*1 | |||
|
517 | ||||
|
518 | start= tmp_z[0] | |||
|
519 | end = tmp_z[-1] | |||
|
520 | #print("start","end",start,end) | |||
|
521 | ###print(self.buffer_ini_azi[:120]) | |||
|
522 | ||||
|
523 | if step>=2: | |||
|
524 | if self.flag<step-1: | |||
|
525 | limit_i=self.buf_azi[len(tmp_z)*(self.flag+1)] | |||
|
526 | limit_s=self.buf_azi[len(tmp_z)*(self.flag+2)-1] | |||
|
527 | print("flag",self.flag,limit_i,limit_s) | |||
|
528 | if limit_i< tmp_z[-1]< limit_s: | |||
|
529 | index_i=int(numpy.where(tmp_z<=self.buf_azi[len(tmp_z)*(self.flag+1)])[0][-1]) | |||
|
530 | tmp_r =int(numpy.where(self.buf_azi[(self.flag+1)*len(tmp_z):(self.flag+2)*len(tmp_z)]>=tmp_z[-1])[0][0]) | |||
|
531 | print("tmp_r",tmp_r) | |||
|
532 | index_f=(self.flag+1)*len(tmp_z)+tmp_r | |||
|
533 | ||||
|
534 | if len(tmp_z[index_i:])>len(self.buf_azi[len(tmp_z)*(self.flag+1):index_f]): | |||
|
535 | final = len(self.buf_azi[len(tmp_z)*(self.flag+1):index_f]) | |||
|
536 | else: | |||
|
537 | final= len(tmp_z[index_i:]) | |||
|
538 | self.buf_azi[len(tmp_z)*(self.flag+1):index_f]=tmp_z[index_i:index_i+final] | |||
|
539 | self.buf_tmp[len(tmp_z)*(self.flag+1):index_f,:]=tmp_v[index_i:index_i+final,:] | |||
|
540 | if limit_i<tmp_z[0]<limit_s: | |||
|
541 | index_f =int(numpy.where(self.buf_azi>=tmp_z[-1])[0][0]) | |||
|
542 | n_p =index_f-len(tmp_z)*(self.flag+1) | |||
|
543 | if n_p>0: | |||
|
544 | self.buf_azi[len(tmp_z)*(self.flag+1):index_f]=tmp_z[-1]*numpy.ones(n_p) | |||
|
545 | self.buf_tmp[len(tmp_z)*(self.flag+1):index_f,:]=tmp_v[-1,:]*numpy.ones([n_p,tmp_v.shape[1]]) | |||
|
546 | ||||
|
547 | ''' | |||
|
548 | if self.buf_azi[len(tmp_z)]<tmp_z[-1]<self.buf_azi[2*len(tmp_z)-1]: | |||
|
549 | index_i= int(numpy.where(tmp_z <= self.buf_azi[len(tmp_z)])[0][-1]) | |||
|
550 | index_f= int(numpy.where(self.buf_azi>=tmp_z[-1])[0][0]) | |||
|
551 | #print("index",index_i,index_f) | |||
|
552 | if len(tmp_z[index_i:])>len(self.buf_azi[len(tmp_z):index_f]): | |||
|
553 | final = len(self.buf_azi[len(tmp_z):index_f]) | |||
|
554 | else: | |||
|
555 | final = len(tmp_z[index_i:]) | |||
|
556 | self.buf_azi[len(tmp_z):index_f]=tmp_z[index_i:index_i+final] | |||
|
557 | self.buf_tmp[len(tmp_z):index_f,:]=tmp_v[index_i:index_i+final,:] | |||
|
558 | ''' | |||
|
559 | self.buf_tmp[len(tmp_z)*(self.flag):len(tmp_z)*(self.flag+1),:]=tmp_v | |||
|
560 | self.buf_azi[len(tmp_z)*(self.flag):len(tmp_z)*(self.flag+1)] = tmp_z | |||
|
561 | self.buffer_ini=self.buf_tmp | |||
|
562 | self.buffer_ini_azi = self.buf_azi | |||
|
563 | ##print("--------salida------------") | |||
|
564 | start= tmp_z[0] | |||
|
565 | end = tmp_z[-1] | |||
|
566 | ##print("start","end",start,end) | |||
|
567 | ##print(self.buffer_ini_azi[:120]) | |||
|
568 | self.ini= self.ini+1 | |||
|
569 | self.flag = self.flag +1 | |||
|
570 | if self.flag==step: | |||
|
571 | self.flag=0 | |||
|
572 | ||||
|
573 | for i,ax in enumerate(self.axes): | |||
|
574 | if ax.firsttime: | |||
|
575 | plt.clf() | |||
|
576 | cgax, pm = wrl.vis.plot_ppi(self.buffer_ini,r=r,az=self.buffer_ini_azi,fig=self.figures[0], proj='cg', vmin=30, vmax=70) | |||
|
577 | else: | |||
|
578 | plt.clf() | |||
|
579 | cgax, pm = wrl.vis.plot_ppi(self.buffer_ini,r=r,az=self.buffer_ini_azi,fig=self.figures[0], proj='cg', vmin=30, vmax=70) | |||
|
580 | caax = cgax.parasites[0] | |||
|
581 | paax = cgax.parasites[1] | |||
|
582 | cbar = plt.gcf().colorbar(pm, pad=0.075) | |||
|
583 | caax.set_xlabel('x_range [km]') | |||
|
584 | caax.set_ylabel('y_range [km]') | |||
|
585 | plt.text(1.0, 1.05, 'azimuth '+str(thisDatetime), transform=caax.transAxes, va='bottom',ha='right') |
@@ -226,6 +226,7 class RTIPlot(Plot): | |||||
226 | def setup(self): |
|
226 | def setup(self): | |
227 | self.xaxis = 'time' |
|
227 | self.xaxis = 'time' | |
228 | self.ncols = 1 |
|
228 | self.ncols = 1 | |
|
229 | print("ch",self.data.channels) | |||
229 | self.nrows = len(self.data.channels) |
|
230 | self.nrows = len(self.data.channels) | |
230 | self.nplots = len(self.data.channels) |
|
231 | self.nplots = len(self.data.channels) | |
231 | self.ylabel = 'Range [km]' |
|
232 | self.ylabel = 'Range [km]' | |
@@ -266,6 +267,7 class RTIPlot(Plot): | |||||
266 | cmap=plt.get_cmap(self.colormap) |
|
267 | cmap=plt.get_cmap(self.colormap) | |
267 | ) |
|
268 | ) | |
268 | if self.showprofile: |
|
269 | if self.showprofile: | |
|
270 | print("test-------------------------------------1") | |||
269 | ax.plot_profile = self.pf_axes[n].plot( |
|
271 | ax.plot_profile = self.pf_axes[n].plot( | |
270 | data['rti'][n], self.y)[0] |
|
272 | data['rti'][n], self.y)[0] | |
271 | ax.plot_noise = self.pf_axes[n].plot(numpy.repeat(data['noise'][n], len(self.y)), self.y, |
|
273 | ax.plot_noise = self.pf_axes[n].plot(numpy.repeat(data['noise'][n], len(self.y)), self.y, |
@@ -709,8 +709,42 class Reader(object): | |||||
709 |
|
709 | |||
710 | def checkForRealPath(self, nextFile, nextDay): |
|
710 | def checkForRealPath(self, nextFile, nextDay): | |
711 | """Check if the next file to be readed exists""" |
|
711 | """Check if the next file to be readed exists""" | |
|
712 | if nextFile: | |||
|
713 | self.set += 1 | |||
|
714 | if nextDay: | |||
|
715 | self.set = 0 | |||
|
716 | self.doy += 1 | |||
|
717 | foldercounter = 0 | |||
|
718 | prefixDirList = [None, 'd', 'D'] | |||
|
719 | if self.ext.lower() == ".r": # voltage | |||
|
720 | prefixFileList = ['d', 'D'] | |||
|
721 | elif self.ext.lower() == ".pdata": # spectra | |||
|
722 | prefixFileList = ['p', 'P'] | |||
|
723 | elif self.ext.lower() == ".hdf5": # HDF5 | |||
|
724 | prefixFileList = ['D', 'P'] # HDF5 | |||
712 |
|
725 | |||
713 | raise NotImplementedError |
|
726 | # barrido por las combinaciones posibles | |
|
727 | for prefixDir in prefixDirList: | |||
|
728 | thispath = self.path | |||
|
729 | if prefixDir != None: | |||
|
730 | # formo el nombre del directorio xYYYYDDD (x=d o x=D) | |||
|
731 | if foldercounter == 0: | |||
|
732 | thispath = os.path.join(self.path, "%s%04d%03d" % | |||
|
733 | (prefixDir, self.year, self.doy)) | |||
|
734 | else: | |||
|
735 | thispath = os.path.join(self.path, "%s%04d%03d_%02d" % ( | |||
|
736 | prefixDir, self.year, self.doy, foldercounter)) | |||
|
737 | for prefixFile in prefixFileList: # barrido por las dos combinaciones posibles de "D" | |||
|
738 | # formo el nombre del file xYYYYDDDSSS.ext | |||
|
739 | filename = "%s%04d%03d%03d%s" % (prefixFile, self.year, self.doy, self.set, self.ext) | |||
|
740 | fullfilename = os.path.join( | |||
|
741 | thispath, filename) | |||
|
742 | ||||
|
743 | if os.path.exists(fullfilename): | |||
|
744 | return fullfilename, filename | |||
|
745 | ||||
|
746 | return None, filename | |||
|
747 | #raise NotImplementedError | |||
714 |
|
748 | |||
715 | def readFirstHeader(self): |
|
749 | def readFirstHeader(self): | |
716 | """Parse the file header""" |
|
750 | """Parse the file header""" |
@@ -113,8 +113,8 class DigitalRFReader(ProcessingUnit): | |||||
113 | numpy.arange(self.__nSamples, dtype=numpy.float) * \ |
|
113 | numpy.arange(self.__nSamples, dtype=numpy.float) * \ | |
114 | self.__deltaHeigth |
|
114 | self.__deltaHeigth | |
115 |
|
115 | |||
116 | self.dataOut.channelList = list(range(self.__num_subchannels)) |
|
116 | #self.dataOut.channelList = list(range(self.__num_subchannels)) | |
117 |
|
117 | self.dataOut.channelList = list(range(len(self.__channelList))) | ||
118 | self.dataOut.blocksize = self.dataOut.nChannels * self.dataOut.nHeights |
|
118 | self.dataOut.blocksize = self.dataOut.nChannels * self.dataOut.nHeights | |
119 |
|
119 | |||
120 | # self.dataOut.channelIndexList = None |
|
120 | # self.dataOut.channelIndexList = None | |
@@ -344,9 +344,12 class DigitalRFReader(ProcessingUnit): | |||||
344 | endUTCSecond = (endDatetime - datetime.datetime(1970, |
|
344 | endUTCSecond = (endDatetime - datetime.datetime(1970, | |
345 | 1, 1)).total_seconds() + self.__timezone |
|
345 | 1, 1)).total_seconds() + self.__timezone | |
346 |
|
346 | |||
|
347 | ||||
|
348 | print(startUTCSecond,endUTCSecond) | |||
347 | start_index, end_index = self.digitalReadObj.get_bounds( |
|
349 | start_index, end_index = self.digitalReadObj.get_bounds( | |
348 | channelNameList[channelList[0]]) |
|
350 | channelNameList[channelList[0]]) | |
349 |
|
351 | |||
|
352 | print("*****",start_index,end_index) | |||
350 | if not startUTCSecond: |
|
353 | if not startUTCSecond: | |
351 | startUTCSecond = start_index / self.__sample_rate |
|
354 | startUTCSecond = start_index / self.__sample_rate | |
352 |
|
355 | |||
@@ -403,8 +406,10 class DigitalRFReader(ProcessingUnit): | |||||
403 | # por que en el otro metodo lo primero q se hace es sumar samplestoread |
|
406 | # por que en el otro metodo lo primero q se hace es sumar samplestoread | |
404 | self.__thisUnixSample = int(startUTCSecond * self.__sample_rate) - self.__samples_to_read |
|
407 | self.__thisUnixSample = int(startUTCSecond * self.__sample_rate) - self.__samples_to_read | |
405 |
|
408 | |||
406 | self.__data_buffer = numpy.zeros( |
|
409 | #self.__data_buffer = numpy.zeros( | |
407 | (self.__num_subchannels, self.__samples_to_read), dtype=numpy.complex) |
|
410 | # (self.__num_subchannels, self.__samples_to_read), dtype=numpy.complex) | |
|
411 | self.__data_buffer = numpy.zeros((int(len(channelList)), self.__samples_to_read), dtype=numpy.complex) | |||
|
412 | ||||
408 |
|
413 | |||
409 | self.__setFileHeader() |
|
414 | self.__setFileHeader() | |
410 | self.isConfig = True |
|
415 | self.isConfig = True | |
@@ -520,7 +525,7 class DigitalRFReader(ProcessingUnit): | |||||
520 | self.__samples_to_read)) |
|
525 | self.__samples_to_read)) | |
521 | break |
|
526 | break | |
522 |
|
527 | |||
523 |
self.__data_buffer[index |
|
528 | self.__data_buffer[indexChannel, :] = result * volt_scale | |
524 | indexChannel+=1 |
|
529 | indexChannel+=1 | |
525 |
|
530 | |||
526 | dataOk = True |
|
531 | dataOk = True | |
@@ -587,7 +592,7 class DigitalRFReader(ProcessingUnit): | |||||
587 | return |
|
592 | return | |
588 |
|
593 | |||
589 | print('[Reading] waiting %d seconds to read a new block' % seconds) |
|
594 | print('[Reading] waiting %d seconds to read a new block' % seconds) | |
590 |
|
|
595 | sleep(seconds) | |
591 |
|
596 | |||
592 | self.dataOut.data = self.__data_buffer[:, self.__bufferIndex:self.__bufferIndex + self.__nSamples] |
|
597 | self.dataOut.data = self.__data_buffer[:, self.__bufferIndex:self.__bufferIndex + self.__nSamples] | |
593 | self.dataOut.utctime = ( self.__thisUnixSample + self.__bufferIndex) / self.__sample_rate |
|
598 | self.dataOut.utctime = ( self.__thisUnixSample + self.__bufferIndex) / self.__sample_rate |
@@ -302,6 +302,9 class IncohInt4SpectraHeis(Operation): | |||||
302 | if self.__initime == None: |
|
302 | if self.__initime == None: | |
303 | self.__initime = datatime |
|
303 | self.__initime = datatime | |
304 |
|
304 | |||
|
305 | #if self.__profIndex == 0: | |||
|
306 | # self.__initime = datatime | |||
|
307 | ||||
305 | if self.__byTime: |
|
308 | if self.__byTime: | |
306 | avgdata = self.byTime(data, datatime) |
|
309 | avgdata = self.byTime(data, datatime) | |
307 | else: |
|
310 | else: | |
@@ -330,6 +333,7 class IncohInt4SpectraHeis(Operation): | |||||
330 | self.setup(n=n, timeInterval=timeInterval, overlapping=overlapping) |
|
333 | self.setup(n=n, timeInterval=timeInterval, overlapping=overlapping) | |
331 | self.isConfig = True |
|
334 | self.isConfig = True | |
332 |
|
335 | |||
|
336 | #print("utc_time",dataOut.utctime) | |||
333 | avgdata, avgdatatime = self.integrate(dataOut.data_spc, dataOut.utctime) |
|
337 | avgdata, avgdatatime = self.integrate(dataOut.data_spc, dataOut.utctime) | |
334 |
|
338 | |||
335 | # dataOut.timeInterval *= n |
|
339 | # dataOut.timeInterval *= n |
This diff has been collapsed as it changes many lines, (582 lines changed) Show them Hide them | |||||
@@ -1,4 +1,4 | |||||
1 | import numpy |
|
1 | import numpy,os,h5py | |
2 | import math |
|
2 | import math | |
3 | from scipy import optimize, interpolate, signal, stats, ndimage |
|
3 | from scipy import optimize, interpolate, signal, stats, ndimage | |
4 | import scipy |
|
4 | import scipy | |
@@ -45,6 +45,12 def _unpickle_method(func_name, obj, cls): | |||||
45 | break |
|
45 | break | |
46 | return func.__get__(obj, cls) |
|
46 | return func.__get__(obj, cls) | |
47 |
|
47 | |||
|
48 | def isNumber(str): | |||
|
49 | try: | |||
|
50 | float(str) | |||
|
51 | return True | |||
|
52 | except: | |||
|
53 | return False | |||
48 |
|
54 | |||
49 | class ParametersProc(ProcessingUnit): |
|
55 | class ParametersProc(ProcessingUnit): | |
50 |
|
56 | |||
@@ -108,6 +114,13 class ParametersProc(ProcessingUnit): | |||||
108 | self.dataOut.flagNoData = False |
|
114 | self.dataOut.flagNoData = False | |
109 | self.dataOut.utctimeInit = self.dataIn.utctime |
|
115 | self.dataOut.utctimeInit = self.dataIn.utctime | |
110 | self.dataOut.paramInterval = self.dataIn.nProfiles*self.dataIn.nCohInt*self.dataIn.ippSeconds |
|
116 | self.dataOut.paramInterval = self.dataIn.nProfiles*self.dataIn.nCohInt*self.dataIn.ippSeconds | |
|
117 | ||||
|
118 | if hasattr(self.dataIn, 'flagDataAsBlock'): | |||
|
119 | self.dataOut.flagDataAsBlock = self.dataIn.flagDataAsBlock | |||
|
120 | ||||
|
121 | if hasattr(self.dataIn, 'profileIndex'): | |||
|
122 | self.dataOut.profileIndex = self.dataIn.profileIndex | |||
|
123 | ||||
111 | if hasattr(self.dataIn, 'dataPP_POW'): |
|
124 | if hasattr(self.dataIn, 'dataPP_POW'): | |
112 | self.dataOut.dataPP_POW = self.dataIn.dataPP_POW |
|
125 | self.dataOut.dataPP_POW = self.dataIn.dataPP_POW | |
113 |
|
126 | |||
@@ -143,6 +156,9 class ParametersProc(ProcessingUnit): | |||||
143 | self.dataOut.groupList = self.dataIn.pairsList |
|
156 | self.dataOut.groupList = self.dataIn.pairsList | |
144 | self.dataOut.flagNoData = False |
|
157 | self.dataOut.flagNoData = False | |
145 |
|
158 | |||
|
159 | if hasattr(self.dataIn, 'flagDataAsBlock'): | |||
|
160 | self.dataOut.flagDataAsBlock = self.dataIn.flagDataAsBlock | |||
|
161 | ||||
146 | if hasattr(self.dataIn, 'ChanDist'): #Distances of receiver channels |
|
162 | if hasattr(self.dataIn, 'ChanDist'): #Distances of receiver channels | |
147 | self.dataOut.ChanDist = self.dataIn.ChanDist |
|
163 | self.dataOut.ChanDist = self.dataIn.ChanDist | |
148 | else: self.dataOut.ChanDist = None |
|
164 | else: self.dataOut.ChanDist = None | |
@@ -3884,3 +3900,567 class SMOperations(): | |||||
3884 | # error[indInvalid1] = 13 |
|
3900 | # error[indInvalid1] = 13 | |
3885 | # |
|
3901 | # | |
3886 | # return heights, error |
|
3902 | # return heights, error | |
|
3903 | ||||
|
3904 | ||||
|
3905 | class WeatherRadar(Operation): | |||
|
3906 | ''' | |||
|
3907 | Function tat implements Weather Radar operations- | |||
|
3908 | Input: | |||
|
3909 | Output: | |||
|
3910 | Parameters affected: | |||
|
3911 | ''' | |||
|
3912 | isConfig = False | |||
|
3913 | ||||
|
3914 | def __init__(self): | |||
|
3915 | Operation.__init__(self) | |||
|
3916 | ||||
|
3917 | def setup(self,dataOut,Pt=0,Gt=0,Gr=0,lambda_=0, aL=0, | |||
|
3918 | tauW= 0,thetaT=0,thetaR=0,Km =0): | |||
|
3919 | self.nCh = dataOut.nChannels | |||
|
3920 | self.nHeis = dataOut.nHeights | |||
|
3921 | deltaHeight = dataOut.heightList[1] - dataOut.heightList[0] | |||
|
3922 | self.Range = numpy.arange(dataOut.nHeights)*deltaHeight + dataOut.heightList[0] | |||
|
3923 | self.Range = self.Range.reshape(1,self.nHeis) | |||
|
3924 | self.Range = numpy.tile(self.Range,[self.nCh,1]) | |||
|
3925 | '''-----------1 Constante del Radar----------''' | |||
|
3926 | self.Pt = Pt | |||
|
3927 | self.Gt = Gt | |||
|
3928 | self.Gr = Gr | |||
|
3929 | self.lambda_ = lambda_ | |||
|
3930 | self.aL = aL | |||
|
3931 | self.tauW = tauW | |||
|
3932 | self.thetaT = thetaT | |||
|
3933 | self.thetaR = thetaR | |||
|
3934 | self.Km = Km | |||
|
3935 | Numerator = ((4*numpy.pi)**3 * aL**2 * 16 *numpy.log(2)) | |||
|
3936 | Denominator = (Pt * Gt * Gr * lambda_**2 * SPEED_OF_LIGHT * tauW * numpy.pi*thetaT*thetaR) | |||
|
3937 | self.RadarConstant = Numerator/Denominator | |||
|
3938 | '''-----------2 Reflectividad del Radar y Factor de Reflectividad------''' | |||
|
3939 | self.n_radar = numpy.zeros((self.nCh,self.nHeis)) | |||
|
3940 | self.Z_radar = numpy.zeros((self.nCh,self.nHeis)) | |||
|
3941 | ||||
|
3942 | def setMoments(self,dataOut,i): | |||
|
3943 | ||||
|
3944 | type = dataOut.inputUnit | |||
|
3945 | nCh = dataOut.nChannels | |||
|
3946 | nHeis= dataOut.nHeights | |||
|
3947 | data_param = numpy.zeros((nCh,4,nHeis)) | |||
|
3948 | if type == "Voltage": | |||
|
3949 | data_param[:,0,:] = dataOut.dataPP_POW/(dataOut.nCohInt**2) | |||
|
3950 | data_param[:,1,:] = dataOut.dataPP_DOP | |||
|
3951 | data_param[:,2,:] = dataOut.dataPP_WIDTH | |||
|
3952 | data_param[:,3,:] = dataOut.dataPP_SNR | |||
|
3953 | if type == "Spectra": | |||
|
3954 | data_param[:,0,:] = dataOut.data_POW | |||
|
3955 | data_param[:,1,:] = dataOut.data_DOP | |||
|
3956 | data_param[:,2,:] = dataOut.data_WIDTH | |||
|
3957 | def setMoments(self,dataOut,i): | |||
|
3958 | data_param[:,3,:] = dataOut.data_SNR | |||
|
3959 | ||||
|
3960 | return data_param[:,i,:] | |||
|
3961 | ||||
|
3962 | ||||
|
3963 | def run(self,dataOut,Pt=25,Gt=200.0,Gr=50.0,lambda_=0.32, aL=2.5118, | |||
|
3964 | tauW= 4.0e-6,thetaT=0.165,thetaR=0.367,Km =0.93): | |||
|
3965 | ||||
|
3966 | if not self.isConfig: | |||
|
3967 | self.setup(dataOut= dataOut,Pt=25,Gt=200.0,Gr=50.0,lambda_=0.32, aL=2.5118, | |||
|
3968 | tauW= 4.0e-6,thetaT=0.165,thetaR=0.367,Km =0.93) | |||
|
3969 | self.isConfig = True | |||
|
3970 | '''-----------------------------Potencia de Radar -Signal S-----------------------------''' | |||
|
3971 | Pr = self.setMoments(dataOut,0) | |||
|
3972 | ||||
|
3973 | for R in range(self.nHeis): | |||
|
3974 | self.n_radar[:,R] = self.RadarConstant*Pr[:,R]* (self.Range[:,R])**2 | |||
|
3975 | ||||
|
3976 | self.Z_radar[:,R] = self.n_radar[:,R]* self.lambda_**4/( numpy.pi**5 * self.Km**2) | |||
|
3977 | ||||
|
3978 | '''----------- Factor de Reflectividad Equivalente lamda_ < 10 cm , lamda_= 3.2cm-------''' | |||
|
3979 | Zeh = self.Z_radar | |||
|
3980 | dBZeh = 10*numpy.log10(Zeh) | |||
|
3981 | dataOut.factor_Zeh= dBZeh | |||
|
3982 | self.n_radar = numpy.zeros((self.nCh,self.nHeis)) | |||
|
3983 | self.Z_radar = numpy.zeros((self.nCh,self.nHeis)) | |||
|
3984 | ||||
|
3985 | return dataOut | |||
|
3986 | ||||
|
3987 | class PedestalInformation(Operation): | |||
|
3988 | path_ped = None | |||
|
3989 | path_adq = None | |||
|
3990 | t_Interval_p = None | |||
|
3991 | n_Muestras_p = None | |||
|
3992 | isConfig = False | |||
|
3993 | blocksPerfile= None | |||
|
3994 | f_a_p = None | |||
|
3995 | online = None | |||
|
3996 | angulo_adq = None | |||
|
3997 | nro_file = None | |||
|
3998 | nro_key_p = None | |||
|
3999 | ||||
|
4000 | ||||
|
4001 | def __init__(self): | |||
|
4002 | Operation.__init__(self) | |||
|
4003 | ||||
|
4004 | def getfirstFilefromPath(self,path,meta,ext): | |||
|
4005 | validFilelist = [] | |||
|
4006 | #print("SEARH",path) | |||
|
4007 | try: | |||
|
4008 | fileList = os.listdir(path) | |||
|
4009 | except: | |||
|
4010 | print("check path - fileList") | |||
|
4011 | if len(fileList)<1: | |||
|
4012 | return None | |||
|
4013 | # meta 1234 567 8-18 BCDE | |||
|
4014 | # H,D,PE YYYY DDD EPOC .ext | |||
|
4015 | ||||
|
4016 | for thisFile in fileList: | |||
|
4017 | #print("HI",thisFile) | |||
|
4018 | if meta =="PE": | |||
|
4019 | try: | |||
|
4020 | number= int(thisFile[len(meta)+7:len(meta)+17]) | |||
|
4021 | except: | |||
|
4022 | print("There is a file or folder with different format") | |||
|
4023 | if meta == "D": | |||
|
4024 | try: | |||
|
4025 | number= int(thisFile[8:11]) | |||
|
4026 | except: | |||
|
4027 | print("There is a file or folder with different format") | |||
|
4028 | ||||
|
4029 | if not isNumber(str=number): | |||
|
4030 | continue | |||
|
4031 | if (os.path.splitext(thisFile)[-1].lower() != ext.lower()): | |||
|
4032 | continue | |||
|
4033 | validFilelist.sort() | |||
|
4034 | validFilelist.append(thisFile) | |||
|
4035 | if len(validFilelist)>0: | |||
|
4036 | validFilelist = sorted(validFilelist,key=str.lower) | |||
|
4037 | return validFilelist | |||
|
4038 | return None | |||
|
4039 | ||||
|
4040 | def gettimeutcfromDirFilename(self,path,file): | |||
|
4041 | dir_file= path+"/"+file | |||
|
4042 | fp = h5py.File(dir_file,'r') | |||
|
4043 | #epoc = fp['Metadata'].get('utctimeInit')[()] | |||
|
4044 | epoc = fp['Data'].get('utc')[()] | |||
|
4045 | fp.close() | |||
|
4046 | return epoc | |||
|
4047 | ||||
|
4048 | def getDatavaluefromDirFilename(self,path,file,value): | |||
|
4049 | dir_file= path+"/"+file | |||
|
4050 | fp = h5py.File(dir_file,'r') | |||
|
4051 | array = fp['Data'].get(value)[()] | |||
|
4052 | fp.close() | |||
|
4053 | return array | |||
|
4054 | ||||
|
4055 | def getFile_KeyP(self,list_pedestal,list_adq): | |||
|
4056 | print(list_pedestal) | |||
|
4057 | print(list_adq) | |||
|
4058 | ||||
|
4059 | def getNROFile(self,utc_adq,utc_ped_list): | |||
|
4060 | c=0 | |||
|
4061 | for i in range(len(utc_ped_list)): | |||
|
4062 | if utc_adq>utc_ped_list[i]: | |||
|
4063 | c +=1 | |||
|
4064 | ||||
|
4065 | return c-1,utc_ped_list[c-1],utc_ped_list[c] | |||
|
4066 | ||||
|
4067 | ||||
|
4068 | def setup_offline(self,list_pedestal,list_adq): | |||
|
4069 | print("SETUP OFFLINE") | |||
|
4070 | print(self.path_ped) | |||
|
4071 | print(self.path_adq) | |||
|
4072 | print(len(self.list_pedestal)) | |||
|
4073 | print(len(self.list_adq)) | |||
|
4074 | utc_ped_list=[] | |||
|
4075 | for i in range(len(self.list_pedestal)): | |||
|
4076 | utc_ped_list.append(self.gettimeutcfromDirFilename(path=self.path_ped,file=self.list_pedestal[i])) | |||
|
4077 | ||||
|
4078 | #utc_ped_list= utc_ped_list | |||
|
4079 | utc_adq = self.gettimeutcfromDirFilename(path=self.path_adq,file=self.list_adq[0]) | |||
|
4080 | #print("utc_ped_list",utc_ped_list) | |||
|
4081 | print("utc_adq",utc_adq) | |||
|
4082 | nro_file,utc_ped = self.getNROFile(utc_adq=utc_adq, utc_ped_list= utc_ped_list) | |||
|
4083 | ||||
|
4084 | print("nro_file",nro_file,"utc_ped",utc_ped) | |||
|
4085 | print("nro_file",i) | |||
|
4086 | nro_key_p = int((utc_adq-utc_ped)/self.t_Interval_p) | |||
|
4087 | print("nro_key_p",nro_key_p) | |||
|
4088 | ||||
|
4089 | ff_pedestal = self.list_pedestal[nro_file] | |||
|
4090 | #angulo = self.getDatavaluefromDirFilename(path=self.path_ped,file=ff_pedestal,value="azimuth") | |||
|
4091 | angulo = self.getDatavaluefromDirFilename(path=self.path_ped,file=ff_pedestal,value="azi_pos") | |||
|
4092 | ||||
|
4093 | print("utc_pedestal_init :",utc_ped+nro_key_p*self.t_Interval_p) | |||
|
4094 | print("angulo_array :",angulo[nro_key_p]) | |||
|
4095 | self.nro_file = nro_file | |||
|
4096 | self.nro_key_p = nro_key_p | |||
|
4097 | ||||
|
4098 | def setup_online(self,dataOut): | |||
|
4099 | utc_adq =dataOut.utctime | |||
|
4100 | print("Online-utc_adq",utc_adq) | |||
|
4101 | print(len(self.list_pedestal)) | |||
|
4102 | utc_ped_list=[] | |||
|
4103 | for i in range(len(self.list_pedestal)): | |||
|
4104 | utc_ped_list.append(self.gettimeutcfromDirFilename(path=self.path_ped,file=self.list_pedestal[i])) | |||
|
4105 | print(utc_ped_list[:20]) | |||
|
4106 | #print(utc_ped_list[488:498]) | |||
|
4107 | print("ultimo UTC-PEDESTAL",utc_ped_list[-1]) | |||
|
4108 | nro_file,utc_ped,utc_ped_1 = self.getNROFile(utc_adq=utc_adq, utc_ped_list= utc_ped_list) | |||
|
4109 | print("nro_file",nro_file,"utc_ped",utc_ped,"utc_ped_1",utc_ped_1) | |||
|
4110 | print("name_PEDESTAL",self.list_pedestal[nro_file]) | |||
|
4111 | nro_key_p = int((utc_adq-utc_ped)/self.t_Interval_p) | |||
|
4112 | print("nro_key_p",nro_key_p) | |||
|
4113 | ff_pedestal = self.list_pedestal[nro_file] | |||
|
4114 | #angulo = self.getDatavaluefromDirFilename(path=self.path_ped,file=ff_pedestal,value="azimuth") | |||
|
4115 | angulo = self.getDatavaluefromDirFilename(path=self.path_ped,file=ff_pedestal,value="azi_pos") | |||
|
4116 | ||||
|
4117 | print("utc_pedestal_init :",utc_ped+nro_key_p*self.t_Interval_p) | |||
|
4118 | print("angulo_array :",angulo[nro_key_p]) | |||
|
4119 | self.nro_file = nro_file | |||
|
4120 | self.nro_key_p = nro_key_p | |||
|
4121 | ||||
|
4122 | ||||
|
4123 | ''' | |||
|
4124 | print("############################") | |||
|
4125 | utc_adq = dataOut.utctime | |||
|
4126 | print("ONLINE",dataOut.utctime) | |||
|
4127 | print("utc_adq" , utc_adq) | |||
|
4128 | utc_pedestal= self.gettimeutcfromDirFilename(path=self.path_ped,file=self.list_pedestal[0]) | |||
|
4129 | print("utc_pedestal", utc_pedestal) | |||
|
4130 | flag_i = 0 | |||
|
4131 | flag = 0 | |||
|
4132 | ready = 0 | |||
|
4133 | if len(self.list_pedestal)!=0: | |||
|
4134 | enable_p=1 | |||
|
4135 | if (enable_p!=0): | |||
|
4136 | while(flag_i==0): | |||
|
4137 | if utc_adq>utc_pedestal: | |||
|
4138 | nro_file = int((utc_adq - utc_pedestal)/(self.t_Interval_p*self.n_Muestras_p)) | |||
|
4139 | print("nro_file--------------------",nro_file) | |||
|
4140 | print(len(self.list_pedestal)) | |||
|
4141 | if nro_file> len(self.list_pedestal): | |||
|
4142 | nro_file = len(self.list_pedestal)-1 | |||
|
4143 | ff_pedestal = self.list_pedestal[nro_file] | |||
|
4144 | print(ff_pedestal) | |||
|
4145 | utc_pedestal = self.gettimeutcfromDirFilename(path=self.path_ped,file=ff_pedestal) | |||
|
4146 | while(flag==0): | |||
|
4147 | print("adq",utc_adq) | |||
|
4148 | print("ped",utc_pedestal) | |||
|
4149 | print("nro_file",nro_file) | |||
|
4150 | if utc_adq >utc_pedestal: | |||
|
4151 | print("DENTRO DEL IF-SETUP") | |||
|
4152 | ff_pedestal = self.list_pedestal[nro_file] | |||
|
4153 | if 0<(utc_adq - utc_pedestal)<(self.t_Interval_p*self.n_Muestras_p): | |||
|
4154 | nro_file= nro_file | |||
|
4155 | ff_pedestal = self.list_pedestal[nro_file] | |||
|
4156 | ready = 1 | |||
|
4157 | if (utc_adq-utc_pedestal)>(self.t_Interval_p*self.n_Muestras_p): | |||
|
4158 | nro_tmp= int((utc_adq-utc_pedestal)/(self.n_Muestras_p)) | |||
|
4159 | nro_file= nro_file+1*nro_tmp#chsssssssssssssssssssasssddasdas/ equear esta condicion | |||
|
4160 | if nro_tmp==0: | |||
|
4161 | nro_file= nro_file +1 | |||
|
4162 | ff_pedestal = self.list_pedestal[nro_file] | |||
|
4163 | print("",ff_pedestal) | |||
|
4164 | utc_pedestal = self.gettimeutcfromDirFilename(path=self.path_ped,file=ff_pedestal) | |||
|
4165 | else: | |||
|
4166 | print("DENTRO DEL ELSE-SETUP") | |||
|
4167 | nro_tmp= int((utc_pedestal-utc_adq)/(self.n_Muestras_p)) | |||
|
4168 | if utc_pedestal>utc_adq and nro_tmp==0: | |||
|
4169 | nro_tmp= int((utc_pedestal-utc_adq)) | |||
|
4170 | print("nro_tmp",nro_tmp) | |||
|
4171 | if nro_file>nro_tmp: | |||
|
4172 | nro_file = nro_file-1*nro_tmp | |||
|
4173 | else: | |||
|
4174 | nro_file =nro_file -1 | |||
|
4175 | ||||
|
4176 | ff_pedestal = self.list_pedestal[nro_file] | |||
|
4177 | utc_pedestal = self.gettimeutcfromDirFilename(path=self.path_ped,file=ff_pedestal) | |||
|
4178 | ||||
|
4179 | if ready: | |||
|
4180 | angulo = self.getDatavaluefromDirFilename(path=self.path_ped,file=ff_pedestal,value="azimuth") | |||
|
4181 | nro_key_p = int((utc_adq-utc_pedestal)/self.t_Interval_p) | |||
|
4182 | print("nro_file :",nro_file) | |||
|
4183 | print("name_file :",ff_pedestal) | |||
|
4184 | print("utc_pedestal_file :",utc_pedestal) | |||
|
4185 | print("nro_key_p :",nro_key_p) | |||
|
4186 | print("utc_pedestal_init :",utc_pedestal+nro_key_p*self.t_Interval_p) | |||
|
4187 | print("angulo_array :",angulo[nro_key_p]) | |||
|
4188 | flag=1 | |||
|
4189 | flag_i=1 | |||
|
4190 | else: | |||
|
4191 | print("La lista de archivos de pedestal o adq esta vacia") | |||
|
4192 | nro_file=None | |||
|
4193 | nro_key_p=None | |||
|
4194 | self.nro_file = nro_file | |||
|
4195 | self.nro_key_p = nro_key_p | |||
|
4196 | ''' | |||
|
4197 | ||||
|
4198 | def setup(self,dataOut,path_ped,path_adq,t_Interval_p,n_Muestras_p,blocksPerfile,f_a_p,online): | |||
|
4199 | self.__dataReady = False | |||
|
4200 | self.path_ped = path_ped | |||
|
4201 | self.path_adq = path_adq | |||
|
4202 | self.t_Interval_p = t_Interval_p | |||
|
4203 | self.n_Muestras_p = n_Muestras_p | |||
|
4204 | self.blocksPerfile= blocksPerfile | |||
|
4205 | self.f_a_p = f_a_p | |||
|
4206 | self.online = online | |||
|
4207 | self.angulo_adq = numpy.zeros(self.blocksPerfile) | |||
|
4208 | self.__profIndex = 0 | |||
|
4209 | print(self.path_ped) | |||
|
4210 | print(self.path_adq) | |||
|
4211 | self.list_pedestal = self.getfirstFilefromPath(path=self.path_ped,meta="PE",ext=".hdf5") | |||
|
4212 | print("LIST NEW", self.list_pedestal[:20]) | |||
|
4213 | self.list_adq = self.getfirstFilefromPath(path=self.path_adq,meta="D",ext=".hdf5") | |||
|
4214 | print("*************Longitud list pedestal****************",len(self.list_pedestal)) | |||
|
4215 | ||||
|
4216 | if self.online: | |||
|
4217 | print("Enable Online") | |||
|
4218 | self.setup_online(dataOut) | |||
|
4219 | else: | |||
|
4220 | self.setup_offline(list_pedestal=self.list_pedestal,list_adq=self.list_adq) | |||
|
4221 | ||||
|
4222 | def setNextFileP(self,dataOut): | |||
|
4223 | if self.online: | |||
|
4224 | data_pedestal = self.setNextFileonline() | |||
|
4225 | else: | |||
|
4226 | data_pedestal = self.setNextFileoffline() | |||
|
4227 | ||||
|
4228 | return data_pedestal | |||
|
4229 | ||||
|
4230 | ||||
|
4231 | def setNextFileoffline(self): | |||
|
4232 | tmp =0 | |||
|
4233 | for j in range(self.blocksPerfile): | |||
|
4234 | #print("NUMERO DEL BLOQUE:",j) | |||
|
4235 | iterador = self.nro_key_p +self.f_a_p*(j-tmp) | |||
|
4236 | #print("iterador",iterador) | |||
|
4237 | if iterador < self.n_Muestras_p: | |||
|
4238 | self.nro_file = self.nro_file | |||
|
4239 | else: | |||
|
4240 | self.nro_file = self.nro_file+1 | |||
|
4241 | dif = self.blocksPerfile-(self.nro_key_p+self.f_a_p*(j-tmp-1)) | |||
|
4242 | tmp = j | |||
|
4243 | self.nro_key_p= self.f_a_p-dif | |||
|
4244 | iterador = self.nro_key_p | |||
|
4245 | #print("nro_file",self.nro_file) | |||
|
4246 | try: | |||
|
4247 | ff_pedestal = self.list_pedestal[self.nro_file] | |||
|
4248 | except: | |||
|
4249 | return numpy.ones(self.blocksPerfile)*numpy.nan | |||
|
4250 | ||||
|
4251 | angulo = self.getDatavaluefromDirFilename(path=self.path_ped,file=ff_pedestal,value="azimuth") | |||
|
4252 | self.angulo_adq[j]= angulo[iterador] | |||
|
4253 | ||||
|
4254 | return self.angulo_adq | |||
|
4255 | ||||
|
4256 | def setNextFileonline(self): | |||
|
4257 | tmp = 0 | |||
|
4258 | self.nTries_p = 3 | |||
|
4259 | self.delay = 3 | |||
|
4260 | ready = 1 | |||
|
4261 | for j in range(self.blocksPerfile): | |||
|
4262 | iterador = self.nro_key_p +self.f_a_p*(j-tmp) | |||
|
4263 | if iterador < self.n_Muestras_p: | |||
|
4264 | self.nro_file = self.nro_file | |||
|
4265 | else: | |||
|
4266 | self.nro_file = self.nro_file+1 | |||
|
4267 | dif = self.blocksPerfile-(self.nro_key_p+self.f_a_p*(j-tmp-1)) | |||
|
4268 | tmp = j | |||
|
4269 | self.nro_key_p= self.f_a_p-dif | |||
|
4270 | iterador = self.nro_key_p | |||
|
4271 | print("nro_file---------------- :",self.nro_file) | |||
|
4272 | try: | |||
|
4273 | # update list_pedestal | |||
|
4274 | self.list_pedestal = self.getfirstFilefromPath(path=self.path_ped,meta="PE",ext=".hdf5") | |||
|
4275 | ff_pedestal = self.list_pedestal[self.nro_file] | |||
|
4276 | except: | |||
|
4277 | ff_pedestal = None | |||
|
4278 | ready = 0 | |||
|
4279 | for nTries_p in range(self.nTries_p): | |||
|
4280 | try: | |||
|
4281 | # update list_pedestal | |||
|
4282 | self.list_pedestal = self.getfirstFilefromPath(path=self.path_ped,meta="PE",ext=".hdf5") | |||
|
4283 | ff_pedestal = self.list_pedestal[self.nro_file] | |||
|
4284 | except: | |||
|
4285 | ff_pedestal = None | |||
|
4286 | if ff_pedestal is not None: | |||
|
4287 | ready=1 | |||
|
4288 | break | |||
|
4289 | log.warning("Waiting %0.2f sec for the next file: \"%s\" , try %02d ..." % (self.delay, self.nro_file, nTries_p + 1)) | |||
|
4290 | time.sleep(self.delay) | |||
|
4291 | continue | |||
|
4292 | #return numpy.ones(self.blocksPerfile)*numpy.nan | |||
|
4293 | ||||
|
4294 | if ready == 1: | |||
|
4295 | #angulo = self.getDatavaluefromDirFilename(path=self.path_ped,file=ff_pedestal,value="azimuth") | |||
|
4296 | angulo = self.getDatavaluefromDirFilename(path=self.path_ped,file=ff_pedestal,value="azi_pos") | |||
|
4297 | ||||
|
4298 | else: | |||
|
4299 | print("there is no pedestal file") | |||
|
4300 | angulo = numpy.ones(self.n_Muestras_p)*numpy.nan | |||
|
4301 | self.angulo_adq[j]= angulo[iterador] | |||
|
4302 | print("Angulo",self.angulo_adq) | |||
|
4303 | print("Angulo",len(self.angulo_adq)) | |||
|
4304 | #self.nro_key_p=iterador + self.f_a_p | |||
|
4305 | #if self.nro_key_p< self.n_Muestras_p: | |||
|
4306 | # self.nro_file = self.nro_file | |||
|
4307 | #else: | |||
|
4308 | # self.nro_file = self.nro_file+1 | |||
|
4309 | # self.nro_key_p= self.nro_key_p | |||
|
4310 | return self.angulo_adq | |||
|
4311 | ||||
|
4312 | ||||
|
4313 | def run(self, dataOut,path_ped,path_adq,t_Interval_p,n_Muestras_p,blocksPerfile,f_a_p,online): | |||
|
4314 | if not self.isConfig: | |||
|
4315 | self.setup( dataOut, path_ped,path_adq,t_Interval_p,n_Muestras_p,blocksPerfile,f_a_p,online) | |||
|
4316 | self.isConfig = True | |||
|
4317 | ||||
|
4318 | dataOut.flagNoData = True | |||
|
4319 | #print("profIndex",self.__profIndex) | |||
|
4320 | ||||
|
4321 | if self.__profIndex==0: | |||
|
4322 | angulo_adq = self.setNextFileP(dataOut) | |||
|
4323 | dataOut.azimuth = angulo_adq | |||
|
4324 | self.__dataReady = True | |||
|
4325 | self.__profIndex += 1 | |||
|
4326 | if self.__profIndex== blocksPerfile: | |||
|
4327 | self.__profIndex = 0 | |||
|
4328 | if self.__dataReady: | |||
|
4329 | #print(self.__profIndex,dataOut.azimuth[:10]) | |||
|
4330 | dataOut.flagNoData = False | |||
|
4331 | return dataOut | |||
|
4332 | ||||
|
4333 | ||||
|
4334 | class Block360(Operation): | |||
|
4335 | ''' | |||
|
4336 | ''' | |||
|
4337 | isConfig = False | |||
|
4338 | __profIndex = 0 | |||
|
4339 | __initime = None | |||
|
4340 | __lastdatatime = None | |||
|
4341 | __buffer = None | |||
|
4342 | __dataReady = False | |||
|
4343 | n = None | |||
|
4344 | __nch = 0 | |||
|
4345 | __nHeis = 0 | |||
|
4346 | index = 0 | |||
|
4347 | ||||
|
4348 | def __init__(self,**kwargs): | |||
|
4349 | Operation.__init__(self,**kwargs) | |||
|
4350 | ||||
|
4351 | def setup(self, dataOut, n = None): | |||
|
4352 | ''' | |||
|
4353 | n= Numero de PRF's de entrada | |||
|
4354 | ''' | |||
|
4355 | self.__initime = None | |||
|
4356 | self.__lastdatatime = 0 | |||
|
4357 | self.__dataReady = False | |||
|
4358 | self.__buffer = 0 | |||
|
4359 | self.__buffer_1D = 0 | |||
|
4360 | self.__profIndex = 0 | |||
|
4361 | self.index = 0 | |||
|
4362 | self.__nch = dataOut.nChannels | |||
|
4363 | self.__nHeis = dataOut.nHeights | |||
|
4364 | ##print("ELVALOR DE n es:", n) | |||
|
4365 | if n == None: | |||
|
4366 | raise ValueError("n should be specified.") | |||
|
4367 | ||||
|
4368 | if n != None: | |||
|
4369 | if n<1: | |||
|
4370 | print("n should be greater than 2") | |||
|
4371 | raise ValueError("n should be greater than 2") | |||
|
4372 | ||||
|
4373 | self.n = n | |||
|
4374 | #print("nHeights") | |||
|
4375 | self.__buffer = numpy.zeros(( dataOut.nChannels,n, dataOut.nHeights)) | |||
|
4376 | self.__buffer2= numpy.zeros(n) | |||
|
4377 | ||||
|
4378 | def putData(self,data): | |||
|
4379 | ''' | |||
|
4380 | Add a profile to he __buffer and increase in one the __profiel Index | |||
|
4381 | ''' | |||
|
4382 | #print("line 4049",data.dataPP_POW.shape,data.dataPP_POW[:10]) | |||
|
4383 | #print("line 4049",data.azimuth.shape,data.azimuth) | |||
|
4384 | self.__buffer[:,self.__profIndex,:]= data.dataPP_POW | |||
|
4385 | #print("me casi",self.index,data.azimuth[self.index]) | |||
|
4386 | #print(self.__profIndex, self.index , data.azimuth[self.index] ) | |||
|
4387 | #print("magic",data.profileIndex) | |||
|
4388 | #print(data.azimuth[self.index]) | |||
|
4389 | #print("index",self.index) | |||
|
4390 | ||||
|
4391 | self.__buffer2[self.__profIndex] = data.azimuth[self.index] | |||
|
4392 | #print("q pasa") | |||
|
4393 | self.index+=1 | |||
|
4394 | #print("index",self.index,data.azimuth[:10]) | |||
|
4395 | self.__profIndex += 1 | |||
|
4396 | return #················· Remove DC··································· | |||
|
4397 | ||||
|
4398 | def pushData(self,data): | |||
|
4399 | ''' | |||
|
4400 | Return the PULSEPAIR and the profiles used in the operation | |||
|
4401 | Affected : self.__profileIndex | |||
|
4402 | ''' | |||
|
4403 | #print("pushData") | |||
|
4404 | ||||
|
4405 | data_360 = self.__buffer | |||
|
4406 | data_p = self.__buffer2 | |||
|
4407 | n = self.__profIndex | |||
|
4408 | ||||
|
4409 | self.__buffer = numpy.zeros((self.__nch, self.n,self.__nHeis)) | |||
|
4410 | self.__buffer2 = numpy.zeros(self.n) | |||
|
4411 | self.__profIndex = 0 | |||
|
4412 | #print("pushData") | |||
|
4413 | return data_360,n,data_p | |||
|
4414 | ||||
|
4415 | ||||
|
4416 | def byProfiles(self,dataOut): | |||
|
4417 | ||||
|
4418 | self.__dataReady = False | |||
|
4419 | data_360 = None | |||
|
4420 | data_p = None | |||
|
4421 | #print("dataOu",dataOut.dataPP_POW) | |||
|
4422 | self.putData(data=dataOut) | |||
|
4423 | #print("profIndex",self.__profIndex) | |||
|
4424 | if self.__profIndex == self.n: | |||
|
4425 | data_360,n,data_p = self.pushData(data=dataOut) | |||
|
4426 | self.__dataReady = True | |||
|
4427 | ||||
|
4428 | return data_360,data_p | |||
|
4429 | ||||
|
4430 | ||||
|
4431 | def blockOp(self, dataOut, datatime= None): | |||
|
4432 | if self.__initime == None: | |||
|
4433 | self.__initime = datatime | |||
|
4434 | data_360,data_p = self.byProfiles(dataOut) | |||
|
4435 | self.__lastdatatime = datatime | |||
|
4436 | ||||
|
4437 | if data_360 is None: | |||
|
4438 | return None, None,None | |||
|
4439 | ||||
|
4440 | avgdatatime = self.__initime | |||
|
4441 | deltatime = datatime - self.__lastdatatime | |||
|
4442 | self.__initime = datatime | |||
|
4443 | #print(data_360.shape,avgdatatime,data_p.shape) | |||
|
4444 | return data_360,avgdatatime,data_p | |||
|
4445 | ||||
|
4446 | def run(self, dataOut,n = None,**kwargs): | |||
|
4447 | ||||
|
4448 | if not self.isConfig: | |||
|
4449 | self.setup(dataOut = dataOut, n = n , **kwargs) | |||
|
4450 | self.index = 0 | |||
|
4451 | #print("comova",self.isConfig) | |||
|
4452 | self.isConfig = True | |||
|
4453 | if self.index==dataOut.azimuth.shape[0]: | |||
|
4454 | self.index=0 | |||
|
4455 | data_360, avgdatatime,data_p = self.blockOp(dataOut, dataOut.utctime) | |||
|
4456 | dataOut.flagNoData = True | |||
|
4457 | ||||
|
4458 | if self.__dataReady: | |||
|
4459 | dataOut.data_360 = data_360 # S | |||
|
4460 | #print("DATAREADY---------------------------------------------") | |||
|
4461 | print("data_360",dataOut.data_360.shape) | |||
|
4462 | dataOut.data_azi = data_p | |||
|
4463 | #print("jroproc_parameters",data_p[0],data_p[-1])#,data_360.shape,avgdatatime) | |||
|
4464 | dataOut.utctime = avgdatatime | |||
|
4465 | dataOut.flagNoData = False | |||
|
4466 | return dataOut |
@@ -1287,7 +1287,7 class CombineProfiles(Operation): | |||||
1287 |
|
1287 | |||
1288 | return dataOut |
|
1288 | return dataOut | |
1289 |
|
1289 | |||
1290 |
class PulsePair |
|
1290 | class PulsePair(Operation): | |
1291 | ''' |
|
1291 | ''' | |
1292 | Function PulsePair(Signal Power, Velocity) |
|
1292 | Function PulsePair(Signal Power, Velocity) | |
1293 | The real component of Lag[0] provides Intensity Information |
|
1293 | The real component of Lag[0] provides Intensity Information | |
@@ -1324,6 +1324,7 class PulsePairVoltage(Operation): | |||||
1324 | ''' |
|
1324 | ''' | |
1325 | n= Numero de PRF's de entrada |
|
1325 | n= Numero de PRF's de entrada | |
1326 | ''' |
|
1326 | ''' | |
|
1327 | print("[INICIO]-setup del METODO PULSE PAIR") | |||
1327 | self.__initime = None |
|
1328 | self.__initime = None | |
1328 | self.__lastdatatime = 0 |
|
1329 | self.__lastdatatime = 0 | |
1329 | self.__dataReady = False |
|
1330 | self.__dataReady = False | |
@@ -1482,6 +1483,7 class PulsePairVoltage(Operation): | |||||
1482 | dataOut.dataPP_SNR = data_snrPP |
|
1483 | dataOut.dataPP_SNR = data_snrPP | |
1483 | dataOut.dataPP_WIDTH = data_specwidth |
|
1484 | dataOut.dataPP_WIDTH = data_specwidth | |
1484 | dataOut.PRFbyAngle = self.n #numero de PRF*cada angulo rotado que equivale a un tiempo. |
|
1485 | dataOut.PRFbyAngle = self.n #numero de PRF*cada angulo rotado que equivale a un tiempo. | |
|
1486 | dataOut.nProfiles = int(dataOut.nProfiles/n) | |||
1485 | dataOut.utctime = avgdatatime |
|
1487 | dataOut.utctime = avgdatatime | |
1486 | dataOut.flagNoData = False |
|
1488 | dataOut.flagNoData = False | |
1487 | return dataOut |
|
1489 | return dataOut |
@@ -23,17 +23,15 controllerObj.setup(id = '191', name='Test_USRP', description=desc) | |||||
23 | ######PATH DE LECTURA, ESCRITURA, GRAFICOS Y ENVIO WEB################# |
|
23 | ######PATH DE LECTURA, ESCRITURA, GRAFICOS Y ENVIO WEB################# | |
24 | ####################################################################### |
|
24 | ####################################################################### | |
25 | #path = '/media/data/data/vientos/57.2063km/echoes/NCO_Woodman' |
|
25 | #path = '/media/data/data/vientos/57.2063km/echoes/NCO_Woodman' | |
26 |
|
26 | #path = '/DATA_RM/TEST_INTEGRACION' | ||
27 |
|
27 | path = '/DATA_RM/TEST_ONLINE' | ||
28 | path = '/home/soporte/data_hdf5' #### with clock 35.16 db noise |
|
28 | figpath = '/home/soporte/Pictures/TEST_INTEGRACION_IMG' | |
29 |
|
||||
30 | figpath = '/home/soporte/data_hdf5_imag' |
|
|||
31 | #remotefolder = "/home/wmaster/graficos" |
|
29 | #remotefolder = "/home/wmaster/graficos" | |
32 | ####################################################################### |
|
30 | ####################################################################### | |
33 | ################# RANGO DE PLOTEO###################################### |
|
31 | ################# RANGO DE PLOTEO###################################### | |
34 | ####################################################################### |
|
32 | ####################################################################### | |
35 |
dBmin = ' |
|
33 | dBmin = '-5' | |
36 |
dBmax = ' |
|
34 | dBmax = '20' | |
37 | xmin = '0' |
|
35 | xmin = '0' | |
38 | xmax ='24' |
|
36 | xmax ='24' | |
39 | ymin = '0' |
|
37 | ymin = '0' | |
@@ -50,18 +48,18 yesterday = str2.strftime("%Y/%m/%d") | |||||
50 | ####################################################################### |
|
48 | ####################################################################### | |
51 | readUnitConfObj = controllerObj.addReadUnit(datatype='DigitalRFReader', |
|
49 | readUnitConfObj = controllerObj.addReadUnit(datatype='DigitalRFReader', | |
52 | path=path, |
|
50 | path=path, | |
53 |
startDate="201 |
|
51 | startDate="2021/01/01",#today, | |
54 |
endDate="2 |
|
52 | endDate="2021/12/30",#today, | |
55 | startTime='00:00:00', |
|
53 | startTime='00:00:00', | |
56 | endTime='23:59:59', |
|
54 | endTime='23:59:59', | |
57 | delay=0, |
|
55 | delay=0, | |
58 | #set=0, |
|
56 | #set=0, | |
59 | online=0, |
|
57 | online=0, | |
60 | walk=1, |
|
58 | walk=1, | |
61 |
ippKm = |
|
59 | ippKm = 60) | |
62 |
|
60 | |||
63 | opObj11 = readUnitConfObj.addOperation(name='printInfo') |
|
61 | opObj11 = readUnitConfObj.addOperation(name='printInfo') | |
64 | opObj11 = readUnitConfObj.addOperation(name='printNumberOfBlock') |
|
62 | #opObj11 = readUnitConfObj.addOperation(name='printNumberOfBlock') | |
65 | ####################################################################### |
|
63 | ####################################################################### | |
66 | ################ OPERACIONES DOMINIO DEL TIEMPO######################## |
|
64 | ################ OPERACIONES DOMINIO DEL TIEMPO######################## | |
67 | ####################################################################### |
|
65 | ####################################################################### | |
@@ -72,15 +70,32 procUnitConfObjA = controllerObj.addProcUnit(datatype='VoltageProc', inputId=rea | |||||
72 | # '1,1,1,0,1,1,0,1,1,1,1,0,0,0,1,0,1,1,1,0,1,1,0,1,0,0,0,1,1,1,0,1,0,0,0,1,0,0,1,0,0,0,0,1,1,1,0,1,1,1,1,0,1,1,0,1,0,0,0,1,1,1,0,1' |
|
70 | # '1,1,1,0,1,1,0,1,1,1,1,0,0,0,1,0,1,1,1,0,1,1,0,1,0,0,0,1,1,1,0,1,0,0,0,1,0,0,1,0,0,0,0,1,1,1,0,1,1,1,1,0,1,1,0,1,0,0,0,1,1,1,0,1' | |
73 |
|
71 | |||
74 | #opObj11 = procUnitConfObjA.addOperation(name='setRadarFrequency') |
|
72 | #opObj11 = procUnitConfObjA.addOperation(name='setRadarFrequency') | |
75 |
#opObj11.addParameter(name='frequency', value=' |
|
73 | #opObj11.addParameter(name='frequency', value='70312500') | |
|
74 | ||||
|
75 | ''' | |||
|
76 | opObj11 = procUnitConfObjA.addOperation(name='PulsePair', optype='other') | |||
|
77 | opObj11.addParameter(name='n', value='625', format='int')#10 | |||
|
78 | opObj11.addParameter(name='removeDC', value=1, format='int') | |||
|
79 | ''' | |||
76 |
|
80 | |||
77 | #opObj10 = procUnitConfObjA.addOperation(name='Scope', optype='external') |
|
81 | # Ploteo TEST | |
|
82 | ''' | |||
|
83 | opObj11 = procUnitConfObjA.addOperation(name='PulsepairPowerPlot', optype='other') | |||
|
84 | opObj11 = procUnitConfObjA.addOperation(name='PulsepairSignalPlot', optype='other') | |||
|
85 | opObj11 = procUnitConfObjA.addOperation(name='PulsepairVelocityPlot', optype='other') | |||
|
86 | #opObj11.addParameter(name='xmax', value=8) | |||
|
87 | opObj11 = procUnitConfObjA.addOperation(name='PulsepairSpecwidthPlot', optype='other') | |||
|
88 | ''' | |||
|
89 | # OJO SCOPE | |||
|
90 | #opObj10 = procUnitConfObjA.addOperation(name='ScopePlot', optype='external') | |||
78 | #opObj10.addParameter(name='id', value='10', format='int') |
|
91 | #opObj10.addParameter(name='id', value='10', format='int') | |
79 | ##opObj10.addParameter(name='xmin', value='0', format='int') |
|
92 | ##opObj10.addParameter(name='xmin', value='0', format='int') | |
80 | ##opObj10.addParameter(name='xmax', value='50', format='int') |
|
93 | ##opObj10.addParameter(name='xmax', value='50', format='int') | |
81 | #opObj10.addParameter(name='type', value='iq') |
|
94 | #opObj10.addParameter(name='type', value='iq') | |
82 | #opObj10.addParameter(name='ymin', value='-5000', format='int') |
|
95 | ##opObj10.addParameter(name='ymin', value='-5000', format='int') | |
83 | ##opObj10.addParameter(name='ymax', value='8500', format='int') |
|
96 | ##opObj10.addParameter(name='ymax', value='8500', format='int') | |
|
97 | #opObj11.addParameter(name='save', value=figpath, format='str') | |||
|
98 | #opObj11.addParameter(name='save_period', value=10, format='int') | |||
84 |
|
99 | |||
85 | #opObj10 = procUnitConfObjA.addOperation(name='setH0') |
|
100 | #opObj10 = procUnitConfObjA.addOperation(name='setH0') | |
86 | #opObj10.addParameter(name='h0', value='-5000', format='float') |
|
101 | #opObj10.addParameter(name='h0', value='-5000', format='float') | |
@@ -98,55 +113,104 procUnitConfObjA = controllerObj.addProcUnit(datatype='VoltageProc', inputId=rea | |||||
98 | #opObj11.addParameter(name='n', value='100', format='int') |
|
113 | #opObj11.addParameter(name='n', value='100', format='int') | |
99 |
|
114 | |||
100 | ####################################################################### |
|
115 | ####################################################################### | |
|
116 | ########## OPERACIONES ParametersProc######################## | |||
|
117 | ####################################################################### | |||
|
118 | ###procUnitConfObjB= controllerObj.addProcUnit(datatype='ParametersProc',inputId=procUnitConfObjA.getId()) | |||
|
119 | ''' | |||
|
120 | ||||
|
121 | opObj11 = procUnitConfObjA.addOperation(name='PedestalInformation') | |||
|
122 | opObj11.addParameter(name='path_ped', value=path_ped) | |||
|
123 | opObj11.addParameter(name='path_adq', value=path_adq) | |||
|
124 | opObj11.addParameter(name='t_Interval_p', value='0.01', format='float') | |||
|
125 | opObj11.addParameter(name='n_Muestras_p', value='100', format='float') | |||
|
126 | opObj11.addParameter(name='blocksPerfile', value='100', format='int') | |||
|
127 | opObj11.addParameter(name='f_a_p', value='25', format='int') | |||
|
128 | opObj11.addParameter(name='online', value='0', format='int') | |||
|
129 | ||||
|
130 | opObj11 = procUnitConfObjA.addOperation(name='Block360') | |||
|
131 | opObj11.addParameter(name='n', value='40', format='int') | |||
|
132 | ||||
|
133 | opObj11= procUnitConfObjA.addOperation(name='WeatherPlot',optype='other') | |||
|
134 | opObj11.addParameter(name='save', value=figpath) | |||
|
135 | opObj11.addParameter(name='save_period', value=1) | |||
|
136 | ||||
|
137 | ||||
|
138 | ''' | |||
|
139 | ||||
|
140 | ####################################################################### | |||
101 | ########## OPERACIONES DOMINIO DE LA FRECUENCIA######################## |
|
141 | ########## OPERACIONES DOMINIO DE LA FRECUENCIA######################## | |
102 | ####################################################################### |
|
142 | ####################################################################### | |
103 | procUnitConfObjSousySpectra = controllerObj.addProcUnit(datatype='SpectraProc', inputId=procUnitConfObjA.getId()) |
|
|||
104 | procUnitConfObjSousySpectra.addParameter(name='nFFTPoints', value='100', format='int') |
|
|||
105 | procUnitConfObjSousySpectra.addParameter(name='nProfiles', value='100', format='int') |
|
|||
106 | #procUnitConfObjSousySpectra.addParameter(name='pairsList', value='(0,0),(1,1),(0,1)', format='pairsList') |
|
|||
107 |
|
143 | |||
108 | #opObj13 = procUnitConfObjSousySpectra.addOperation(name='removeDC') |
|
144 | procUnitConfObjB = controllerObj.addProcUnit(datatype='SpectraProc', inputId=procUnitConfObjA.getId()) | |
|
145 | procUnitConfObjB.addParameter(name='nFFTPoints', value='32', format='int') | |||
|
146 | procUnitConfObjB.addParameter(name='nProfiles', value='32', format='int') | |||
|
147 | ||||
|
148 | procUnitConfObjC = controllerObj.addProcUnit(datatype='SpectraHeisProc', inputId=procUnitConfObjA.getId()) | |||
|
149 | #procUnitConfObjB.addParameter(name='nFFTPoints', value='64', format='int') | |||
|
150 | #procUnitConfObjB.addParameter(name='nProfiles', value='64', format='int') | |||
|
151 | opObj11 = procUnitConfObjC.addOperation(name='IncohInt4SpectraHeis', optype='other') | |||
|
152 | opObj11.addParameter(name='timeInterval', value='8', format='int') | |||
|
153 | ||||
|
154 | ||||
|
155 | #procUnitConfObjB.addParameter(name='pairsList', value='(0,0),(1,1),(0,1)', format='pairsList') | |||
|
156 | ||||
|
157 | #opObj13 = procUnitConfObjB.addOperation(name='removeDC') | |||
109 | #opObj13.addParameter(name='mode', value='2', format='int') |
|
158 | #opObj13.addParameter(name='mode', value='2', format='int') | |
110 |
|
159 | |||
111 |
|
|
160 | opObj11 = procUnitConfObjB.addOperation(name='IncohInt', optype='other') | |
112 |
|
|
161 | opObj11.addParameter(name='n', value='8', format='float') | |
113 | ####################################################################### |
|
162 | ####################################################################### | |
114 | ########## PLOTEO DOMINIO DE LA FRECUENCIA############################# |
|
163 | ########## PLOTEO DOMINIO DE LA FRECUENCIA############################# | |
115 | ####################################################################### |
|
164 | ####################################################################### | |
|
165 | #---- | |||
|
166 | ||||
|
167 | opObj11 = procUnitConfObjC.addOperation(name='SpectraHeisPlot') | |||
|
168 | opObj11.addParameter(name='id', value='10', format='int') | |||
|
169 | opObj11.addParameter(name='wintitle', value='Spectra_Alturas', format='str') | |||
|
170 | #opObj11.addParameter(name='xmin', value=-100000, format='float') | |||
|
171 | #opObj11.addParameter(name='xmax', value=100000, format='float') | |||
|
172 | #opObj11.addParameter(name='zmin', value=dBmin, format='int') | |||
|
173 | #opObj11.addParameter(name='zmax', value=dBmax, format='int') | |||
|
174 | opObj11.addParameter(name='ymin', value=-20, format='int') | |||
|
175 | opObj11.addParameter(name='ymax', value=50, format='int') | |||
|
176 | opObj11.addParameter(name='showprofile', value='1', format='int') | |||
|
177 | opObj11.addParameter(name='save', value=figpath, format='str') | |||
|
178 | opObj11.addParameter(name='save_period', value=10, format='int') | |||
|
179 | ||||
|
180 | ||||
116 | #SpectraPlot |
|
181 | #SpectraPlot | |
117 |
|
182 | |||
118 |
opObj11 = procUnitConfObj |
|
183 | opObj11 = procUnitConfObjB.addOperation(name='SpectraPlot', optype='external') | |
119 | opObj11.addParameter(name='id', value='1', format='int') |
|
184 | opObj11.addParameter(name='id', value='1', format='int') | |
120 | opObj11.addParameter(name='wintitle', value='Spectra', format='str') |
|
185 | opObj11.addParameter(name='wintitle', value='Spectra', format='str') | |
121 | #opObj11.addParameter(name='xmin', value=-0.01, format='float') |
|
186 | #opObj11.addParameter(name='xmin', value=-0.01, format='float') | |
122 | #opObj11.addParameter(name='xmax', value=0.01, format='float') |
|
187 | #opObj11.addParameter(name='xmax', value=0.01, format='float') | |
123 |
|
|
188 | opObj11.addParameter(name='zmin', value=dBmin, format='int') | |
124 |
|
|
189 | opObj11.addParameter(name='zmax', value=dBmax, format='int') | |
125 | #opObj11.addParameter(name='ymin', value=ymin, format='int') |
|
190 | #opObj11.addParameter(name='ymin', value=ymin, format='int') | |
126 | #opObj11.addParameter(name='ymax', value=ymax, format='int') |
|
191 | #opObj11.addParameter(name='ymax', value=ymax, format='int') | |
127 | opObj11.addParameter(name='showprofile', value='1', format='int') |
|
192 | opObj11.addParameter(name='showprofile', value='1', format='int') | |
128 | opObj11.addParameter(name='save', value=figpath, format='str') |
|
193 | opObj11.addParameter(name='save', value=figpath, format='str') | |
129 | opObj11.addParameter(name='save_period', value=10, format='int') |
|
194 | opObj11.addParameter(name='save_period', value=10, format='int') | |
130 |
|
195 | |||
131 |
|
||||
132 | #RTIPLOT |
|
196 | #RTIPLOT | |
133 |
|
197 | |||
134 |
opObj11 = procUnitConfObj |
|
198 | opObj11 = procUnitConfObjB.addOperation(name='RTIPlot', optype='external') | |
135 | opObj11.addParameter(name='id', value='2', format='int') |
|
199 | opObj11.addParameter(name='id', value='2', format='int') | |
136 | opObj11.addParameter(name='wintitle', value='RTIPlot', format='str') |
|
200 | opObj11.addParameter(name='wintitle', value='RTIPlot', format='str') | |
137 |
|
|
201 | opObj11.addParameter(name='zmin', value=dBmin, format='int') | |
138 |
|
|
202 | opObj11.addParameter(name='zmax', value=dBmax, format='int') | |
139 | #opObj11.addParameter(name='ymin', value=ymin, format='int') |
|
203 | #opObj11.addParameter(name='ymin', value=ymin, format='int') | |
140 | #opObj11.addParameter(name='ymax', value=ymax, format='int') |
|
204 | #opObj11.addParameter(name='ymax', value=ymax, format='int') | |
141 |
opObj11.addParameter(name='xmin', value= |
|
205 | #opObj11.addParameter(name='xmin', value=15, format='int') | |
142 |
opObj11.addParameter(name='xmax', value= |
|
206 | #opObj11.addParameter(name='xmax', value=16, format='int') | |
143 |
|
207 | |||
144 | opObj11.addParameter(name='showprofile', value='1', format='int') |
|
208 | opObj11.addParameter(name='showprofile', value='1', format='int') | |
145 | opObj11.addParameter(name='save', value=figpath, format='str') |
|
209 | opObj11.addParameter(name='save', value=figpath, format='str') | |
146 | opObj11.addParameter(name='save_period', value=10, format='int') |
|
210 | opObj11.addParameter(name='save_period', value=10, format='int') | |
147 |
|
211 | |||
148 |
|
212 | |||
149 |
# opObj11 = procUnitConfObj |
|
213 | # opObj11 = procUnitConfObjB.addOperation(name='CrossSpectraPlot', optype='other') | |
150 | # opObj11.addParameter(name='id', value='3', format='int') |
|
214 | # opObj11.addParameter(name='id', value='3', format='int') | |
151 | # opObj11.addParameter(name='wintitle', value='CrossSpectraPlot', format='str') |
|
215 | # opObj11.addParameter(name='wintitle', value='CrossSpectraPlot', format='str') | |
152 | # opObj11.addParameter(name='ymin', value=ymin, format='int') |
|
216 | # opObj11.addParameter(name='ymin', value=ymin, format='int') | |
@@ -158,7 +222,7 opObj11.addParameter(name='save_period', value=10, format='int') | |||||
158 | # opObj11.addParameter(name='save', value=0, format='bool') |
|
222 | # opObj11.addParameter(name='save', value=0, format='bool') | |
159 | # opObj11.addParameter(name='pairsList', value='(0,1)', format='pairsList') |
|
223 | # opObj11.addParameter(name='pairsList', value='(0,1)', format='pairsList') | |
160 | # # |
|
224 | # # | |
161 |
# opObj11 = procUnitConfObj |
|
225 | # opObj11 = procUnitConfObjB.addOperation(name='CoherenceMap', optype='other') | |
162 | # opObj11.addParameter(name='id', value='4', format='int') |
|
226 | # opObj11.addParameter(name='id', value='4', format='int') | |
163 | # opObj11.addParameter(name='wintitle', value='Coherence', format='str') |
|
227 | # opObj11.addParameter(name='wintitle', value='Coherence', format='str') | |
164 | # opObj11.addParameter(name='phase_cmap', value='jet', format='str') |
|
228 | # opObj11.addParameter(name='phase_cmap', value='jet', format='str') | |
@@ -168,16 +232,17 opObj11.addParameter(name='save_period', value=10, format='int') | |||||
168 | # opObj11.addParameter(name='save', value=0, format='bool') |
|
232 | # opObj11.addParameter(name='save', value=0, format='bool') | |
169 | # opObj11.addParameter(name='pairsList', value='(0,1)', format='pairsList') |
|
233 | # opObj11.addParameter(name='pairsList', value='(0,1)', format='pairsList') | |
170 | # |
|
234 | # | |
|
235 | ||||
|
236 | ''' | |||
171 |
|
|
237 | ####################################################################### | |
172 |
|
|
238 | ############### UNIDAD DE ESCRITURA ################################### | |
173 |
|
|
239 | ####################################################################### | |
174 |
#opObj11 = procUnitConfObj |
|
240 | #opObj11 = procUnitConfObjB.addOperation(name='SpectraWriter', optype='other') | |
175 |
|
|
241 | #opObj11.addParameter(name='path', value=wr_path) | |
176 |
|
|
242 | #opObj11.addParameter(name='blocksPerFile', value='50', format='int') | |
177 | print ("Escribiendo el archivo XML") |
|
243 | print ("Escribiendo el archivo XML") | |
178 | print ("Leyendo el archivo XML") |
|
244 | print ("Leyendo el archivo XML") | |
179 |
|
245 | ''' | ||
180 |
|
246 | |||
181 |
|
247 | |||
182 | controllerObj.start() |
|
248 | controllerObj.start() | |
183 |
|
@@ -2,6 +2,18 import os, sys | |||||
2 | import datetime |
|
2 | import datetime | |
3 | import time |
|
3 | import time | |
4 | from schainpy.controller import Project |
|
4 | from schainpy.controller import Project | |
|
5 | ''' | |||
|
6 | NOTA: | |||
|
7 | Este script de prueba. | |||
|
8 | - Unidad del lectura 'SimulatorReader'. | |||
|
9 | - Unidad de procesamiento VoltageProc | |||
|
10 | - Unidad de procesamiento SpectraProc (profileIndex no esta en metadata porque se queda en voltage.) | |||
|
11 | - Operacion removeDC. | |||
|
12 | - Unidad de procesamiento ParametersProc | |||
|
13 | - Operacion SpectralMoments | |||
|
14 | - Operacion SpectralMomentsPlot | |||
|
15 | - Unidad de escrituda 'HDFWriter'. | |||
|
16 | ''' | |||
5 |
|
17 | |||
6 | desc = "USRP_test" |
|
18 | desc = "USRP_test" | |
7 | filename = "USRP_processing.xml" |
|
19 | filename = "USRP_processing.xml" | |
@@ -10,8 +22,8 controllerObj.setup(id = '191', name='Test_USRP', description=desc) | |||||
10 |
|
22 | |||
11 | ############## USED TO PLOT IQ VOLTAGE, POWER AND SPECTRA ############# |
|
23 | ############## USED TO PLOT IQ VOLTAGE, POWER AND SPECTRA ############# | |
12 | ######PATH DE LECTURA, ESCRITURA, GRAFICOS Y ENVIO WEB################# |
|
24 | ######PATH DE LECTURA, ESCRITURA, GRAFICOS Y ENVIO WEB################# | |
13 |
path = '/home/ |
|
25 | path = '/home/soporte/Downloads/RAWDATA' | |
14 |
figpath = '/home/ |
|
26 | figpath = '/home/soporte/Downloads/IMAGE' | |
15 | ######################## UNIDAD DE LECTURA############################# |
|
27 | ######################## UNIDAD DE LECTURA############################# | |
16 | ''' |
|
28 | ''' | |
17 | readUnitConfObj = controllerObj.addReadUnit(datatype='VoltageReader', |
|
29 | readUnitConfObj = controllerObj.addReadUnit(datatype='VoltageReader', | |
@@ -63,20 +75,19 procUnitConfObjC= controllerObj.addProcUnit(datatype='ParametersProc',inputId=pr | |||||
63 | procUnitConfObjC.addOperation(name='SpectralMoments') |
|
75 | procUnitConfObjC.addOperation(name='SpectralMoments') | |
64 | #opObj11 = procUnitConfObjC.addOperation(name='PowerPlot') |
|
76 | #opObj11 = procUnitConfObjC.addOperation(name='PowerPlot') | |
65 |
|
77 | |||
66 | ''' |
|
78 | ||
67 | opObj11 = procUnitConfObjC.addOperation(name='SpectralMomentsPlot') |
|
79 | opObj11 = procUnitConfObjC.addOperation(name='SpectralMomentsPlot') | |
68 | #opObj11.addParameter(name='xmin', value=14) |
|
80 | #opObj11.addParameter(name='xmin', value=14) | |
69 | #opObj11.addParameter(name='xmax', value=15) |
|
81 | #opObj11.addParameter(name='xmax', value=15) | |
70 |
|
|
82 | opObj11.addParameter(name='save', value=figpath) | |
71 | opObj11.addParameter(name='showprofile', value=1) |
|
83 | opObj11.addParameter(name='showprofile', value=1) | |
72 |
|
|
84 | opObj11.addParameter(name='save_period', value=10) | |
73 | ''' |
|
|||
74 |
|
85 | |||
75 |
opObj10 = procUnitConfObjC.addOperation(name=' |
|
86 | opObj10 = procUnitConfObjC.addOperation(name='HDFWriter') | |
76 |
opObj10.addParameter(name='path',value= |
|
87 | opObj10.addParameter(name='path',value=path) | |
77 | #opObj10.addParameter(name='mode',value=0) |
|
88 | #opObj10.addParameter(name='mode',value=0) | |
78 | opObj10.addParameter(name='blocksPerFile',value='100',format='int') |
|
89 | opObj10.addParameter(name='blocksPerFile',value='100',format='int') | |
79 |
opObj10.addParameter(name='metadataList',value='utctimeInit, |
|
90 | opObj10.addParameter(name='metadataList',value='utctimeInit,heightList,nIncohInt,nCohInt,nProfiles,channelList',format='list')#profileIndex | |
80 |
opObj10.addParameter(name='dataList',value='data_ |
|
91 | opObj10.addParameter(name='dataList',value='data_pow,data_dop,utctime',format='list')#,format='list' | |
81 |
|
92 | |||
82 | controllerObj.start() |
|
93 | controllerObj.start() |
@@ -2,7 +2,7 import os,sys | |||||
2 | import datetime |
|
2 | import datetime | |
3 | import time |
|
3 | import time | |
4 | from schainpy.controller import Project |
|
4 | from schainpy.controller import Project | |
5 |
path = '/home/ |
|
5 | path = '/home/soporte/Downloads/RAWDATA_PP' | |
6 | figpath = path |
|
6 | figpath = path | |
7 | desc = "Simulator Test" |
|
7 | desc = "Simulator Test" | |
8 |
|
8 | |||
@@ -63,11 +63,11 opObj11.addParameter(name='removeDC', value=1, format='int') | |||||
63 | procUnitConfObjB= controllerObj.addProcUnit(datatype='ParametersProc',inputId=procUnitConfObjA.getId()) |
|
63 | procUnitConfObjB= controllerObj.addProcUnit(datatype='ParametersProc',inputId=procUnitConfObjA.getId()) | |
64 |
|
64 | |||
65 |
|
65 | |||
66 |
opObj10 = procUnitConfObjB.addOperation(name=' |
|
66 | opObj10 = procUnitConfObjB.addOperation(name='HDFWriter') | |
67 | opObj10.addParameter(name='path',value=figpath) |
|
67 | opObj10.addParameter(name='path',value=figpath) | |
68 | #opObj10.addParameter(name='mode',value=0) |
|
68 | #opObj10.addParameter(name='mode',value=0) | |
69 | opObj10.addParameter(name='blocksPerFile',value='100',format='int') |
|
69 | opObj10.addParameter(name='blocksPerFile',value='100',format='int') | |
70 |
opObj10.addParameter(name='metadataList',value='utctimeInit, |
|
70 | opObj10.addParameter(name='metadataList',value='utctimeInit,paramInterval,profileIndex,heightList,flagDataAsBlock',format='list') | |
71 | opObj10.addParameter(name='dataList',value='dataPP_POW,dataPP_DOP,dataPP_SNR,dataPP_WIDTH')#,format='list' |
|
71 | opObj10.addParameter(name='dataList',value='dataPP_POW,dataPP_DOP,dataPP_SNR,dataPP_WIDTH,utctime',format='list')#,format='list' | |
72 |
|
72 | |||
73 | controllerObj.start() |
|
73 | controllerObj.start() |
General Comments 0
You need to be logged in to leave comments.
Login now