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