@@ -0,0 +1,55 | |||||
|
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={'resolution':None,'vel_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} | |||
|
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 | vel_pedestal_e=float(linea) | |||
|
19 | self.dict['pos_ped_ele']=vel_pedestal_e | |||
|
20 | if i==10: | |||
|
21 | ipp = float(linea) | |||
|
22 | self.dict['ipp']= round(ipp,5) | |||
|
23 | if i==12: | |||
|
24 | n = float(linea) | |||
|
25 | self.dict['n']= n | |||
|
26 | if i==14: | |||
|
27 | len_pedestal= float(linea) | |||
|
28 | self.dict['len_ped']= len_pedestal | |||
|
29 | if i==16: | |||
|
30 | time_x_sample_ped=float(linea) | |||
|
31 | self.dict['t_s_ped']= time_x_sample_ped | |||
|
32 | if i==18: | |||
|
33 | time_x_file_ped = float(linea) | |||
|
34 | self.dict['t_f_ped']= time_x_file_ped | |||
|
35 | if i==20: | |||
|
36 | bloques_x_file_adq= float(linea) | |||
|
37 | self.dict['b_f_adq']=bloques_x_file_adq | |||
|
38 | if i==22: | |||
|
39 | time_x_file_adq = float(linea) | |||
|
40 | self.dict['t_f_adq'] = time_x_file_adq | |||
|
41 | if i==24: | |||
|
42 | mode= int(linea) | |||
|
43 | self.dict['mode'] = mode | |||
|
44 | #print(linea) | |||
|
45 | if not linea: | |||
|
46 | break | |||
|
47 | i+=1 | |||
|
48 | f.close() | |||
|
49 | def getDict(self): | |||
|
50 | return self.dict | |||
|
51 | ||||
|
52 | ||||
|
53 | filename= "/home/developer/Downloads/config_WR.txt" | |||
|
54 | dict= ReadfileWR(filename).getDict() | |||
|
55 | print(dict) |
@@ -390,6 +390,8 class WeatherPlot(Plot): | |||||
390 | return data, meta |
|
390 | return data, meta | |
391 |
|
391 | |||
392 | def plot(self): |
|
392 | def plot(self): | |
|
393 | thisDatetime = datetime.datetime.utcfromtimestamp(self.data.times[-1]) | |||
|
394 | print("thisDatetime",thisDatetime) | |||
393 | stoprange = float(33*1.5) |
|
395 | stoprange = float(33*1.5) | |
394 | rangestep = float(0.15) |
|
396 | rangestep = float(0.15) | |
395 | r = numpy.arange(0, stoprange, rangestep) |
|
397 | r = numpy.arange(0, stoprange, rangestep) | |
@@ -402,7 +404,7 class WeatherPlot(Plot): | |||||
402 | step = (360/(res*tmp_v.shape[0])) |
|
404 | step = (360/(res*tmp_v.shape[0])) | |
403 | mode = 1 |
|
405 | mode = 1 | |
404 | if mode==0: |
|
406 | if mode==0: | |
405 | print("self.ini",self.ini) |
|
407 | #print("self.ini",self.ini) | |
406 | val = numpy.mean(tmp_v[:,0]) |
|
408 | val = numpy.mean(tmp_v[:,0]) | |
407 | self.len_azi = len(tmp_z) |
|
409 | self.len_azi = len(tmp_z) | |
408 | ones = numpy.ones([(360-tmp_v.shape[0]),tmp_v.shape[1]])*val |
|
410 | ones = numpy.ones([(360-tmp_v.shape[0]),tmp_v.shape[1]])*val | |
@@ -419,7 +421,7 class WeatherPlot(Plot): | |||||
419 | self.ini = self.ini+1 |
|
421 | self.ini = self.ini+1 | |
420 |
|
422 | |||
421 | if mode==1: |
|
423 | if mode==1: | |
422 | print("self.ini",self.ini) |
|
424 | #print("self.ini",self.ini) | |
423 | if self.ini==0: |
|
425 | if self.ini==0: | |
424 | res = 1 |
|
426 | res = 1 | |
425 | step = (360/(res*tmp_v.shape[0])) |
|
427 | step = (360/(res*tmp_v.shape[0])) | |
@@ -487,8 +489,8 class WeatherPlot(Plot): | |||||
487 | if self.ini==step-1: |
|
489 | if self.ini==step-1: | |
488 | start= tmp_z[0] |
|
490 | start= tmp_z[0] | |
489 | end = tmp_z[-1] |
|
491 | end = tmp_z[-1] | |
490 | print("start","end",start,end) |
|
492 | #print("start","end",start,end) | |
491 | print(self.buffer_ini_azi[:80]) |
|
493 | ###print(self.buffer_ini_azi[:80]) | |
492 | self.ini = self.ini+1 |
|
494 | self.ini = self.ini+1 | |
493 |
|
495 | |||
494 | else: |
|
496 | else: | |
@@ -497,8 +499,8 class WeatherPlot(Plot): | |||||
497 |
|
499 | |||
498 | start= tmp_z[0] |
|
500 | start= tmp_z[0] | |
499 | end = tmp_z[-1] |
|
501 | end = tmp_z[-1] | |
500 | print("start","end",start,end) |
|
502 | #print("start","end",start,end) | |
501 | print(self.buffer_ini_azi[:120]) |
|
503 | ###print(self.buffer_ini_azi[:120]) | |
502 |
|
504 | |||
503 | if step>=2: |
|
505 | if step>=2: | |
504 | if self.flag<step-1: |
|
506 | if self.flag<step-1: | |
@@ -540,11 +542,11 class WeatherPlot(Plot): | |||||
540 | self.buf_azi[len(tmp_z)*(self.flag):len(tmp_z)*(self.flag+1)] = tmp_z |
|
542 | self.buf_azi[len(tmp_z)*(self.flag):len(tmp_z)*(self.flag+1)] = tmp_z | |
541 | self.buffer_ini=self.buf_tmp |
|
543 | self.buffer_ini=self.buf_tmp | |
542 | self.buffer_ini_azi = self.buf_azi |
|
544 | self.buffer_ini_azi = self.buf_azi | |
543 | print("--------salida------------") |
|
545 | ##print("--------salida------------") | |
544 | start= tmp_z[0] |
|
546 | start= tmp_z[0] | |
545 | end = tmp_z[-1] |
|
547 | end = tmp_z[-1] | |
546 | print("start","end",start,end) |
|
548 | ##print("start","end",start,end) | |
547 | print(self.buffer_ini_azi[:120]) |
|
549 | ##print(self.buffer_ini_azi[:120]) | |
548 | self.ini= self.ini+1 |
|
550 | self.ini= self.ini+1 | |
549 | self.flag = self.flag +1 |
|
551 | self.flag = self.flag +1 | |
550 | if self.flag==step: |
|
552 | if self.flag==step: | |
@@ -562,4 +564,4 class WeatherPlot(Plot): | |||||
562 | cbar = plt.gcf().colorbar(pm, pad=0.075) |
|
564 | cbar = plt.gcf().colorbar(pm, pad=0.075) | |
563 | caax.set_xlabel('x_range [km]') |
|
565 | caax.set_xlabel('x_range [km]') | |
564 | caax.set_ylabel('y_range [km]') |
|
566 | caax.set_ylabel('y_range [km]') | |
565 | plt.text(1.0, 1.05, 'azimuth', transform=caax.transAxes, va='bottom',ha='right') |
|
567 | plt.text(1.0, 1.05, 'azimuth '+str(thisDatetime), transform=caax.transAxes, va='bottom',ha='right') |
@@ -4122,12 +4122,13 class Block360(Operation): | |||||
4122 | self.index = 0 |
|
4122 | self.index = 0 | |
4123 |
|
4123 | |||
4124 |
|
4124 | |||
4125 | #print("ELVALOR DE n es:", n) |
|
4125 | ##print("ELVALOR DE n es:", n) | |
4126 | if n == None: |
|
4126 | if n == None: | |
4127 | raise ValueError("n should be specified.") |
|
4127 | raise ValueError("n should be specified.") | |
4128 |
|
4128 | |||
4129 | if n != None: |
|
4129 | if n != None: | |
4130 |
if n< |
|
4130 | if n<1: | |
|
4131 | print("n should be greater than 2") | |||
4131 | raise ValueError("n should be greater than 2") |
|
4132 | raise ValueError("n should be greater than 2") | |
4132 |
|
4133 | |||
4133 | self.n = n |
|
4134 | self.n = n |
@@ -25,12 +25,13 readUnitConfObj = controllerObj.addReadUnit(datatype='HDFReader', | |||||
25 | walk=0)#1 |
|
25 | walk=0)#1 | |
26 |
|
26 | |||
27 | procUnitConfObjA = controllerObj.addProcUnit(datatype='ParametersProc',inputId=readUnitConfObj.getId()) |
|
27 | procUnitConfObjA = controllerObj.addProcUnit(datatype='ParametersProc',inputId=readUnitConfObj.getId()) | |
|
28 | ||||
28 | opObj11 = procUnitConfObjA.addOperation(name='Block360') |
|
29 | opObj11 = procUnitConfObjA.addOperation(name='Block360') | |
29 |
opObj11.addParameter(name='n', value=' |
|
30 | opObj11.addParameter(name='n', value='40', format='int') | |
30 |
|
31 | |||
31 | opObj11= procUnitConfObjA.addOperation(name='WeatherPlot',optype='other') |
|
32 | opObj11= procUnitConfObjA.addOperation(name='WeatherPlot',optype='other') | |
32 |
|
|
33 | opObj11.addParameter(name='save', value=figpath) | |
33 |
|
|
34 | opObj11.addParameter(name='save_period', value=1) | |
34 | #opObj11 = procUnitConfObjA.addOperation(name='PowerPlot', optype='other')#PulsepairPowerPlot |
|
35 | #opObj11 = procUnitConfObjA.addOperation(name='PowerPlot', optype='other')#PulsepairPowerPlot | |
35 | #opObj11 = procUnitConfObjA.addOperation(name='PPSignalPlot', optype='other') |
|
36 | #opObj11 = procUnitConfObjA.addOperation(name='PPSignalPlot', optype='other') | |
36 |
|
37 |
@@ -2,6 +2,19 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 | #************************************************************************* | |||
|
7 | #**************************LECTURA config_WR.txt************************** | |||
|
8 | #************************************************************************* | |||
|
9 | from readFileconfig import ReadfileWR | |||
|
10 | filename= "/home/developer/Downloads/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 | #************************************************************************* | |||
5 | path = '/home/developer/Downloads/HDF5_TESTPP2V3' |
|
18 | path = '/home/developer/Downloads/HDF5_TESTPP2V3' | |
6 | figpath = path |
|
19 | figpath = path | |
7 | desc = "Simulator Test" |
|
20 | desc = "Simulator Test" | |
@@ -9,7 +22,7 controllerObj = Project() | |||||
9 | controllerObj.setup(id='10',name='Test Simulator',description=desc) |
|
22 | controllerObj.setup(id='10',name='Test Simulator',description=desc) | |
10 | readUnitConfObj = controllerObj.addReadUnit(datatype='SimulatorReader', |
|
23 | readUnitConfObj = controllerObj.addReadUnit(datatype='SimulatorReader', | |
11 | frequency=9.345e9, |
|
24 | frequency=9.345e9, | |
12 |
FixRCP_IPP= |
|
25 | FixRCP_IPP= FixRCP_IPP, | |
13 | Tau_0 = 30, |
|
26 | Tau_0 = 30, | |
14 | AcqH0_0=0, |
|
27 | AcqH0_0=0, | |
15 | samples=330, |
|
28 | samples=330, | |
@@ -22,17 +35,21 readUnitConfObj = controllerObj.addReadUnit(datatype='SimulatorReader', | |||||
22 | delay=0, |
|
35 | delay=0, | |
23 | online=0, |
|
36 | online=0, | |
24 | walk=0, |
|
37 | walk=0, | |
25 |
profilesPerBlock= |
|
38 | profilesPerBlock=profilesPerBlock, | |
26 |
dataBlocksPerFile= |
|
39 | dataBlocksPerFile=dataBlocksPerFile)#,#nTotalReadFiles=2) | |
27 | #opObj11 = readUnitConfObj.addOperation(name='printInfo') |
|
40 | #opObj11 = readUnitConfObj.addOperation(name='printInfo') | |
28 | procUnitConfObjA = controllerObj.addProcUnit(datatype='VoltageProc', inputId=readUnitConfObj.getId()) |
|
41 | procUnitConfObjA = controllerObj.addProcUnit(datatype='VoltageProc', inputId=readUnitConfObj.getId()) | |
|
42 | ||||
29 | opObj11 = procUnitConfObjA.addOperation(name='PulsePair') |
|
43 | opObj11 = procUnitConfObjA.addOperation(name='PulsePair') | |
30 |
opObj11.addParameter(name='n', value= |
|
44 | opObj11.addParameter(name='n', value=pulsepair, format='int')#10 | |
|
45 | ||||
31 | procUnitConfObjB= controllerObj.addProcUnit(datatype='ParametersProc',inputId=procUnitConfObjA.getId()) |
|
46 | procUnitConfObjB= controllerObj.addProcUnit(datatype='ParametersProc',inputId=procUnitConfObjA.getId()) | |
|
47 | ||||
32 | opObj10 = procUnitConfObjB.addOperation(name='HDFWriter') |
|
48 | opObj10 = procUnitConfObjB.addOperation(name='HDFWriter') | |
33 | opObj10.addParameter(name='path',value=figpath) |
|
49 | opObj10.addParameter(name='path',value=figpath) | |
34 | #opObj10.addParameter(name='mode',value=2) |
|
50 | #opObj10.addParameter(name='mode',value=2) | |
35 | opObj10.addParameter(name='blocksPerFile',value='100',format='int') |
|
51 | opObj10.addParameter(name='blocksPerFile',value='100',format='int') | |
36 | opObj10.addParameter(name='metadataList',value='utctimeInit,paramInterval,heightList,profileIndex,flagDataAsBlock',format='list') |
|
52 | opObj10.addParameter(name='metadataList',value='utctimeInit,paramInterval,heightList,profileIndex,flagDataAsBlock',format='list') | |
37 | opObj10.addParameter(name='dataList',value='dataPP_POW,dataPP_DOP,utctime',format='list')#,format='list' |
|
53 | opObj10.addParameter(name='dataList',value='dataPP_POW,dataPP_DOP,utctime',format='list')#,format='list' | |
|
54 | ||||
38 | controllerObj.start() |
|
55 | controllerObj.start() |
@@ -2,6 +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 | ||||
5 | path = '/home/alex/Downloads/NEW_WR2/spc16removeDC' |
|
6 | path = '/home/alex/Downloads/NEW_WR2/spc16removeDC' | |
6 | figpath = path |
|
7 | figpath = path | |
7 | desc = "Simulator Test" |
|
8 | desc = "Simulator Test" |
@@ -54,23 +54,46 def getDatavaluefromDirFilename(path,file,value): | |||||
54 | fp.close() |
|
54 | fp.close() | |
55 | return array |
|
55 | return array | |
56 |
|
56 | |||
|
57 | opt = input ("Ingresa Modo de integracion: ") | |||
|
58 | ||||
|
59 | if opt==1: | |||
|
60 | #·········· Velocidad de Pedestal················· | |||
|
61 | w = input ("Ingresa velocidad de Pedestal: ") | |||
|
62 | w = 4 | |||
|
63 | w = float(w) | |||
|
64 | #·········· Resolucion minimo en grados··········· | |||
|
65 | alfa = input ("Ingresa resolucion minima en grados: ") | |||
|
66 | alfa = 1 | |||
|
67 | alfa = float(alfa) | |||
|
68 | #·········· IPP del Experimento ·················· | |||
|
69 | IPP = input ("Ingresa el IPP del experimento: ") | |||
|
70 | IPP = 0.0004 | |||
|
71 | IPP = float(IPP) | |||
|
72 | #·········· MODE ·················· | |||
|
73 | mode = input ("Ingresa el MODO del experimento Time(1) or F(0): ") | |||
|
74 | mode = 1 | |||
|
75 | mode = int(mode) | |||
|
76 | ||||
|
77 | time_Interval_p=0.01 | |||
|
78 | n_perfiles_p = 100 | |||
|
79 | blocksPerFile = 100 | |||
|
80 | tiempo_file_1_adq=25 | |||
|
81 | tiempo_file_1_ped=1 | |||
57 |
|
82 | |||
58 | #·········· Velocidad de Pedestal················· |
|
83 | else: | |
59 | w = input ("Ingresa velocidad de Pedestal: ") |
|
84 | from readFileconfig import ReadfileWR | |
60 | w = 4 |
|
85 | filename= "/home/developer/Downloads/config_WR.txt" | |
61 | w = float(w) |
|
86 | dict= ReadfileWR(filename).getDict() | |
62 | #·········· Resolucion minimo en grados··········· |
|
87 | mode = dict['mode'] | |
63 | alfa = input ("Ingresa resolucion minima en grados: ") |
|
88 | w = dict['vel_ped_azi'] | |
64 | alfa = 1 |
|
89 | alfa= dict['resolution'] | |
65 | alfa = float(alfa) |
|
90 | IPP = dict['ipp']*1e-6 | |
66 | #·········· IPP del Experimento ·················· |
|
91 | time_Interval_p = dict['t_s_ped'] | |
67 | IPP = input ("Ingresa el IPP del experimento: ") |
|
92 | n_perfiles_p = dict['len_ped'] | |
68 | IPP = 0.0004 |
|
93 | blocksPerFile = int(dict['b_f_adq']) | |
69 | IPP = float(IPP) |
|
94 | ||
70 | #·········· MODE ·················· |
|
95 | tiempo_file_1_adq= dict['t_f_adq'] | |
71 | mode = input ("Ingresa el MODO del experimento T or F: ") |
|
96 | tiempo_file_1_ped= dict['t_f_ped'] | |
72 | mode = "T" |
|
|||
73 | mode = str(mode) |
|
|||
74 |
|
97 | |||
75 | #·········· Tiempo en generar la resolucion min··· |
|
98 | #·········· Tiempo en generar la resolucion min··· | |
76 | #············ MCU ·· var_ang = w * (var_tiempo)··· |
|
99 | #············ MCU ·· var_ang = w * (var_tiempo)··· | |
@@ -82,7 +105,7 num_perfiles = int(var_tiempo/IPP) | |||||
82 | #··········DATA PEDESTAL·························· |
|
105 | #··········DATA PEDESTAL·························· | |
83 | dir_pedestal = "/home/developer/Downloads/Pedestal/P2021093" |
|
106 | dir_pedestal = "/home/developer/Downloads/Pedestal/P2021093" | |
84 | #·········· DATA ADQ······························ |
|
107 | #·········· DATA ADQ······························ | |
85 |
if mode== |
|
108 | if mode==1: | |
86 | dir_adq = "/home/developer/Downloads/HDF5_TESTPP2V3/d2021093" # Time domain |
|
109 | dir_adq = "/home/developer/Downloads/HDF5_TESTPP2V3/d2021093" # Time domain | |
87 | else: |
|
110 | else: | |
88 | dir_adq = "/home/developer/Downloads/hdf5_test/d2021053" # Frequency domain |
|
111 | dir_adq = "/home/developer/Downloads/hdf5_test/d2021053" # Frequency domain | |
@@ -109,8 +132,8 print("utc_adq :",utc_adq) | |||||
109 | #sys.exit(0) |
|
132 | #sys.exit(0) | |
110 |
|
133 | |||
111 | #·············Relacion: utc_adq (+/-) var_tiempo*nro_file= utc_pedestal |
|
134 | #·············Relacion: utc_adq (+/-) var_tiempo*nro_file= utc_pedestal | |
112 | time_Interval_p = 0.01 |
|
135 | time_Interval_p = time_Interval_p#0.01 | |
113 |
n_perfiles_p = |
|
136 | n_perfiles_p = n_perfiles_p #100 muestras por achivo del pedestal | |
114 |
|
137 | |||
115 |
|
138 | |||
116 | if utc_adq>utc_pedestal: |
|
139 | if utc_adq>utc_pedestal: | |
@@ -144,14 +167,16 list_adq = getfirstFilefromPath(path=dir_adq ,meta="D",ext=".hdf5") | |||||
144 |
|
167 | |||
145 | nro_file = nro_file #10 |
|
168 | nro_file = nro_file #10 | |
146 | nro_key_perfil = nro_key_p |
|
169 | nro_key_perfil = nro_key_p | |
147 | blocksPerFile = 100##### aqui se cambia dependiendo de los blqoues por achivo en adq |
|
170 | blocksPerFile = blocksPerFile#100##### aqui se cambia dependiendo de los blqoues por achivo en adq | |
148 | wr_path = "/home/developer/Downloads/HDF5_WR/" |
|
171 | wr_path = "/home/developer/Downloads/HDF5_WR/" | |
149 | # Lectura de archivos de adquisicion para adicion de azimuth |
|
172 | # Lectura de archivos de adquisicion para adicion de azimuth | |
150 | # factor de archivos |
|
173 | # factor de archivos | |
151 | #f_a_p = tiempo_file_1_adq/tiempo_file_1_ped=25/1 = 25 |
|
174 | #f_a_p = tiempo_file_1_adq/tiempo_file_1_ped=25/1 = 25 | |
152 |
tiempo_file_1_adq= |
|
175 | tiempo_file_1_adq = tiempo_file_1_adq | |
153 | tiempo_file_1_ped=1 |
|
176 | tiempo_file_1_ped = tiempo_file_1_ped | |
|
177 | ||||
154 | f_a_p= int(tiempo_file_1_adq/tiempo_file_1_ped) |
|
178 | f_a_p= int(tiempo_file_1_adq/tiempo_file_1_ped) | |
|
179 | ||||
155 | for thisFile in range(len(list_adq)): |
|
180 | for thisFile in range(len(list_adq)): | |
156 | print("thisFileAdq",thisFile) |
|
181 | print("thisFileAdq",thisFile) | |
157 | angulo_adq = numpy.zeros(blocksPerFile) |
|
182 | angulo_adq = numpy.zeros(blocksPerFile) |
General Comments 0
You need to be logged in to leave comments.
Login now