##// END OF EJS Templates
last 30-16:19
avaldezp -
r1405:49f004b59e80
parent child
Show More
@@ -0,0 +1,41
1 # Ing. AVP
2 # 01/11/2021
3 # ARCHIVO DE LECTURA
4 import os, sys
5 import datetime
6 import time
7 from schainpy.controller import Project
8 print("----[Setup]-RadarMeteorologico--------")
9 Vel = 6
10 modo_proc = 1
11 #-----------PATH DE DATOS-----------------------#
12 path = "/DATA_RM/10"
13 path_ped = "/DATA_RM/TEST_PEDESTAL/P20211111-173856"
14 print("----[OPCIONES]------------------------")
15 op_plot = 0
16 op_integration = 0
17 op_save = 0
18 op_plot_spec = 0
19
20 ########################SIGNAL CHAIN ##################################
21 desc = "USRP_test"
22 filename = "USRP_processing.xml"
23 controllerObj = Project()
24 controllerObj.setup(id = '191', name='Test_USRP', description=desc)
25 ######################## UNIDAD DE LECTURA#############################
26 readUnitConfObj = controllerObj.addReadUnit(datatype='DigitalRFReader',
27 path=path,
28 startDate="2021/11/11",#today,
29 endDate="2021/12/30",#today,
30 startTime='17:39:25',
31 endTime='23:59:59',
32 delay=0,
33 #set=0,
34 online=0,
35 walk=1,
36 ippKm = 60)
37
38 opObj11 = readUnitConfObj.addOperation(name='printInfo')
39
40 procUnitConfObjA = controllerObj.addProcUnit(datatype='VoltageProc',inputId=readUnitConfObj.getId())
41 controllerObj.start()
@@ -0,0 +1,72
1 import os, sys
2 import datetime
3 import time
4 from schainpy.controller import Project
5
6 desc = "USRP_test"
7 filename = "USRP_processing.xml"
8 controllerObj = Project()
9 controllerObj.setup(id = '191', name='Test_USRP', description=desc)
10
11 ############## USED TO PLOT IQ VOLTAGE, POWER AND SPECTRA #############
12 ######PATH DE LECTURA, ESCRITURA, GRAFICOS Y ENVIO WEB#################
13 path = '/home/alex/Downloads/test_rawdata'
14 path = '/DATA_RM/WR_POT_09_2'
15 figpath = '/home/alex/Downloads'
16 figpath_pp = "/home/soporte/Pictures/TEST_POT"
17 ################# RANGO DE PLOTEO######################################
18 dBmin = '30'
19 dBmax = '60'
20 xmin = '0'
21 xmax ='24'
22 ymin = '0'
23 ymax = '600'
24 ########################FECHA##########################################
25 str = datetime.date.today()
26 today = str.strftime("%Y/%m/%d")
27 str2 = str - datetime.timedelta(days=1)
28 yesterday = str2.strftime("%Y/%m/%d")
29 ######################## UNIDAD DE LECTURA#############################
30 readUnitConfObj = controllerObj.addReadUnit(datatype='DigitalRFReader',
31 path=path,
32 startDate="2021/01/01", #"2020/01/01",#today,
33 endDate= "2021/12/01", #"2020/12/30",#today,
34 startTime='00:00:00',
35 endTime='23:59:59',
36 delay=0,
37 #set=0,
38 online=0,
39 walk =1,
40 ippKm = 60 )
41
42 opObj11 = readUnitConfObj.addOperation(name='printInfo')
43 #opObj11 = readUnitConfObj.addOperation(name='printNumberOfBlock')
44 #######################################################################
45 ################ OPERACIONES DOMINIO DEL TIEMPO########################
46 #######################################################################
47
48 procUnitConfObjA = controllerObj.addProcUnit(datatype='VoltageProc', inputId=readUnitConfObj.getId())
49 '''
50 opObj11 = procUnitConfObjA.addOperation(name='PulsePairVoltage', optype='other')
51 opObj11.addParameter(name='n', value='256', format='int')
52 opObj11.addParameter(name='removeDC', value=1, format='int')
53 '''
54
55 _type="iq"
56 opObj10 = procUnitConfObjA.addOperation(name='ScopePlot', optype='external')
57 #opObj10.addParameter(name='id', value='12')
58 opObj10.addParameter(name='wintitle', value=_type )
59 opObj10.addParameter(name='type', value=_type)
60
61
62 '''
63 type="WeatherPower"
64 opObj10 = procUnitConfObjA.addOperation(name='PulsepairPowerPlot', optype='external')
65 #opObj10.addParameter(name='id', value='12')
66 opObj10.addParameter(name='wintitle', value=type )
67
68 opObj11 = procUnitConfObjA.addOperation(name='PulsepairVelocityPlot', optype='other')
69 opObj11.addParameter(name='xmax', value=8)
70 '''
71
72 controllerObj.start()
@@ -0,0 +1,118
1 # Ing. AVP
2 # 01/11/2021
3 # ARCHIVO DE LECTURA
4 import os, sys
5 import datetime
6 import time
7 from schainpy.controller import Project
8 print("----[Setup]-RadarMeteorologico--------")
9 Vel = 10
10 modo_proc = 0 # 0 Pulse Pair 1 Spectros
11 #-----------PATH DE DATOS-----------------------#
12 #------------VERIFICAR SIEMPRE LA FECHA DE LA DATA
13 path = "/DATA_RM/10"
14 path_ped = "/DATA_RM/TEST_PEDESTAL/P20211110-171003"
15 figpath_pp = "/home/soporte/Pictures/TEST_POT"
16 figpath_ppi_pp = "/home/soporte/Pictures/ppi_PP_30DIC_4"
17 #-------------------------------------------------------------------
18 print("----[OPCIONES]------------------------")
19 op_plot = 0
20 op_integration = 1
21 op_save = 1
22 op_plot_spec = 0
23 #-------------------------------------
24 ################# RANGO DE PLOTEO######################################
25 dBmin = '1'
26 dBmax = '85'
27 xmin = '17.1'
28 xmax = '17.25'
29 ymin = '0'
30 ymax = '600'
31 #-------------------NRO Perfiles PROCESAMIENTO --------------------
32 V=Vel
33 IPP=400*1e-6
34 n= int(1/(V*IPP))
35 print("* n - NRO Perfiles Proc:", n )
36 time.sleep(3)
37
38 #------------------------SIGNAL CHAIN ------------------------------
39 desc = "USRP_test"
40 filename = "USRP_processing.xml"
41 controllerObj = Project()
42 controllerObj.setup(id = '191', name='Test_USRP', description=desc)
43 ######################## UNIDAD DE LECTURA#############################
44 readUnitConfObj = controllerObj.addReadUnit(datatype = 'DigitalRFReader',
45 path = path,
46 startDate= "2021/11/10",#today,
47 endDate = "2021/12/30",#today,
48 startTime= '00:00:25',
49 endTime = '23:59:59',
50 delay = 0,
51 online = 0,
52 walk = 1,
53 ippKm = 60)
54
55 opObj11 = readUnitConfObj.addOperation(name='printInfo')
56 procUnitConfObjA = controllerObj.addProcUnit(datatype='VoltageProc',inputId=readUnitConfObj.getId())
57
58 opObj11 = procUnitConfObjA.addOperation(name='selectHeights')
59 opObj11.addParameter(name='minIndex', value='1', format='int')
60 # opObj11.addParameter(name='maxIndex', value='10000', format='int')
61 opObj11.addParameter(name='maxIndex', value='400', format='int')
62
63 if modo_proc ==0:
64 #----------------------------------------PULSE PAIR --------------------------------------------------#
65 opObj11 = procUnitConfObjA.addOperation(name='PulsePair', optype='other')
66 opObj11.addParameter(name='n', value=int(n), format='int')#10 VOY A USAR 250 DADO QUE LA VELOCIDAD ES 10 GRADOS
67 #opObj11.addParameter(name='removeDC', value=1, format='int')
68 #------------------------ METODO Parametros -----------------------------------------------------------
69 procUnitConfObjB= controllerObj.addProcUnit(datatype='ParametersProc',inputId=procUnitConfObjA.getId())
70 if op_plot==1:
71 opObj11 = procUnitConfObjB.addOperation(name='GenericRTIPlot',optype='external')
72 opObj11.addParameter(name='attr_data', value='dataPP_POW')
73 opObj11.addParameter(name='colormap', value='jet')
74 #opObj11.addParameter(name='xmin', value=xmin)
75 #opObj11.addParameter(name='xmax', value=xmax)
76 opObj11.addParameter(name='zmin', value=dBmin)
77 opObj11.addParameter(name='zmax', value=dBmax)
78 opObj11.addParameter(name='save', value=figpath_pp)
79 opObj11.addParameter(name='showprofile', value=0)
80 opObj11.addParameter(name='save_period', value=50)
81
82 ####################### METODO ESCRITURA #######################################################################
83
84 if op_integration==1:
85 V=V
86 blocksPerfile=100
87 print("* Velocidad del Pedestal:",V)
88 tmp_blocksPerfile = 100
89 f_a_p= int(tmp_blocksPerfile/V)
90
91 opObj11 = procUnitConfObjB.addOperation(name='PedestalInformation')
92 opObj11.addParameter(name='path_ped', value=path_ped)
93 #opObj11.addParameter(name='path_adq', value=path_adq)
94 opObj11.addParameter(name='t_Interval_p', value='0.01', format='float')
95 opObj11.addParameter(name='blocksPerfile', value=blocksPerfile, format='int')
96 opObj11.addParameter(name='n_Muestras_p', value='100', format='float')
97 opObj11.addParameter(name='f_a_p', value=f_a_p, format='int')
98 opObj11.addParameter(name='online', value='0', format='int')
99
100 opObj11 = procUnitConfObjB.addOperation(name='Block360')
101 opObj11.addParameter(name='n', value='10', format='int')
102 opObj11.addParameter(name='mode', value=modo_proc, format='int')
103
104 # este bloque funciona bien con divisores de 360 no olvidar 0 10 20 30 40 60 90 120 180
105
106 opObj11= procUnitConfObjB.addOperation(name='WeatherPlot',optype='other')
107 opObj11.addParameter(name='save', value=figpath_ppi_pp)
108 opObj11.addParameter(name='save_period', value=1)
109
110 if op_save==1:
111 opObj10 = procUnitConfObjB.addOperation(name='HDFWriter')
112 opObj10.addParameter(name='path',value=figpath_ppi_pp)
113 #opObj10.addParameter(name='mode',value=0)
114 opObj10.addParameter(name='blocksPerFile',value='100',format='int')
115 opObj10.addParameter(name='metadataList',value='utctimeInit,timeZone,paramInterval,profileIndex,channelList,heightList,flagDataAsBlock',format='list')
116 opObj10.addParameter(name='dataList',value='dataPP_POW,dataPP_DOP,azimuth,utctime',format='list')#,format='list'
117
118 controllerObj.start()
@@ -0,0 +1,14
1 import numpy
2 a= numpy.array([0,1,2,3,4,5,10,11,12,18,19,20,21,22,23,24,25,26,27,28])
3 print(a)
4 list=[]
5 list2=[]
6 for i in reversed(range(1,len(a))):
7 dif=int(a[i])-int(a[i-1])
8 print(i,a[i],dif )
9 if dif>1:
10 list.append(i-1)
11 list2.append(dif-1)
12 print("result")
13 print(list)
14 print(list2)
@@ -0,0 +1,147
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 = '/DATA_RM/TEST_INTEGRACION/ADQ_OFFLINE/'
29 # ULTIMO TEST 22 DE SEPTIEMBRE
30 path = '/DATA_RM/USRP_22'
31 #path_pp = '/DATA_RM/TEST_HDF5'
32 # UTIMO TEST 22 DE SEPTIEMBRE
33 path_pp = '/DATA_RM/TEST_HDF5_PP_22'
34 ######################################################
35 ##### OJO TENER EN CUENTA EL n= para el Pulse Pair ###
36 ######################################################
37 ######## BUSCAMOS EL numero de IPP equivalente 1°#####
38 ######## Sea V la velocidad del Pedestal en °/seg#####
39 ######## 1° sera Recorrido en un tiempo de 1/V ######
40 ######## IPP del Radar 400 useg --> 60 Km ############
41 ######## n = 1/(V*IPP) , NUMERO DE IPP #############
42 ######## n = 1/(V*IPP) #############################
43 V=2
44 IPP=400*1e-6
45 n= 1/(V*IPP)
46 print("n numero de Perfiles a procesar con Pulse Pair: ", n)
47
48
49
50
51 figpath = '/home/soporte/Pictures/TEST_INTEGRACION_IMG'
52 #remotefolder = "/home/wmaster/graficos"
53 #######################################################################
54 ################# RANGO DE PLOTEO######################################
55 #######################################################################
56 dBmin = '-5'
57 dBmax = '20'
58 xmin = '0'
59 xmax ='24'
60 ymin = '0'
61 ymax = '600'
62 #######################################################################
63 ########################FECHA##########################################
64 #######################################################################
65 str = datetime.date.today()
66 today = str.strftime("%Y/%m/%d")
67 str2 = str - datetime.timedelta(days=1)
68 yesterday = str2.strftime("%Y/%m/%d")
69 #######################################################################
70 ######################## UNIDAD DE LECTURA#############################
71 #######################################################################
72 readUnitConfObj = controllerObj.addReadUnit(datatype='DigitalRFReader',
73 path=path,
74 startDate="2021/01/01",#today,
75 endDate="2021/12/30",#today,
76 startTime='00:00:00',
77 endTime='23:59:59',
78 delay=0,
79 #set=0,
80 online=0,
81 walk=1,
82 ippKm = 60)
83
84 opObj11 = readUnitConfObj.addOperation(name='printInfo')
85 #opObj11 = readUnitConfObj.addOperation(name='printNumberOfBlock')
86 #######################################################################
87 ################ OPERACIONES DOMINIO DEL TIEMPO########################
88 #######################################################################
89
90 procUnitConfObjA = controllerObj.addProcUnit(datatype='VoltageProc', inputId=readUnitConfObj.getId())
91
92 #
93 # 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,'+\
94 # '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'
95
96 #opObj11 = procUnitConfObjA.addOperation(name='setRadarFrequency')
97 #opObj11.addParameter(name='frequency', value='70312500')
98 opObj11 = procUnitConfObjA.addOperation(name='PulsePair', optype='other')
99 opObj11.addParameter(name='n', value=int(n), format='int')#10 VOY A USAR 250 DADO QUE LA VELOCIDAD ES 10 GRADOS
100 opObj11.addParameter(name='removeDC', value=1, format='int')
101 # Ploteo TEST
102 '''
103 opObj11 = procUnitConfObjA.addOperation(name='PulsepairPowerPlot', optype='other')
104 opObj11 = procUnitConfObjA.addOperation(name='PulsepairSignalPlot', optype='other')
105 opObj11 = procUnitConfObjA.addOperation(name='PulsepairVelocityPlot', optype='other')
106 #opObj11.addParameter(name='xmax', value=8)
107 opObj11 = procUnitConfObjA.addOperation(name='PulsepairSpecwidthPlot', optype='other')
108 '''
109 # OJO SCOPE
110 #opObj10 = procUnitConfObjA.addOperation(name='ScopePlot', optype='external')
111 #opObj10.addParameter(name='id', value='10', format='int')
112 ##opObj10.addParameter(name='xmin', value='0', format='int')
113 ##opObj10.addParameter(name='xmax', value='50', format='int')
114 #opObj10.addParameter(name='type', value='iq')
115 ##opObj10.addParameter(name='ymin', value='-5000', format='int')
116 ##opObj10.addParameter(name='ymax', value='8500', format='int')
117 #opObj11.addParameter(name='save', value=figpath, format='str')
118 #opObj11.addParameter(name='save_period', value=10, format='int')
119
120 #opObj10 = procUnitConfObjA.addOperation(name='setH0')
121 #opObj10.addParameter(name='h0', value='-5000', format='float')
122
123 #opObj11 = procUnitConfObjA.addOperation(name='filterByHeights')
124 #opObj11.addParameter(name='window', value='1', format='int')
125
126 #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'
127 #opObj11 = procUnitConfObjSousy.addOperation(name='Decoder', optype='other')
128 #opObj11.addParameter(name='code', value=codigo, formatyesterday='floatlist')
129 #opObj11.addParameter(name='nCode', value='1', format='int')
130 #opObj11.addParameter(name='nBaud', value='28', format='int')
131
132 #opObj11 = procUnitConfObjA.addOperation(name='CohInt', optype='other')
133 #opObj11.addParameter(name='n', value='100', format='int')
134
135 #######################################################################
136 ########## OPERACIONES ParametersProc########################
137 #######################################################################
138
139 procUnitConfObjB= controllerObj.addProcUnit(datatype='ParametersProc',inputId=procUnitConfObjA.getId())
140 opObj10 = procUnitConfObjB.addOperation(name='HDFWriter')
141 opObj10.addParameter(name='path',value=path_pp)
142 #opObj10.addParameter(name='mode',value=0)
143 opObj10.addParameter(name='blocksPerFile',value='100',format='int')
144 opObj10.addParameter(name='metadataList',value='utctimeInit,timeZone,paramInterval,profileIndex,channelList,heightList,flagDataAsBlock',format='list')
145 opObj10.addParameter(name='dataList',value='dataPP_POW,dataPP_DOP,utctime',format='list')#,format='list'
146
147 controllerObj.start()
@@ -0,0 +1,115
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 = '/DATA_RM/TEST_INTEGRACION/ADQ_OFFLINE/'
29 # ULTIMO TEST 22 DE SEPTIEMBRE
30 path = '/DATA_RM/USRP_22'
31 #path_pp = '/DATA_RM/TEST_HDF5'
32 # UTIMO TEST 22 DE SEPTIEMBRE
33 path_pp = '/DATA_RM/TEST_HDF5_PP_22'
34 ######################################################
35 ##### OJO TENER EN CUENTA EL n= para el Pulse Pair ###
36 ######################################################
37 ######## BUSCAMOS EL numero de IPP equivalente 1°#####
38 ######## Sea V la velocidad del Pedestal en °/seg#####
39 ######## 1° sera Recorrido en un tiempo de 1/V ######
40 ######## IPP del Radar 400 useg --> 60 Km ############
41 ######## n = 1/(V*IPP) , NUMERO DE IPP #############
42 ######## n = 1/(V*IPP) #############################
43 V=2
44 IPP=400*1e-6
45 n= 1/(V*IPP)
46 print("n numero de Perfiles a procesar con Pulse Pair: ", n)
47
48
49
50
51 figpath = '/home/soporte/Pictures/TEST_INTEGRACION_IMG'
52 #remotefolder = "/home/wmaster/graficos"
53 #######################################################################
54 ################# RANGO DE PLOTEO######################################
55 #######################################################################
56 dBmin = '-5'
57 dBmax = '20'
58 xmin = '0'
59 xmax ='24'
60 ymin = '0'
61 ymax = '600'
62 #######################################################################
63 ########################FECHA##########################################
64 #######################################################################
65 str = datetime.date.today()
66 today = str.strftime("%Y/%m/%d")
67 str2 = str - datetime.timedelta(days=1)
68 yesterday = str2.strftime("%Y/%m/%d")
69 #######################################################################
70 ######################## UNIDAD DE LECTURA#############################
71 #######################################################################
72 readUnitConfObj = controllerObj.addReadUnit(datatype='DigitalRFReader',
73 path=path,
74 startDate="2021/01/01",#today,
75 endDate="2021/12/30",#today,
76 startTime='00:00:00',
77 endTime='23:59:59',
78 delay=0,
79 #set=0,
80 online=0,
81 walk=1,
82 ippKm = 60)
83
84 opObj11 = readUnitConfObj.addOperation(name='printInfo')
85 #opObj11 = readUnitConfObj.addOperation(name='printNumberOfBlock')
86 #######################################################################
87 ################ OPERACIONES DOMINIO DEL TIEMPO########################
88 #######################################################################
89
90 procUnitConfObjA = controllerObj.addProcUnit(datatype='VoltageProc', inputId=readUnitConfObj.getId())
91
92 #
93 # 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,'+\
94 # '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'
95
96 #opObj11 = procUnitConfObjA.addOperation(name='setRadarFrequency')
97 #opObj11.addParameter(name='frequency', value='70312500')
98 opObj11 = procUnitConfObjA.addOperation(name='PulsePair', optype='other')
99 opObj11.addParameter(name='n', value=int(n), format='int')#10 VOY A USAR 250 DADO QUE LA VELOCIDAD ES 10 GRADOS
100 opObj11.addParameter(name='removeDC', value=1, format='int')
101
102
103 #######################################################################
104 ########## OPERACIONES ParametersProc########################
105 #######################################################################
106
107 procUnitConfObjB= controllerObj.addProcUnit(datatype='ParametersProc',inputId=procUnitConfObjA.getId())
108 opObj10 = procUnitConfObjB.addOperation(name='HDFWriter')
109 opObj10.addParameter(name='path',value=path_pp)
110 #opObj10.addParameter(name='mode',value=0)
111 opObj10.addParameter(name='blocksPerFile',value='100',format='int')
112 opObj10.addParameter(name='metadataList',value='utctimeInit,timeZone,paramInterval,profileIndex,channelList,heightList,flagDataAsBlock',format='list')
113 opObj10.addParameter(name='dataList',value='dataPP_POW,dataPP_DOP,utctime',format='list')#,format='list'
114
115 controllerObj.start()
@@ -0,0 +1,88
1 #!python
2
3 import os, sys
4 import datetime
5 import time
6
7 from schainpy.controller import Project
8
9 desc = "USRP_test"
10 filename = "USRP_processing.xml"
11 controllerObj = Project()
12 controllerObj.setup(id = '191', name='Test_USRP', description=desc)
13
14 ############## USED TO PLOT IQ VOLTAGE, POWER AND SPECTRA #############
15
16 #######################################################################
17 ######PATH DE LECTURA, ESCRITURA, GRAFICOS Y ENVIO WEB#################
18 #######################################################################
19
20 path = '/DATA_RM/TEST_19OCTUBRE/10MHZ'
21 #path_pp = '/DATA_RM/TEST_HDF5'
22 path_pp = '/DATA_RM/TEST_HDF5_19OCT'
23
24 #######################################################################
25 ################# RANGO DE PLOTEO######################################
26 #######################################################################
27 dBmin = '-5'
28 dBmax = '20'
29 xmin = '0'
30 xmax ='24'
31 ymin = '0'
32 ymax = '600'
33 #######################################################################
34 ########################FECHA##########################################
35 #######################################################################
36 str = datetime.date.today()
37 today = str.strftime("%Y/%m/%d")
38 str2 = str - datetime.timedelta(days=1)
39 yesterday = str2.strftime("%Y/%m/%d")
40 #######################################################################
41 ######################## UNIDAD DE LECTURA#############################
42 #######################################################################
43 readUnitConfObj = controllerObj.addReadUnit(datatype='DigitalRFReader',
44 path=path,
45 startDate="2021/01/01",#today,
46 endDate="2021/12/30",#today,
47 startTime='00:00:00',
48 endTime='23:59:59',
49 delay=0,
50 #set=0,
51 online=0,
52 walk=1,
53 ippKm = 60)
54
55 opObj11 = readUnitConfObj.addOperation(name='printInfo')
56 #opObj11 = readUnitConfObj.addOperation(name='printNumberOfBlock')
57 #######################################################################
58 ################ OPERACIONES DOMINIO DEL TIEMPO########################
59 #######################################################################
60 V=10 # aca se coloca la velocidad
61 IPP=400*1e-6
62 n= int(1/(V*IPP))
63 print("n numero de Perfiles a procesar con nFFTPoints ", n)
64
65 procUnitConfObjA = controllerObj.addProcUnit(datatype='VoltageProc', inputId=readUnitConfObj.getId())
66
67 procUnitConfObjB = controllerObj.addProcUnit(datatype='SpectraProc', inputId=procUnitConfObjA.getId())
68 procUnitConfObjB.addParameter(name='nFFTPoints', value=n, format='int')
69 procUnitConfObjB.addParameter(name='nProfiles' , value=n, format='int')
70
71 #######################################################################
72 ########## OPERACIONES ParametersProc########################
73 #######################################################################
74
75 procUnitConfObjC= controllerObj.addProcUnit(datatype='ParametersProc',inputId=procUnitConfObjB.getId())
76
77 procUnitConfObjC.addOperation(name='SpectralMoments')
78
79 opObj10 = procUnitConfObjC.addOperation(name='HDFWriter')
80 opObj10.addParameter(name='path',value=path_pp)
81 #opObj10.addParameter(name='mode',value=0)
82 opObj10.addParameter(name='blocksPerFile',value='100',format='int')
83 #opObj10.addParameter(name='metadataList',value='utctimeInit,heightList,nIncohInt,nCohInt,nProfiles,channelList',format='list')#profileIndex
84 opObj10.addParameter(name='metadataList',value='utctimeInit,heightList,nIncohInt,nCohInt,nProfiles,channelList',format='list')#profileIndex
85
86 opObj10.addParameter(name='dataList',value='data_pow,data_dop,utctime',format='list')#,format='list'
87
88 controllerObj.start()
@@ -0,0 +1,36
1 import numpy as np
2 import matplotlib.pyplot as pl
3 import wradlib
4 import warnings
5 #export WRADLIB_DATA=/path/to/wradlib-data
6 warnings.filterwarnings('ignore')
7 '''
8 try:
9 get_ipython().magic('matplotlib inline')
10 except:
11 pl.ion()
12 '''
13 filename = wradlib.util.get_wradlib_data_file("/home/soporte/Downloads/raa00-dx_10908-0806021735-fbg---bin.gz")
14 img, meta = wradlib.io.read_dx(filename)
15 print("Shape of polar array: %r\n" % (img.shape,))
16 print("Some meta data of the DX file:")
17 print("\tdatetime: %r" % (meta["datetime"],))
18 print("\tRadar ID: %s" % (meta["radarid"],))
19
20 img[200:250,:]= np.ones([50,img.shape[1]])*np.nan
21
22 img[300:360,:]= np.ones([60,img.shape[1]])*np.nan
23
24 cgax, pm= wradlib.vis.plot_ppi(img)
25 txt = pl.title('Simple PPI')
26 print("coordenada angular",img[:,0],len(img[:,0]))
27 print("COORDENADA 0",img[0],len(img[0]))
28 cbar = pl.gcf().colorbar(pm, pad=0.075)
29
30 #r = np.arange(40, 80)
31 #az = np.arange(200, 250)
32 #ax, pm = wradlib.vis.plot_ppi(img[200:250, 40:80], r, az, autoext=False)
33 #ax, pm = wradlib.vis.plot_ppi(img[200:250, 40:80], r, az)
34
35 #txt = pl.title('Sector PPI')
36 pl.show()
@@ -0,0 +1,17
1 # Ing. AVP
2 # 01/11/2021
3 # ARCHIVO DE LECTURA
4 import os, sys
5 import datetime
6 import time
7 from schainpy.controller import Project
8 print("----[Setup]-RadarMeteorologico--------")
9 Vel = 6
10 modo_proc = 1
11 path = "/DATA_RM/10"
12 path_ped = "/DATA_RM/TEST_PEDESTAL/P20211111-173856"
13 print("----[OPCIONES]------------------------")
14 op_plot = 0
15 op_integration = 0
16 op_save = 0
17 op_plot_spec = 0
@@ -390,6 +390,8 class WeatherPlot(Plot):
390 self.plots_adjust.update({'wspace': 0.4, 'hspace':0.4, 'left': 0.1, 'right': 0.9, 'bottom': 0.08})
390 self.plots_adjust.update({'wspace': 0.4, 'hspace':0.4, 'left': 0.1, 'right': 0.9, 'bottom': 0.08})
391 self.flag =0
391 self.flag =0
392 self.indicador= 0
392 self.indicador= 0
393 self.last_data_azi = None
394 self.val_mean = None
393
395
394 def update(self, dataOut):
396 def update(self, dataOut):
395
397
@@ -402,41 +404,115 class WeatherPlot(Plot):
402 factor = dataOut.normFactor
404 factor = dataOut.normFactor
403
405
404 ####print("factor",factor)
406 ####print("factor",factor)
405 data['weather'] = 10*numpy.log10(dataOut.data_360[0]/(factor))
407 data['weather'] = 10*numpy.log10(dataOut.data_360[1]/(factor))
406 print("weather",data['weather'])
408 ####print("weather",data['weather'])
407 data['azi'] = dataOut.data_azi
409 data['azi'] = dataOut.data_azi
408 return data, meta
410 return data, meta
409
411
412 def analizeDATA(self,data_azi):
413 list1 = []
414 list2 = []
415 dat = data_azi
416 for i in reversed(range(1,len(dat))):
417 if dat[i]>dat[i-1]:
418 diff = int(dat[i])-int(dat[i-1])
419 else:
420 diff = 360+int(dat[i])-int(dat[i-1])
421 if diff > 1:
422 list1.append(i-1)
423 list2.append(diff-1)
424 return list1,list2
425
426 def fixDATANEW(self,data_azi,data_weather):
427 list1,list2 = self.analizeDATA(data_azi)
428 if len(list1)== 0:
429 return data_azi,data_weather
430 else:
431 resize = 0
432 for i in range(len(list2)):
433 resize= resize + list2[i]
434 new_data_azi = numpy.resize(data_azi,resize)
435 new_data_weather= numpy.resize(date_weather,resize)
436
437 for i in range(len(list2)):
438 j=0
439 position=list1[i]+1
440 for j in range(list2[i]):
441 new_data_azi[position+j]=new_data_azi[position+j-1]+1
442
443 return new_data_azi
444
445 def fixDATA(self,data_azi):
446 data=data_azi
447 for i in range(len(data)):
448 if numpy.isnan(data[i]):
449 data[i]=data[i-1]+1
450 return data
451
452 def replaceNAN(self,data_weather,data_azi,val):
453 print("----------------activeNEWFUNCTION")
454 data= data_azi
455 data_T= data_weather
456 print("data_azi",data_azi)
457 print("VAL:",val)
458 print("SHAPE",data_T.shape)
459 for i in range(len(data)):
460 if numpy.isnan(data[i]):
461 print("NAN")
462 data_T[i,:]=numpy.ones(data_T.shape[1])*val
463 #data_T[i,:]=numpy.ones(data_T.shape[1])*numpy.nan
464 return data_T
465
410 def const_ploteo(self,data_weather,data_azi,step,res):
466 def const_ploteo(self,data_weather,data_azi,step,res):
411 if self.ini==0:
467 if self.ini==0:
412 #------- AZIMUTH
468 #------- AZIMUTH
413 n = (360/res)-len(data_azi)
469 n = (360/res)-len(data_azi)
414 start = data_azi[-1] + res
470 ##### new
415 end = data_azi[0] - res
471 data_azi_old = data_azi
472 data_azi_new = self.fixDATA(data_azi)
473 #ata_azi_new = self.fixDATANEW(data_azi)
474
475 start = data_azi_new[-1] + res
476 end = data_azi_new[0] - res
477 ##### new
478 self.last_data_azi = end
416 if start>end:
479 if start>end:
417 end = end + 360
480 end = end + 360
418 azi_vacia = numpy.linspace(start,end,int(n))
481 azi_vacia = numpy.linspace(start,end,int(n))
419 azi_vacia = numpy.where(azi_vacia>360,azi_vacia-360,azi_vacia)
482 azi_vacia = numpy.where(azi_vacia>360,azi_vacia-360,azi_vacia)
420 data_azi = numpy.hstack((data_azi,azi_vacia))
483 data_azi = numpy.hstack((data_azi_new,azi_vacia))
421 # RADAR
484 # RADAR
422 val_mean = numpy.mean(data_weather[:,0])
485 val_mean = numpy.mean(data_weather[:,-1])
486 self.val_mean = val_mean
423 data_weather_cmp = numpy.ones([(360-data_weather.shape[0]),data_weather.shape[1]])*val_mean
487 data_weather_cmp = numpy.ones([(360-data_weather.shape[0]),data_weather.shape[1]])*val_mean
488 data_weather = self.replaceNAN(data_weather=data_weather,data_azi=data_azi_old,val=self.val_mean)
424 data_weather = numpy.vstack((data_weather,data_weather_cmp))
489 data_weather = numpy.vstack((data_weather,data_weather_cmp))
425 else:
490 else:
426 # azimuth
491 # azimuth
427 flag=0
492 flag=0
428 start_azi = self.res_azi[0]
493 start_azi = self.res_azi[0]
494 #### new
495 data_azi_old = data_azi
496 ### weather ###
497 data_weather = self.replaceNAN(data_weather=data_weather,data_azi=data_azi_old,val=self.val_mean)
498
499 if numpy.isnan(data_azi[0]):
500 data_azi[0]=self.last_data_azi+1
501 data_azi = self.fixDATA(data_azi)
502 ####
503
429 start = data_azi[0]
504 start = data_azi[0]
430 end = data_azi[-1]
505 end = data_azi[-1]
431 print("start",start)
506 self.last_data_azi= end
432 print("end",end)
507 ####print("start",start)
508 ####print("end",end)
433 if start< start_azi:
509 if start< start_azi:
434 start = start +360
510 start = start +360
435 if end <start_azi:
511 if end <start_azi:
436 end = end +360
512 end = end +360
437
513
438 print("start",start)
514 ####print("start",start)
439 print("end",end)
515 ####print("end",end)
440 #### AQUI SERA LA MAGIA
516 #### AQUI SERA LA MAGIA
441 pos_ini = int((start-start_azi)/res)
517 pos_ini = int((start-start_azi)/res)
442 len_azi = len(data_azi)
518 len_azi = len(data_azi)
@@ -448,9 +524,10 class WeatherPlot(Plot):
448 dif= 360-pos_ini
524 dif= 360-pos_ini
449 comp= len_azi-dif
525 comp= len_azi-dif
450
526
451 print(pos_ini)
527 #-----------------
452 print(len_azi)
528 ####print(pos_ini)
453 print("shape",self.res_azi.shape)
529 ####print(len_azi)
530 ####print("shape",self.res_azi.shape)
454 if flag==0:
531 if flag==0:
455 # AZIMUTH
532 # AZIMUTH
456 self.res_azi[pos_ini:pos_ini+len_azi] = data_azi
533 self.res_azi[pos_ini:pos_ini+len_azi] = data_azi
@@ -470,17 +547,28 class WeatherPlot(Plot):
470 return data_weather,data_azi
547 return data_weather,data_azi
471
548
472 def plot(self):
549 def plot(self):
473 print("--------------------------------------",self.ini,"-----------------------------------")
550 #print("--------------------------------------",self.ini,"-----------------------------------")
474 #numpy.set_printoptions(suppress=True)
551 #numpy.set_printoptions(suppress=True)
475 #print(self.data.times)
552 ####print("times: ",self.data.times)
476 thisDatetime = datetime.datetime.utcfromtimestamp(self.data.times[-1])
553 thisDatetime = datetime.datetime.utcfromtimestamp(self.data.times[-1]).strftime('%Y-%m-%d %H:%M:%S')
554 #print("times: ",thisDatetime)
477 data = self.data[-1]
555 data = self.data[-1]
478 # ALTURA altura_tmp_h
556 ####ALTURA altura_tmp_h
479 altura_h = (data['weather'].shape[1])/10.0
557 ###print("Y RANGES",self.data.yrange,len(self.data.yrange))
480 stoprange = float(altura_h*1.5)#stoprange = float(33*1.5) por ahora 400
558 ###altura_h = (data['weather'].shape[1])/10.0
481 rangestep = float(0.15)
559 ###stoprange = float(altura_h*0.3)#stoprange = float(33*1.5) por ahora 400
482 r = numpy.arange(0, stoprange, rangestep)
560 ###rangestep = float(0.03)
561 ###r = numpy.arange(0, stoprange, rangestep)
562 ###print("r",r,len(r))
563 #-----------------------------update----------------------
564 r= self.data.yrange
565 delta_height = r[1]-r[0]
566 #print("1",r)
567 r_mask= numpy.where(r>=0)[0]
568 r = numpy.arange(len(r_mask))*delta_height
569 #print("2",r)
483 self.y = 2*r
570 self.y = 2*r
571 ######self.y = self.data.yrange
484 # RADAR
572 # RADAR
485 #data_weather = data['weather']
573 #data_weather = data['weather']
486 # PEDESTAL
574 # PEDESTAL
@@ -491,27 +579,27 class WeatherPlot(Plot):
491 #print("shape wr_data", wr_data.shape)
579 #print("shape wr_data", wr_data.shape)
492 #print("shape wr_azi",wr_azi.shape)
580 #print("shape wr_azi",wr_azi.shape)
493 #print("step",step)
581 #print("step",step)
494 print("Time---->",self.data.times[-1],thisDatetime)
582 ####print("Time---->",self.data.times[-1],thisDatetime)
495 #print("alturas", len(self.y))
583 #print("alturas", len(self.y))numpy.where(r>=0)
496 self.res_weather, self.res_azi = self.const_ploteo(data_weather=data['weather'],data_azi=data['azi'],step=step,res=res)
584 self.res_weather, self.res_azi = self.const_ploteo(data_weather=data['weather'][:,r_mask],data_azi=data['azi'],step=step,res=res)
497 #numpy.set_printoptions(suppress=True)
585 #numpy.set_printoptions(suppress=True)
498 #print("resultado",self.res_azi)
586 #print("resultado",self.res_azi)
499 ##########################################################
587 ###########################/DATA_RM/10_tmp/ch0###############################
500 ################# PLOTEO ###################
588 ################# PLOTEO ###################
501 ##########################################################
589 ##########################################################
502
590
503 for i,ax in enumerate(self.axes):
591 for i,ax in enumerate(self.axes):
504 if ax.firsttime:
592 if ax.firsttime:
505 plt.clf()
593 plt.clf()
506 cgax, pm = wrl.vis.plot_ppi(self.res_weather,r=r,az=self.res_azi,fig=self.figures[0], proj='cg', vmin=1, vmax=60)
594 cgax, pm = wrl.vis.plot_ppi(self.res_weather,r=r,az=self.res_azi,fig=self.figures[0], proj='cg', vmin=8, vmax=35)
507 else:
595 else:
508 plt.clf()
596 plt.clf()
509 cgax, pm = wrl.vis.plot_ppi(self.res_weather,r=r,az=self.res_azi,fig=self.figures[0], proj='cg', vmin=1, vmax=60)
597 cgax, pm = wrl.vis.plot_ppi(self.res_weather,r=r,az=self.res_azi,fig=self.figures[0], proj='cg', vmin=8, vmax=35)
510 caax = cgax.parasites[0]
598 caax = cgax.parasites[0]
511 paax = cgax.parasites[1]
599 paax = cgax.parasites[1]
512 cbar = plt.gcf().colorbar(pm, pad=0.075)
600 cbar = plt.gcf().colorbar(pm, pad=0.075)
513 caax.set_xlabel('x_range [km]')
601 caax.set_xlabel('x_range [km]')
514 caax.set_ylabel('y_range [km]')
602 caax.set_ylabel('y_range [km]')
515 plt.text(1.0, 1.05, 'azimuth '+str(thisDatetime)+"step"+str(self.ini), transform=caax.transAxes, va='bottom',ha='right')
603 plt.text(1.0, 1.05, 'azimuth '+str(thisDatetime)+" step "+str(self.ini), transform=caax.transAxes, va='bottom',ha='right')
516
604
517 self.ini= self.ini+1
605 self.ini= self.ini+1
@@ -349,7 +349,7 class DigitalRFReader(ProcessingUnit):
349 start_index, end_index = self.digitalReadObj.get_bounds(
349 start_index, end_index = self.digitalReadObj.get_bounds(
350 channelNameList[channelList[0]])
350 channelNameList[channelList[0]])
351
351
352 print("*****",start_index,end_index)
352 ##print("*****",start_index,end_index)
353 if not startUTCSecond:
353 if not startUTCSecond:
354 startUTCSecond = start_index / self.__sample_rate
354 startUTCSecond = start_index / self.__sample_rate
355
355
@@ -17,7 +17,7 class HDFReader(Reader, ProcessingUnit):
17
17
18 This unit reads HDF5 files created with `HDFWriter` operation contains
18 This unit reads HDF5 files created with `HDFWriter` operation contains
19 by default two groups Data and Metadata all variables would be saved as `dataOut`
19 by default two groups Data and Metadata all variables would be saved as `dataOut`
20 attributes.
20 attributes.
21 It is possible to read any HDF5 file by given the structure in the `description`
21 It is possible to read any HDF5 file by given the structure in the `description`
22 parameter, also you can add extra values to metadata with the parameter `extras`.
22 parameter, also you can add extra values to metadata with the parameter `extras`.
23
23
@@ -37,10 +37,10 class HDFReader(Reader, ProcessingUnit):
37 Dictionary with the description of the HDF5 file
37 Dictionary with the description of the HDF5 file
38 extras : dict, optional
38 extras : dict, optional
39 Dictionary with extra metadata to be be added to `dataOut`
39 Dictionary with extra metadata to be be added to `dataOut`
40
40
41 Examples
41 Examples
42 --------
42 --------
43
43
44 desc = {
44 desc = {
45 'Data': {
45 'Data': {
46 'data_output': ['u', 'v', 'w'],
46 'data_output': ['u', 'v', 'w'],
@@ -64,7 +64,7 class HDFReader(Reader, ProcessingUnit):
64 extras = {
64 extras = {
65 'timeZone': 300
65 'timeZone': 300
66 }
66 }
67
67
68 reader = project.addReadUnit(
68 reader = project.addReadUnit(
69 name='HDFReader',
69 name='HDFReader',
70 path='/path/to/files',
70 path='/path/to/files',
@@ -99,42 +99,42 class HDFReader(Reader, ProcessingUnit):
99
99
100 self.set_kwargs(**kwargs)
100 self.set_kwargs(**kwargs)
101 if not self.ext.startswith('.'):
101 if not self.ext.startswith('.'):
102 self.ext = '.{}'.format(self.ext)
102 self.ext = '.{}'.format(self.ext)
103
103
104 if self.online:
104 if self.online:
105 log.log("Searching files in online mode...", self.name)
105 log.log("Searching files in online mode...", self.name)
106
106
107 for nTries in range(self.nTries):
107 for nTries in range(self.nTries):
108 fullpath = self.searchFilesOnLine(self.path, self.startDate,
108 fullpath = self.searchFilesOnLine(self.path, self.startDate,
109 self.endDate, self.expLabel, self.ext, self.walk,
109 self.endDate, self.expLabel, self.ext, self.walk,
110 self.filefmt, self.folderfmt)
110 self.filefmt, self.folderfmt)
111 try:
111 try:
112 fullpath = next(fullpath)
112 fullpath = next(fullpath)
113 except:
113 except:
114 fullpath = None
114 fullpath = None
115
115
116 if fullpath:
116 if fullpath:
117 break
117 break
118
118
119 log.warning(
119 log.warning(
120 'Waiting {} sec for a valid file in {}: try {} ...'.format(
120 'Waiting {} sec for a valid file in {}: try {} ...'.format(
121 self.delay, self.path, nTries + 1),
121 self.delay, self.path, nTries + 1),
122 self.name)
122 self.name)
123 time.sleep(self.delay)
123 time.sleep(self.delay)
124
124
125 if not(fullpath):
125 if not(fullpath):
126 raise schainpy.admin.SchainError(
126 raise schainpy.admin.SchainError(
127 'There isn\'t any valid file in {}'.format(self.path))
127 'There isn\'t any valid file in {}'.format(self.path))
128
128
129 pathname, filename = os.path.split(fullpath)
129 pathname, filename = os.path.split(fullpath)
130 self.year = int(filename[1:5])
130 self.year = int(filename[1:5])
131 self.doy = int(filename[5:8])
131 self.doy = int(filename[5:8])
132 self.set = int(filename[8:11]) - 1
132 self.set = int(filename[8:11]) - 1
133 else:
133 else:
134 log.log("Searching files in {}".format(self.path), self.name)
134 log.log("Searching files in {}".format(self.path), self.name)
135 self.filenameList = self.searchFilesOffLine(self.path, self.startDate,
135 self.filenameList = self.searchFilesOffLine(self.path, self.startDate,
136 self.endDate, self.expLabel, self.ext, self.walk, self.filefmt, self.folderfmt)
136 self.endDate, self.expLabel, self.ext, self.walk, self.filefmt, self.folderfmt)
137
137
138 self.setNextFile()
138 self.setNextFile()
139
139
140 return
140 return
@@ -142,18 +142,18 class HDFReader(Reader, ProcessingUnit):
142 def readFirstHeader(self):
142 def readFirstHeader(self):
143 '''Read metadata and data'''
143 '''Read metadata and data'''
144
144
145 self.__readMetadata()
145 self.__readMetadata()
146 self.__readData()
146 self.__readData()
147 self.__setBlockList()
147 self.__setBlockList()
148
148
149 if 'type' in self.meta:
149 if 'type' in self.meta:
150 self.dataOut = eval(self.meta['type'])()
150 self.dataOut = eval(self.meta['type'])()
151
151
152 for attr in self.meta:
152 for attr in self.meta:
153 setattr(self.dataOut, attr, self.meta[attr])
153 setattr(self.dataOut, attr, self.meta[attr])
154
154
155 self.blockIndex = 0
155 self.blockIndex = 0
156
156
157 return
157 return
158
158
159 def __setBlockList(self):
159 def __setBlockList(self):
@@ -211,7 +211,7 class HDFReader(Reader, ProcessingUnit):
211 def __readData(self):
211 def __readData(self):
212
212
213 data = {}
213 data = {}
214
214
215 if self.description:
215 if self.description:
216 for key, value in self.description['Data'].items():
216 for key, value in self.description['Data'].items():
217 if isinstance(value, str):
217 if isinstance(value, str):
@@ -239,7 +239,7 class HDFReader(Reader, ProcessingUnit):
239 array = numpy.array(array)
239 array = numpy.array(array)
240 else:
240 else:
241 log.warning('Unknown type: {}'.format(name))
241 log.warning('Unknown type: {}'.format(name))
242
242
243 if name in self.description:
243 if name in self.description:
244 key = self.description[name]
244 key = self.description[name]
245 else:
245 else:
@@ -248,7 +248,7 class HDFReader(Reader, ProcessingUnit):
248
248
249 self.data = data
249 self.data = data
250 return
250 return
251
251
252 def getData(self):
252 def getData(self):
253
253
254 for attr in self.data:
254 for attr in self.data:
@@ -287,8 +287,8 class HDFWriter(Operation):
287 The HDF5 file contains by default two groups Data and Metadata where
287 The HDF5 file contains by default two groups Data and Metadata where
288 you can save any `dataOut` attribute specified by `dataList` and `metadataList`
288 you can save any `dataOut` attribute specified by `dataList` and `metadataList`
289 parameters, data attributes are normaly time dependent where the metadata
289 parameters, data attributes are normaly time dependent where the metadata
290 are not.
290 are not.
291 It is possible to customize the structure of the HDF5 file with the
291 It is possible to customize the structure of the HDF5 file with the
292 optional description parameter see the examples.
292 optional description parameter see the examples.
293
293
294 Parameters:
294 Parameters:
@@ -305,10 +305,10 class HDFWriter(Operation):
305 If True the name of the files corresponds to the timestamp of the data
305 If True the name of the files corresponds to the timestamp of the data
306 description : dict, optional
306 description : dict, optional
307 Dictionary with the desired description of the HDF5 file
307 Dictionary with the desired description of the HDF5 file
308
308
309 Examples
309 Examples
310 --------
310 --------
311
311
312 desc = {
312 desc = {
313 'data_output': {'winds': ['z', 'w', 'v']},
313 'data_output': {'winds': ['z', 'w', 'v']},
314 'utctime': 'timestamps',
314 'utctime': 'timestamps',
@@ -328,7 +328,7 class HDFWriter(Operation):
328 'heightList': 'heights'
328 'heightList': 'heights'
329 }
329 }
330 }
330 }
331
331
332 writer = proc_unit.addOperation(name='HDFWriter')
332 writer = proc_unit.addOperation(name='HDFWriter')
333 writer.addParameter(name='path', value='/path/to/file')
333 writer.addParameter(name='path', value='/path/to/file')
334 writer.addParameter(name='blocksPerFile', value='32')
334 writer.addParameter(name='blocksPerFile', value='32')
@@ -354,12 +354,33 class HDFWriter(Operation):
354 metadataList = None
354 metadataList = None
355 currentDay = None
355 currentDay = None
356 lastTime = None
356 lastTime = None
357 last_Azipos = None
358 last_Elepos = None
359 mode = None
360
361
357
362
358 def __init__(self):
363 def __init__(self):
359
364
360 Operation.__init__(self)
365 Operation.__init__(self)
361 return
366 return
362
367
368 def generalFlag(self):
369 print("GENERALFLAG")
370 if self.mode== "weather":
371 if self.last_Azipos == None:
372 tmp = self.dataOut.azimuth
373 print("ang azimuth writer",tmp)
374 self.last_Azipos = tmp
375 flag = False
376 return flag
377 print("ang_azimuth writer",self.dataOut.azimuth)
378 result = self.dataOut.azimuth - self.last_Azipos
379 self.last_Azipos = self.dataOut.azimuth
380 if result<0:
381 flag = True
382 return flag
383
363 def setup(self, path=None, blocksPerFile=10, metadataList=None, dataList=None, setType=None, description=None):
384 def setup(self, path=None, blocksPerFile=10, metadataList=None, dataList=None, setType=None, description=None):
364 self.path = path
385 self.path = path
365 self.blocksPerFile = blocksPerFile
386 self.blocksPerFile = blocksPerFile
@@ -392,7 +413,7 class HDFWriter(Operation):
392 dsDict['shape'] = dataAux.shape
413 dsDict['shape'] = dataAux.shape
393 dsDict['dsNumber'] = dataAux.shape[0]
414 dsDict['dsNumber'] = dataAux.shape[0]
394 dsDict['dtype'] = dataAux.dtype
415 dsDict['dtype'] = dataAux.dtype
395
416
396 dsList.append(dsDict)
417 dsList.append(dsDict)
397
418
398 self.dsList = dsList
419 self.dsList = dsList
@@ -407,7 +428,7 class HDFWriter(Operation):
407 self.lastTime = currentTime
428 self.lastTime = currentTime
408 self.currentDay = dataDay
429 self.currentDay = dataDay
409 return False
430 return False
410
431
411 timeDiff = currentTime - self.lastTime
432 timeDiff = currentTime - self.lastTime
412
433
413 #Si el dia es diferente o si la diferencia entre un dato y otro supera la hora
434 #Si el dia es diferente o si la diferencia entre un dato y otro supera la hora
@@ -422,11 +443,12 class HDFWriter(Operation):
422 return False
443 return False
423
444
424 def run(self, dataOut, path, blocksPerFile=10, metadataList=None,
445 def run(self, dataOut, path, blocksPerFile=10, metadataList=None,
425 dataList=[], setType=None, description={}):
446 dataList=[], setType=None, description={},mode= None):
426
447
427 self.dataOut = dataOut
448 self.dataOut = dataOut
449 self.mode = mode
428 if not(self.isConfig):
450 if not(self.isConfig):
429 self.setup(path=path, blocksPerFile=blocksPerFile,
451 self.setup(path=path, blocksPerFile=blocksPerFile,
430 metadataList=metadataList, dataList=dataList,
452 metadataList=metadataList, dataList=dataList,
431 setType=setType, description=description)
453 setType=setType, description=description)
432
454
@@ -435,9 +457,9 class HDFWriter(Operation):
435
457
436 self.putData()
458 self.putData()
437 return
459 return
438
460
439 def setNextFile(self):
461 def setNextFile(self):
440
462
441 ext = self.ext
463 ext = self.ext
442 path = self.path
464 path = self.path
443 setFile = self.setFile
465 setFile = self.setFile
@@ -522,7 +544,7 class HDFWriter(Operation):
522 return 'pair{:02d}'.format(x)
544 return 'pair{:02d}'.format(x)
523 else:
545 else:
524 return 'channel{:02d}'.format(x)
546 return 'channel{:02d}'.format(x)
525
547
526 def writeMetadata(self, fp):
548 def writeMetadata(self, fp):
527
549
528 if self.description:
550 if self.description:
@@ -547,7 +569,7 class HDFWriter(Operation):
547 return
569 return
548
570
549 def writeData(self, fp):
571 def writeData(self, fp):
550
572
551 if self.description:
573 if self.description:
552 if 'Data' in self.description:
574 if 'Data' in self.description:
553 grp = fp.create_group('Data')
575 grp = fp.create_group('Data')
@@ -558,13 +580,13 class HDFWriter(Operation):
558
580
559 dtsets = []
581 dtsets = []
560 data = []
582 data = []
561
583
562 for dsInfo in self.dsList:
584 for dsInfo in self.dsList:
563 if dsInfo['nDim'] == 0:
585 if dsInfo['nDim'] == 0:
564 ds = grp.create_dataset(
586 ds = grp.create_dataset(
565 self.getLabel(dsInfo['variable']),
587 self.getLabel(dsInfo['variable']),
566 (self.blocksPerFile, ),
588 (self.blocksPerFile, ),
567 chunks=True,
589 chunks=True,
568 dtype=numpy.float64)
590 dtype=numpy.float64)
569 dtsets.append(ds)
591 dtsets.append(ds)
570 data.append((dsInfo['variable'], -1))
592 data.append((dsInfo['variable'], -1))
@@ -576,7 +598,7 class HDFWriter(Operation):
576 sgrp = grp
598 sgrp = grp
577 for i in range(dsInfo['dsNumber']):
599 for i in range(dsInfo['dsNumber']):
578 ds = sgrp.create_dataset(
600 ds = sgrp.create_dataset(
579 self.getLabel(dsInfo['variable'], i),
601 self.getLabel(dsInfo['variable'], i),
580 (self.blocksPerFile, ) + dsInfo['shape'][1:],
602 (self.blocksPerFile, ) + dsInfo['shape'][1:],
581 chunks=True,
603 chunks=True,
582 dtype=dsInfo['dtype'])
604 dtype=dsInfo['dtype'])
@@ -585,7 +607,7 class HDFWriter(Operation):
585 fp.flush()
607 fp.flush()
586
608
587 log.log('Creating file: {}'.format(fp.filename), self.name)
609 log.log('Creating file: {}'.format(fp.filename), self.name)
588
610
589 self.ds = dtsets
611 self.ds = dtsets
590 self.data = data
612 self.data = data
591 self.firsttime = True
613 self.firsttime = True
@@ -593,8 +615,8 class HDFWriter(Operation):
593 return
615 return
594
616
595 def putData(self):
617 def putData(self):
596
618 print("**************************PUT DATA***************************************************")
597 if (self.blockIndex == self.blocksPerFile) or self.timeFlag():
619 if (self.blockIndex == self.blocksPerFile) or self.timeFlag() or self.generalFlag():
598 self.closeFile()
620 self.closeFile()
599 self.setNextFile()
621 self.setNextFile()
600
622
@@ -23,6 +23,8 from numpy import NaN
23 from scipy.optimize.optimize import OptimizeWarning
23 from scipy.optimize.optimize import OptimizeWarning
24 warnings.filterwarnings('ignore')
24 warnings.filterwarnings('ignore')
25
25
26 from time import sleep
27
26 import matplotlib.pyplot as plt
28 import matplotlib.pyplot as plt
27
29
28 SPEED_OF_LIGHT = 299792458
30 SPEED_OF_LIGHT = 299792458
@@ -1323,8 +1325,8 class SpectralMoments(Operation):
1323 if (ss1 > m):
1325 if (ss1 > m):
1324 ss1 = m
1326 ss1 = m
1325
1327
1326 valid = numpy.arange(int(m + bb0 - ss1 + 1)) + ss1
1328 #valid = numpy.arange(int(m + bb0 - ss1 + 1)) + ss1
1327 #valid = numpy.arange(1,oldspec.shape[0])# valid perfil completo igual pulsepair
1329 valid = numpy.arange(1,oldspec.shape[0])# valid perfil completo igual pulsepair
1328 signal_power = ((spec2[valid] - n0) * fwindow[valid]).mean() # D. Scipión added with correct definition
1330 signal_power = ((spec2[valid] - n0) * fwindow[valid]).mean() # D. Scipión added with correct definition
1329 total_power = (spec2[valid] * fwindow[valid]).mean() # D. Scipión added with correct definition
1331 total_power = (spec2[valid] * fwindow[valid]).mean() # D. Scipión added with correct definition
1330 power = ((spec2[valid] - n0) * fwindow[valid]).sum()
1332 power = ((spec2[valid] - n0) * fwindow[valid]).sum()
@@ -4003,6 +4005,39 class PedestalInformation(Operation):
4003 def __init__(self):
4005 def __init__(self):
4004 Operation.__init__(self)
4006 Operation.__init__(self)
4005
4007
4008
4009 def getAnguloProfile(self,utc_adq,list_pedestal):
4010 ##print("NEW-METHOD")
4011 utc_adq = utc_adq
4012 list_pedestal = list_pedestal
4013 utc_ped_list = []
4014
4015 for i in range(len(list_pedestal)):
4016 #print(i)# OJO IDENTIFICADOR DE SINCRONISMO
4017 utc_ped_list.append(self.gettimeutcfromDirFilename(path=self.path_ped,file=list_pedestal[i]))
4018
4019 nro_file,utc_ped,utc_ped_1 =self.getNROFile(utc_adq,utc_ped_list)
4020 #print("utc_adq",utc_adq)
4021 print("utc_ped",utc_ped)
4022 print("DIFF",utc_adq-utc_ped)
4023 print("nro_file",nro_file)
4024 if nro_file < 0:
4025 #print("-----------------------------------------------------------------")
4026 #print("INSERTANDO ANGULO NAN")
4027 return numpy.NaN
4028 else:
4029 nro_key_p = int((utc_adq-utc_ped)/self.t_Interval_p)-1 # ojito al -1 estimado alex
4030 ff_pedestal = list_pedestal[nro_file]
4031 #angulo = self.getDatavaluefromDirFilename(path=self.path_ped,file=ff_pedestal,value="azimuth")
4032 angulo = self.getDatavaluefromDirFilename(path=self.path_ped,file=ff_pedestal,value="azi_pos")
4033 if 99>=nro_key_p>0:
4034 ##print("angulo_array :",angulo[nro_key_p])
4035 return angulo[nro_key_p]
4036 else:
4037 #print("-----------------------------------------------------------------")
4038 return numpy.NaN
4039
4040
4006 def getfirstFilefromPath(self,path,meta,ext):
4041 def getfirstFilefromPath(self,path,meta,ext):
4007 validFilelist = []
4042 validFilelist = []
4008 #print("SEARH",path)
4043 #print("SEARH",path)
@@ -4068,9 +4103,9 class PedestalInformation(Operation):
4068
4103
4069 def getNROFile(self,utc_adq,utc_ped_list):
4104 def getNROFile(self,utc_adq,utc_ped_list):
4070 c=0
4105 c=0
4071 print("insidegetNROFile")
4106 #print("insidegetNROFile")
4072 print(utc_adq)
4107 #print(utc_adq)
4073 print(len(utc_ped_list))
4108 #print(len(utc_ped_list))
4074 for i in range(len(utc_ped_list)):
4109 for i in range(len(utc_ped_list)):
4075 if utc_adq>utc_ped_list[i]:
4110 if utc_adq>utc_ped_list[i]:
4076 #print("mayor")
4111 #print("mayor")
@@ -4105,11 +4140,11 class PedestalInformation(Operation):
4105 ###utc_adq = self.gettimeutcadqfromDirFilename(path=self.path_adq,file=self.list_adq[0])
4140 ###utc_adq = self.gettimeutcadqfromDirFilename(path=self.path_adq,file=self.list_adq[0])
4106 print("dios existe donde esta")
4141 print("dios existe donde esta")
4107
4142
4108 #print("utc_ped_list",utc_ped_list)
4143 print("utc_ped_list",utc_ped_list)
4109 ###print("utc_adq",utc_adq)
4144 #print("utc_adq",utc_adq)
4110 # utc_adq_dataOut
4145 # utc_adq_dataOut
4111 utc_adq_dataOut =dataOut.utctime
4146 utc_adq_dataOut =dataOut.utctime
4112 print("Offline-utc_adq_dataout",utc_adq_dataOut)
4147 print("OFFLINE-UTC_ADQ_dataout",utc_adq_dataOut)
4113
4148
4114 nro_file,utc_ped,utc_ped_1 = self.getNROFile(utc_adq=utc_adq_dataOut, utc_ped_list= utc_ped_list)
4149 nro_file,utc_ped,utc_ped_1 = self.getNROFile(utc_adq=utc_adq_dataOut, utc_ped_list= utc_ped_list)
4115
4150
@@ -4118,12 +4153,14 class PedestalInformation(Operation):
4118 nro_key_p = int((utc_adq_dataOut-utc_ped)/self.t_Interval_p)-1 # ojito al -1 estimado alex
4153 nro_key_p = int((utc_adq_dataOut-utc_ped)/self.t_Interval_p)-1 # ojito al -1 estimado alex
4119 print("nro_key_p",nro_key_p)
4154 print("nro_key_p",nro_key_p)
4120
4155
4121 ff_pedestal = self.list_pedestal[nro_file]
4156 ff_pedestal = self.list_
4157 pedestal[nro_file]
4122 #angulo = self.getDatavaluefromDirFilename(path=self.path_ped,file=ff_pedestal,value="azimuth")
4158 #angulo = self.getDatavaluefromDirFilename(path=self.path_ped,file=ff_pedestal,value="azimuth")
4123 angulo = self.getDatavaluefromDirFilename(path=self.path_ped,file=ff_pedestal,value="azi_pos")
4159 angulo = self.getDatavaluefromDirFilename(path=self.path_ped,file=ff_pedestal,value="azi_pos")
4124
4160
4125 print("utc_pedestal_init :",utc_ped+nro_key_p*self.t_Interval_p)
4161 print("utc_pedestal_init :",utc_ped+nro_key_p*self.t_Interval_p)
4126 print("angulo_array :",angulo[nro_key_p])
4162 if nro_key_p>0:
4163 print("angulo_array :",angulo[nro_key_p])
4127 self.nro_file = nro_file
4164 self.nro_file = nro_file
4128 self.nro_key_p = nro_key_p
4165 self.nro_key_p = nro_key_p
4129
4166
@@ -4160,6 +4197,7 class PedestalInformation(Operation):
4160 self.t_Interval_p = t_Interval_p
4197 self.t_Interval_p = t_Interval_p
4161 self.n_Muestras_p = n_Muestras_p
4198 self.n_Muestras_p = n_Muestras_p
4162 self.blocksPerfile= blocksPerfile
4199 self.blocksPerfile= blocksPerfile
4200 #print("dasdadasdasda",self.blocksPerfile)
4163 self.f_a_p = f_a_p
4201 self.f_a_p = f_a_p
4164 self.online = online
4202 self.online = online
4165 self.angulo_adq = numpy.zeros(self.blocksPerfile)
4203 self.angulo_adq = numpy.zeros(self.blocksPerfile)
@@ -4172,14 +4210,14 class PedestalInformation(Operation):
4172 print("LIST NEW", self.list_pedestal[:20])
4210 print("LIST NEW", self.list_pedestal[:20])
4173 #self.list_adq = self.getfirstFilefromPath(path=self.path_adq,meta="D",ext=".hdf5")
4211 #self.list_adq = self.getfirstFilefromPath(path=self.path_adq,meta="D",ext=".hdf5")
4174 print("*************Longitud list pedestal****************",len(self.list_pedestal))
4212 print("*************Longitud list pedestal****************",len(self.list_pedestal))
4175
4213 '''
4176 if self.online:
4214 if self.online:
4177 print("Enable Online")
4215 print("Enable Online")
4178 self.setup_online(dataOut)
4216 self.setup_online(dataOut)
4179 else:
4217 else:
4180 #self.setup_offline(dataOut,list_pedestal=self.list_pedestal,list_adq=self.list_adq)
4218 #self.setup_offline(dataOut,list_pedestal=self.list_pedestal,list_adq=self.list_adq)
4181 self.setup_offline(dataOut,list_pedestal=self.list_pedestal)
4219 self.setup_offline(dataOut,list_pedestal=self.list_pedestal)
4182
4220 '''
4183
4221
4184 def setNextFileP(self,dataOut):
4222 def setNextFileP(self,dataOut):
4185 if self.online:
4223 if self.online:
@@ -4190,52 +4228,109 class PedestalInformation(Operation):
4190 return data_pedestal
4228 return data_pedestal
4191
4229
4192
4230
4231
4232 def checkPedFile(self,path,nro_file):
4233 try:
4234 utc_pedestal_now = self.gettimeutcfromDirFilename(path=path,file=self.list_pedestal[nro_file])
4235 utc_pedestal_past = self.gettimeutcfromDirFilename(path=path,file=self.list_pedestal[nro_file-1])
4236 diff_utc = utc_pedestal_now - utc_pedestal_past
4237 except:
4238 diff_utc = -1
4239 return diff_utc
4240
4193 def setNextFileoffline(self,dataOut):
4241 def setNextFileoffline(self,dataOut):
4194 ##tmp=0
4242 print("error")
4243 print("no entiendo")
4244 flag_NOPedfile = False
4245 cont_NOPedFile = 0
4246 if self.nro_file<0:
4247 print("adq empieza antes")
4248 return numpy.ones(self.blocksPerfile)*numpy.nan
4249 print("INICIO-----------------------------------------")
4250 sleep(3)
4195 for j in range(self.blocksPerfile):
4251 for j in range(self.blocksPerfile):
4196 ###print("NUMERO DEL BLOQUE---->",j)
4252 print(j)
4197 ###print("nro_key_p",self.nro_key_p)
4253 iterador = self.nro_key_p + self.f_a_p*self.c_ped
4254 self.c_ped = self.c_ped + 1
4255 print("Iterador-->", iterador)
4256 if iterador < self.n_Muestras_p:
4257 self.nro_file = self.nro_file
4258 else:
4259 if flag_NOPedfile==False:
4260 ###########################
4261 self.nro_file = self.nro_file +1
4262 ###########################
4263 print("nro_file",self.nro_file)
4264 diff_utc = self.checkPedFile(path=self.path_ped,nro_file=self.nro_file)
4265 print("diff_utc",diff_utc)
4266 if diff_utc==1:
4267 utc_ped_setnext=self.gettimeutcfromDirFilename(path=self.path_ped,file=self.list_pedestal[self.nro_file])
4268 utc_adq_setnext=dataOut.utctime
4269 print("utc_pedestal",utc_ped_setnext)
4270 print("utc_adq",utc_adq_setnext)
4271 print("self.c_ped",self.c_ped)
4272 #dif = self.blocksPerfile-(self.nro_key_p+self.f_a_p*(self.c_ped-2))
4273 dif = self.n_Muestras_p-(self.nro_key_p+self.f_a_p*(self.c_ped-2))
4274 self.c_ped = 1
4275 ##tmp = j
4276 ##print("tmp else",tmp)
4277 self.nro_key_p= self.f_a_p-dif
4278 iterador = self.nro_key_p
4279 print("iterador else",iterador)
4280 if diff_utc >1:
4281 print("FALTAN DATOS DEL PEDESTAL AMIGO WAIT")
4282 sleep(1)
4283 #aqui no hay DATA pero creo el nro_key_p "como si existiera" y reinicio el c_ped
4284 print("continua bro")
4285 print("self.c_ped",self.c_ped)
4286 dif = self.n_Muestras_p-(self.nro_key_p+self.f_a_p*(self.c_ped-2))
4287 self.c_ped = 1
4288 self.nro_key_p = self.f_a_p-dif
4289 #
4290 iterador = self.nro_key_p
4291 print("iterador else",iterador)
4292 #
4293 utc_ped_nofile = self.gettimeutcfromDirFilename(path=self.path_ped,file=self.list_pedestal[self.nro_file-1])+1
4294 #iterador = self.nro_key_p #no hay iterador pero importa el nro_key_p
4295 flag_NOPedfile= True
4296 print("q paso")
4297
4298 if diff_utc <0:
4299 print("No hay mas archivos")
4300 self.angulo_adq = numpy.ones(self.blocksPerfile)*numpy.nan
4301 else:
4302 print("NO EXISTE DATA - IMAGINA")
4303 dif = self.n_Muestras_p-(self.nro_key_p+self.f_a_p*(self.c_ped-2))
4304 self.c_ped = 1
4305 ##tmp = j
4306 ##print("tmp else",tmp)
4307 self.nro_key_p= self.f_a_p-dif
4198
4308
4199 #iterador = self.nro_key_p +self.f_a_p*(j-tmp)
4200 iterador = self.nro_key_p +self.f_a_p*self.c_ped
4201 self.c_ped = self.c_ped +1
4202
4309
4203 print("iterador------------->",iterador)
4204 if iterador < self.n_Muestras_p:
4205 self.nro_file = self.nro_file
4206 else:
4207 self.nro_file = self.nro_file+1
4208 print("PRUEBA-------------")
4209 utc_ped_setnext=self.gettimeutcfromDirFilename(path=self.path_ped,file=self.list_pedestal[self.nro_file])
4210 utc_adq_setnext=dataOut.utctime
4211 print("utc_pedestal",utc_ped_setnext)
4212 print("utc_adq",utc_adq_setnext)
4213
4214 print("self.c_ped",self.c_ped)
4215 #dif = self.blocksPerfile-(self.nro_key_p+self.f_a_p*(self.c_ped-2))
4216 dif = self.n_Muestras_p-(self.nro_key_p+self.f_a_p*(self.c_ped-2))
4217
4218 self.c_ped = 1
4219 ##tmp = j
4220 ##print("tmp else",tmp)
4221 self.nro_key_p= self.f_a_p-dif
4222 iterador = self.nro_key_p
4223 print("iterador else",iterador)
4224 #self.c_ped = self.c_ped +1
4225
4310
4226 print("nro_file",self.nro_file)
4311
4227 #print("tmp",tmp)
4312 if flag_NOPedfile == False:
4228 try:
4313 # AQUI NECESITO DOS COSAS "nro_file" y el "iterador"
4229 ff_pedestal = self.list_pedestal[self.nro_file]
4314 ff_pedestal = self.list_pedestal[self.nro_file]
4230 print("ff_pedestal",ff_pedestal)
4315 print("ff_pedestal",ff_pedestal)
4231 except:
4316 angulo = self.getDatavaluefromDirFilename(path=self.path_ped,file=ff_pedestal,value="azi_pos")
4232 print("############# EXCEPCION ######################")
4317 save_angulo = angulo[iterador]
4233 return numpy.ones(self.blocksPerfile)*numpy.nan
4318 self.angulo_adq[j]= angulo[iterador]
4319 else:
4320 print(" DATA SIMULADA------------------------------------",j)
4321 self.angulo_adq[j]= numpy.nan
4322 cont_NOPedFile = cont_NOPedFile + 1
4323 print("contador:",cont_NOPedFile)
4324 sleep(2)
4325 if cont_NOPedFile==self.f_a_p:
4326 cont_NOPedFile = 0
4327 utc_ped_nofile = utc_ped_nofile+1
4328 utc_ped_setnext= self.gettimeutcfromDirFilename(path=self.path_ped,file=self.list_pedestal[self.nro_file])
4329 if utc_ped_setnext-utc_ped_nofile==1:
4330 fladata_pg_NOPedfile=False
4331
4234
4332
4235 #angulo = self.getDatavaluefromDirFilename(path=self.path_ped,file=ff_pedestal,value="azimuth")
4236 angulo = self.getDatavaluefromDirFilename(path=self.path_ped,file=ff_pedestal,value="azi_pos")
4237
4333
4238 self.angulo_adq[j]= angulo[iterador]
4239
4334
4240 return self.angulo_adq
4335 return self.angulo_adq
4241
4336
@@ -4298,32 +4393,68 class PedestalInformation(Operation):
4298
4393
4299 #def run(self, dataOut,path_ped,path_adq,t_Interval_p,n_Muestras_p,blocksPerfile,f_a_p,online):
4394 #def run(self, dataOut,path_ped,path_adq,t_Interval_p,n_Muestras_p,blocksPerfile,f_a_p,online):
4300 def run(self, dataOut,path_ped,t_Interval_p,n_Muestras_p,blocksPerfile,f_a_p,online):
4395 def run(self, dataOut,path_ped,t_Interval_p,n_Muestras_p,blocksPerfile,f_a_p,online):
4396 if not self.isConfig:
4397 self.setup(dataOut, path_ped,t_Interval_p,n_Muestras_p,blocksPerfile,f_a_p,online)
4398 self.__dataReady = True
4399 self.isConfig = True
4400 #print("config TRUE")
4401
4402 utc_adq = dataOut.utctime
4403 print("utc_adq---------------",utc_adq)
4404 list_pedestal = self.list_pedestal
4405 angulo = self.getAnguloProfile(utc_adq=utc_adq,list_pedestal=list_pedestal)
4406 print("angulo**********",angulo)
4407 dataOut.flagNoData = False
4408 if numpy.isnan(angulo):
4409 dataOut.flagNoData = True
4410 return dataOut
4411 dataOut.azimuth = angulo
4412 return dataOut
4301
4413
4414 '''
4302 if not self.isConfig:
4415 if not self.isConfig:
4303 print("######################SETUP#########################################")
4416 print("######################SETUP#########################################")
4417 print("CONFIG dataOut.utctime---",dataOut.utctime)
4304 #self.setup( dataOut, path_ped,path_adq,t_Interval_p,n_Muestras_p,blocksPerfile,f_a_p,online)
4418 #self.setup( dataOut, path_ped,path_adq,t_Interval_p,n_Muestras_p,blocksPerfile,f_a_p,online)
4305 self.setup( dataOut, path_ped,t_Interval_p,n_Muestras_p,blocksPerfile,f_a_p,online)
4419 self.setup( dataOut, path_ped,t_Interval_p,n_Muestras_p,blocksPerfile,f_a_p,online)
4306 self.isConfig = True
4420 print("aqui bro")
4421 if self.nro_file>=0:
4422 self.isConfig = True
4423 else:
4424 self.isConfig = False
4425 print("RUN---dataOut.utctime---",dataOut.utctime)
4307
4426
4308 dataOut.flagNoData = True
4427 dataOut.flagNoData = True
4309 ###print("profIndex",self.__profIndex)
4428 #sleep(0.5)
4310
4429 #print("--------------------------------------------------------------------------------")
4430 #print("profIndex",self.__profIndex)
4431 '''
4432 '''
4311 if self.__profIndex==0:
4433 if self.__profIndex==0:
4312 angulo_adq = self.setNextFileP(dataOut)
4434 angulo_adq = self.setNextFileP(dataOut)
4313 dataOut.azimuth = angulo_adq
4435 dataOut.azimuth = angulo_adq
4314 ######print("TIEMPO:",dataOut.utctime)
4436 print("TIEMPO--------:",dataOut.utctime)
4315 ##print("####################################################################")
4437 print("####################################################################")
4316 ######print("angulos",dataOut.azimuth,len(dataOut.azimuth))
4438 ####print("angulos",dataOut.azimuth,len(dataOut.azimuth))
4317 self.__dataReady = True
4439 self.__dataReady = True
4440 '''
4441 '''
4318 self.__profIndex += 1
4442 self.__profIndex += 1
4319 ####print("TIEMPO_bucle:",dataOut.utctime)
4443 ####print("TIEMPO_bucle:",dataOut.utctime)
4320 ####print("profIndex",self.__profIndex)
4444 #print("profIndex",self.__profIndex)
4321 if self.__profIndex== blocksPerfile:
4445 if self.__profIndex== blocksPerfile:
4446 self.__dataReady = True
4322 self.__profIndex = 0
4447 self.__profIndex = 0
4323 if self.__dataReady:
4448 if self.__dataReady:
4324 #print(self.__profIndex,dataOut.azimuth[:10])
4449 #print(self.__profIndex,dataOut.azimuth[:10])
4450 angulo_adq = self.setNextFileP(dataOut)
4451 dataOut.azimuth = angulo_adq
4452 print("TIEMPO--------:",dataOut.utctime)
4453 print("####################################################################")
4454 ####print("angulos",dataOut.azimuth,len(dataOut.azimuth))
4325 dataOut.flagNoData = False
4455 dataOut.flagNoData = False
4326 return dataOut
4456 '''
4457 #return dataOut
4327
4458
4328
4459
4329 class Block360(Operation):
4460 class Block360(Operation):
@@ -4392,9 +4523,10 class Block360(Operation):
4392 #print(data.azimuth[self.index])
4523 #print(data.azimuth[self.index])
4393 #print("index",self.index)
4524 #print("index",self.index)
4394
4525
4395 self.__buffer2[self.__profIndex] = data.azimuth[self.index]
4526 #####self.__buffer2[self.__profIndex] = data.azimuth[self.index]
4527 self.__buffer2[self.__profIndex] = data.azimuth
4396 #print("q pasa")
4528 #print("q pasa")
4397 self.index+=1
4529 #####self.index+=1
4398 #print("index",self.index,data.azimuth[:10])
4530 #print("index",self.index,data.azimuth[:10])
4399 self.__profIndex += 1
4531 self.__profIndex += 1
4400 return #················· Remove DC···································
4532 return #················· Remove DC···································
@@ -4424,7 +4556,7 class Block360(Operation):
4424 data_p = None
4556 data_p = None
4425 #print("dataOu",dataOut.dataPP_POW)
4557 #print("dataOu",dataOut.dataPP_POW)
4426 self.putData(data=dataOut,mode = self.mode)
4558 self.putData(data=dataOut,mode = self.mode)
4427 #print("profIndex",self.__profIndex)
4559 ##### print("profIndex",self.__profIndex)
4428 if self.__profIndex == self.n:
4560 if self.__profIndex == self.n:
4429 data_360,n,data_p = self.pushData(data=dataOut)
4561 data_360,n,data_p = self.pushData(data=dataOut)
4430 self.__dataReady = True
4562 self.__dataReady = True
@@ -4441,32 +4573,35 class Block360(Operation):
4441 if data_360 is None:
4573 if data_360 is None:
4442 return None, None,None
4574 return None, None,None
4443
4575
4576
4444 avgdatatime = self.__initime
4577 avgdatatime = self.__initime
4578 if self.n==1:
4579 avgdatatime = datatime
4445 deltatime = datatime - self.__lastdatatime
4580 deltatime = datatime - self.__lastdatatime
4446 self.__initime = datatime
4581 self.__initime = datatime
4447 #print(data_360.shape,avgdatatime,data_p.shape)
4582 #print(data_360.shape,avgdatatime,data_p.shape)
4448 return data_360,avgdatatime,data_p
4583 return data_360,avgdatatime,data_p
4449
4584
4450 def run(self, dataOut,n = None,mode=None,**kwargs):
4585 def run(self, dataOut,n = None,mode=None,**kwargs):
4451 ####print("BLOCK 360 HERE WE GO MOMENTOS")
4586 #print("BLOCK 360 HERE WE GO MOMENTOS")
4452 if not self.isConfig:
4587 if not self.isConfig:
4453 self.setup(dataOut = dataOut, n = n ,mode= mode ,**kwargs)
4588 self.setup(dataOut = dataOut, n = n ,mode= mode ,**kwargs)
4454 self.index = 0
4589 ####self.index = 0
4455 #print("comova",self.isConfig)
4590 #print("comova",self.isConfig)
4456 self.isConfig = True
4591 self.isConfig = True
4457 if self.index==dataOut.azimuth.shape[0]:
4592 ####if self.index==dataOut.azimuth.shape[0]:
4458 self.index=0
4593 #### self.index=0
4459 data_360, avgdatatime,data_p = self.blockOp(dataOut, dataOut.utctime)
4594 data_360, avgdatatime,data_p = self.blockOp(dataOut, dataOut.utctime)
4460 dataOut.flagNoData = True
4595 dataOut.flagNoData = True
4461
4596
4462 if self.__dataReady:
4597 if self.__dataReady:
4463 dataOut.data_360 = data_360 # S
4598 dataOut.data_360 = data_360 # S
4464 ##print("---------------------------------------------------------------------------------")
4599 ##print("---------------------------------------------------------------------------------")
4465 ##print("---------------------------DATAREADY---------------------------------------------")
4600 #####print("---------------------------DATAREADY---------------------------------------------")
4466 ##print("---------------------------------------------------------------------------------")
4601 ##print("---------------------------------------------------------------------------------")
4467 ##print("data_360",dataOut.data_360.shape)
4602 ##print("data_360",dataOut.data_360.shape)
4468 dataOut.data_azi = data_p
4603 dataOut.data_azi = data_p
4469 ##print("azi: ",dataOut.data_azi)
4604 #####print("azi: ",dataOut.data_azi)
4470 #print("jroproc_parameters",data_p[0],data_p[-1])#,data_360.shape,avgdatatime)
4605 #print("jroproc_parameters",data_p[0],data_p[-1])#,data_360.shape,avgdatatime)
4471 dataOut.utctime = avgdatatime
4606 dataOut.utctime = avgdatatime
4472 dataOut.flagNoData = False
4607 dataOut.flagNoData = False
@@ -461,4 +461,4 class SCPClient(object):
461
461
462 class SCPException(Exception):
462 class SCPException(Exception):
463 """SCP exception class"""
463 """SCP exception class"""
464 pass No newline at end of file
464 pass
@@ -22,19 +22,38 from schainpy.controller import Project
22 ######## n = 1/(V*IPP) #############################
22 ######## n = 1/(V*IPP) #############################
23 ######## VELOCIDAD DEL PEDESTAL ######################
23 ######## VELOCIDAD DEL PEDESTAL ######################
24 print("SETUP- RADAR METEOROLOGICO")
24 print("SETUP- RADAR METEOROLOGICO")
25 V = 10
25 V = 6
26 mode = 1
26 mode = 1
27 #path = '/DATA_RM/23/6v'
27 #--------------------------PATH -----------------------------
28 ####path = '/DATA_RM/TEST_INTEGRACION_2M'
28 # path = '/DATA_RM/23/6v'
29 #path = '/DATA_RM/TEST_19OCTUBRE/10MHZ'
29 # path = '/DATA_RM/TEST_INTEGRACION_2M'
30 path = '/DATA_RM/WR_20_OCT'
30 # path = '/DATA_RM/TEST_19OCTUBRE/10MHZ'
31 # path = '/DATA_RM/WR_20_OCT'
31 #### path_ped='/DATA_RM/TEST_PEDESTAL/P20211012-082745'
32 #### path_ped='/DATA_RM/TEST_PEDESTAL/P20211012-082745'
32 ####path_ped='/DATA_RM/TEST_PEDESTAL/P20211019-192244'
33 ####path_ped='/DATA_RM/TEST_PEDESTAL/P20211019-192244'
33 figpath_pp = "/home/soporte/Pictures/TEST_PP"
34 #path = '/DATA_RM/WR_POT_09_1'
34 figpath_spec = "/home/soporte/Pictures/TEST_MOM"
35 #path = '/DATA_RM/WR_POT_09_2'
36 #path ="/DATA_RM/10"
37 #path ="/DATA_RM/11"
38 #path ="/DATA_RM/DRONE/2MHZ_6V"
39 path ="/DATA_RM/DRONE/2MHZ_10V_ELEVACION"
40 path ="/DATA_RM/DRONE/2MHZ_6V_AZIMUTH"
41 #-------------------------PATH-PLOTEO------------------------------------
42 #figpath_pp = "/home/soporte/Pictures/TEST_PP"
43 #figpath_spec = "/home/soporte/Pictures/TEST_MOM_15"
44 #figpath_spec = "/home/soporte/Pictures/11_"
45 figpath_spec = "/home/soporte/Pictures/23NOV"
46 figpath_spec = "/home/soporte/Pictures/23NOV_TEST_AZI"
47 figpath_pp = "/home/soporte/Pictures/TEST_POT"
48 figpath_pp = "/home/soporte/Pictures/TEST_POT_10_"
49
50
51 #--------------------------OPCIONES-----------------------------------
35 plot = 0
52 plot = 0
36 integration = 1
53 integration = 0
37 save = 0
54 save = 0
55 plot_spec = 1
56 #-------------------------------------------------------------------------
38 if save == 1:
57 if save == 1:
39 if mode==0:
58 if mode==0:
40 path_save = '/DATA_RM/TEST_HDF5_PP_23/6v'
59 path_save = '/DATA_RM/TEST_HDF5_PP_23/6v'
@@ -68,16 +87,16 if save ==1:
68
87
69 print("* Integracion de datos :",integration)
88 print("* Integracion de datos :",integration)
70
89
71 time.sleep(15)
90 time.sleep(3)
72 #remotefolder = "/home/wmaster/graficos"
91 #remotefolder = "/home/wmaster/graficos"
73 #######################################################################
92 #######################################################################
74 ################# RANGO DE PLOTEO######################################
93 ################# RANGO DE PLOTEO######################################
75 dBmin = '1'
94 dBmin = '8'
76 dBmax = '65'
95 dBmax = '35'
77 xmin = '13.2'
96 xmin = '12.1'#17.1,17.5
78 xmax = '13.5'
97 xmax = '12.2'#17.2,17.8
79 ymin = '0'
98 ymin = '0'#### PONER A 0
80 ymax = '60'
99 ymax = '8'#### PONER A 8
81 #######################################################################
100 #######################################################################
82 ########################FECHA##########################################
101 ########################FECHA##########################################
83 str = datetime.date.today()
102 str = datetime.date.today()
@@ -96,13 +115,13 controllerObj.setup(id = '191', name='Test_USRP', description=desc)
96 #######################################################################
115 #######################################################################
97 readUnitConfObj = controllerObj.addReadUnit(datatype='DigitalRFReader',
116 readUnitConfObj = controllerObj.addReadUnit(datatype='DigitalRFReader',
98 path=path,
117 path=path,
99 startDate="2021/01/01",#today,
118 startDate="2021/11/23",#today,
100 endDate="2021/12/30",#today,
119 endDate="2021/12/23",#today,
101 startTime='00:00:00',
120 startTime='15:00:00',#'17:39:25',
102 endTime='23:59:59',
121 endTime='16:00:59',#23:59:59',
103 delay=0,
122 delay=0,
104 #set=0,
123 #set=0,
105 online=0,
124 online=1,
106 walk=1,
125 walk=1,
107 ippKm = 60)
126 ippKm = 60)
108
127
@@ -110,6 +129,22 opObj11 = readUnitConfObj.addOperation(name='printInfo')
110
129
111 procUnitConfObjA = controllerObj.addProcUnit(datatype='VoltageProc', inputId=readUnitConfObj.getId())
130 procUnitConfObjA = controllerObj.addProcUnit(datatype='VoltageProc', inputId=readUnitConfObj.getId())
112
131
132 opObj11 = procUnitConfObjA.addOperation(name='setH0')
133 opObj11.addParameter(name='h0', value='-3.3', format='float')
134 #-2.8 5MHZ
135 #-3.3 2MHZ
136
137 ###opObj11 = procUnitConfObjA.addOperation(name='selectChannels')
138 ###opObj11.addParameter(name='channelList', value='[1]',format='intList')
139
140
141 opObj11 = procUnitConfObjA.addOperation(name='selectHeights')
142 opObj11.addParameter(name='minIndex', value='1', format='int')
143 ###opObj11.addParameter(name='maxIndex', value='10000', format='int')
144 opObj11.addParameter(name='maxIndex', value='160', format='int')
145 ## 400 PARA 5MHZ 12KM 2000
146 ## 160 ṔARA 2MHZ 12KM 800
147
113 if mode ==0:
148 if mode ==0:
114 ####################### METODO PULSE PAIR ######################################################################
149 ####################### METODO PULSE PAIR ######################################################################
115 opObj11 = procUnitConfObjA.addOperation(name='PulsePair', optype='other')
150 opObj11 = procUnitConfObjA.addOperation(name='PulsePair', optype='other')
@@ -123,6 +158,8 if mode ==0:
123 opObj11.addParameter(name='colormap', value='jet')
158 opObj11.addParameter(name='colormap', value='jet')
124 opObj11.addParameter(name='xmin', value=xmin)
159 opObj11.addParameter(name='xmin', value=xmin)
125 opObj11.addParameter(name='xmax', value=xmax)
160 opObj11.addParameter(name='xmax', value=xmax)
161 #opObj11.addParameter(name='ymin', value=ymin)
162 #opObj11.addParameter(name='ymax', value=ymax)
126 opObj11.addParameter(name='zmin', value=dBmin)
163 opObj11.addParameter(name='zmin', value=dBmin)
127 opObj11.addParameter(name='zmax', value=dBmax)
164 opObj11.addParameter(name='zmax', value=dBmax)
128 opObj11.addParameter(name='save', value=figpath_pp)
165 opObj11.addParameter(name='save', value=figpath_pp)
@@ -167,20 +204,49 else:
167 procUnitConfObjB = controllerObj.addProcUnit(datatype='SpectraProc', inputId=procUnitConfObjA.getId())
204 procUnitConfObjB = controllerObj.addProcUnit(datatype='SpectraProc', inputId=procUnitConfObjA.getId())
168 procUnitConfObjB.addParameter(name='nFFTPoints', value=n, format='int')
205 procUnitConfObjB.addParameter(name='nFFTPoints', value=n, format='int')
169 procUnitConfObjB.addParameter(name='nProfiles' , value=n, format='int')
206 procUnitConfObjB.addParameter(name='nProfiles' , value=n, format='int')
207 if plot_spec==1:
208 '''
209 opObj11 = procUnitConfObjB.addOperation(name='SpectraPlot', optype='external')
210 #.addParameter(name='id', value='2', format='int')
211 opObj11.addParameter(name='wintitle', value='SpectraPlot', format='str')
212 opObj11.addParameter(name='channelList', value='1', format='intlist')
213 #opObj11.addParameter(name='xmin', value=xmin)
214 #opObj11.addParameter(name='xmax', value=xmax)
215 opObj11.addParameter(name='ymin', value=ymin)
216 opObj11.addParameter(name='ymax', value=ymax)
217 opObj11.addParameter(name='zmin', value=dBmin, format='int')
218 opObj11.addParameter(name='zmax', value=dBmax, format='int')
219 opObj11.addParameter(name='save', value=figpath_spec)
220 opObj11.addParameter(name='showprofile', value=0)
221 opObj11.addParameter(name='save_period', value=1)
222 '''
223 opObj11 = procUnitConfObjB.addOperation(name='RTIPlot', optype='external')
224 #.addParameter(name='id', value='2', format='int')
225 opObj11.addParameter(name='wintitle', value='RTIPlot', format='str')
226 opObj11.addParameter(name='channelList', value='1', format='intlist')
227 opObj11.addParameter(name='xmin', value=xmin)
228 opObj11.addParameter(name='xmax', value=xmax)
229 opObj11.addParameter(name='ymin', value=ymin)
230 opObj11.addParameter(name='ymax', value=ymax)
231 opObj11.addParameter(name='zmin', value=dBmin, format='int')
232 opObj11.addParameter(name='zmax', value=dBmax, format='int')
233 opObj11.addParameter(name='save', value=figpath_spec)
234 opObj11.addParameter(name='showprofile', value=0)
235 opObj11.addParameter(name='save_period', value=1)
170
236
171 procUnitConfObjC = controllerObj.addProcUnit(datatype='ParametersProc',inputId=procUnitConfObjB.getId())
237 procUnitConfObjC = controllerObj.addProcUnit(datatype='ParametersProc',inputId=procUnitConfObjB.getId())
172 procUnitConfObjC.addOperation(name='SpectralMoments')
238 procUnitConfObjC.addOperation(name='SpectralMoments')
173 if plot==1:
239 if plot==1:
174 dBmin = '1'
175 dBmax = '65'
176 opObj11 = procUnitConfObjC.addOperation(name='PowerPlot',optype='external')
240 opObj11 = procUnitConfObjC.addOperation(name='PowerPlot',optype='external')
177 opObj11.addParameter(name='xmin', value=xmin)
241 opObj11.addParameter(name='xmin', value=xmin)
178 opObj11.addParameter(name='xmax', value=xmax)
242 opObj11.addParameter(name='xmax', value=xmax)
243 opObj11.addParameter(name='ymin', value=ymin)
244 opObj11.addParameter(name='ymax', value=ymax)
179 opObj11.addParameter(name='zmin', value=dBmin)
245 opObj11.addParameter(name='zmin', value=dBmin)
180 opObj11.addParameter(name='zmax', value=dBmax)
246 opObj11.addParameter(name='zmax', value=dBmax)
181 opObj11.addParameter(name='save', value=figpath_spec)
247 opObj11.addParameter(name='save', value=figpath_spec)
182 opObj11.addParameter(name='showprofile', value=0)
248 opObj11.addParameter(name='showprofile', value=0)
183 opObj11.addParameter(name='save_period', value=10)
249 opObj11.addParameter(name='save_period', value=1)
184
250
185 if save==1:
251 if save==1:
186 opObj10 = procUnitConfObjC.addOperation(name='HDFWriter')
252 opObj10 = procUnitConfObjC.addOperation(name='HDFWriter')
@@ -22,27 +22,53 from schainpy.controller import Project
22 ######## n = 1/(V*IPP) #############################
22 ######## n = 1/(V*IPP) #############################
23 ######## VELOCIDAD DEL PEDESTAL ######################
23 ######## VELOCIDAD DEL PEDESTAL ######################
24 print("SETUP- RADAR METEOROLOGICO")
24 print("SETUP- RADAR METEOROLOGICO")
25 V = 6
25 V = 10
26 V = 10
26 mode = 0
27 mode = 1
27 #path = '/DATA_RM/23/6v'
28 #--------------------------PATH -----------------------------
28 #path = '/DATA_RM/TEST_INTEGRACION_2M'
29 # path = '/DATA_RM/23/6v'
29 path = '/DATA_RM/WR_20_OCT'
30 # path = '/DATA_RM/TEST_INTEGRACION_2M'
31 # path = '/DATA_RM/TEST_19OCTUBRE/10MHZ'
32 # path = '/DATA_RM/WR_20_OCT'
33 #### path_ped='/DATA_RM/TEST_PEDESTAL/P20211012-082745'
34 ####path_ped='/DATA_RM/TEST_PEDESTAL/P20211019-192244'
35 path ="/DATA_RM/10"
36 # path = '/DATA_RM/WR_POT_09_1'
37 #path ="/DATA_RM/11"
38 #path ="/DATA_RM/11"
39 #-------------------------PATH-PLOTEO------------------------------------
40 #figpath_pp = "/home/soporte/Pictures/TEST_PP"
41 #figpath_spec = "/home/soporte/Pictures/TEST_MOM"
42 figpath_spec = "/home/soporte/Pictures/ppi"
43 figpath_ppi = "/home/soporte/Pictures/ppi_SPEC_10DIC"
44 figpath_ppi_pp = "/home/soporte/Pictures/ppi_2_10"
45 figpath_pp = "/home/soporte/Pictures/TEST_POT"
46 figpath_pp = "/home/soporte/Pictures/TEST_POT2"
30
47
31 #path_ped='/DATA_RM/TEST_PEDESTAL/P20211012-082745'
48 #path_ped='/DATA_RM/TEST_PEDESTAL/P20211012-082745'
32 path_ped='/DATA_RM/TEST_PEDESTAL/P20211020-131248'
49 #path_ped='/DATA_RM/TEST_PEDESTAL/P20211020-131248'
50 #path_ped='/DATA_RM/TEST_PEDESTAL/P20211110-171003'
51 #path_ped='/DATA_RM/TEST_PEDESTAL/P20211111-173856'
52 path_ped = "/DATA_RM/TEST_PEDESTAL/P20211110-171003"
33
53
34 figpath_pp = "/home/soporte/Pictures/TEST_PP"
54
55 figpath_pp = "/home/soporte/Pictures/25TEST_PP"
35 figpath_mom = "/home/soporte/Pictures/TEST_MOM"
56 figpath_mom = "/home/soporte/Pictures/TEST_MOM"
57 #--------------------------OPCIONES-----------------------------------
36 plot = 0
58 plot = 0
37 integration = 1
59 integration = 1
38 save = 0
60 save = 1
39 if save == 1:
61 if save == 1:
40 if mode==0:
62 if mode==0:
41 path_save = '/DATA_RM/TEST_HDF5_PP_23/6v'
63 path_save = '/DATA_RM/TEST_HDF5_PP_23/6v'
42 path_save = '/DATA_RM/TEST_HDF5_PP'
64 path_save = '/DATA_RM/TEST_HDF5_PP'
43 path_save = '/DATA_RM/TEST_HDF5_PP_100'
65 path_save = '/DATA_RM/TEST_HDF5_PP_100'
66 path_save = '/DATA_RM/TEST_EMPTHY'
44 else:
67 else:
45 path_save = '/DATA_RM/TEST_HDF5_SPEC_23_V2/6v'
68 path_save = '/DATA_RM/TEST_HDF5_SPEC_23_V2/6v'
69 path_save = '/DATA_RM/TEST_EMPTHY_SPEC'
70 path_save = '/DATA_RM/LAST_TEST_16_VACIO3'
71 path_save = '/DATA_RM/LAST_TEST_30_360'
46
72
47 print("* PATH data ADQ :", path)
73 print("* PATH data ADQ :", path)
48 print("* Velocidad Pedestal :",V,"°/seg")
74 print("* Velocidad Pedestal :",V,"°/seg")
@@ -69,14 +95,14 if save ==1:
69
95
70 print("* Integracion de datos :",integration)
96 print("* Integracion de datos :",integration)
71
97
72 time.sleep(5)
98 time.sleep(3)
73 #remotefolder = "/home/wmaster/graficos"
99 #remotefolder = "/home/wmaster/graficos"
74 #######################################################################
100 #######################################################################
75 ################# RANGO DE PLOTEO######################################
101 ################# RANGO DE PLOTEO######################################
76 dBmin = '1'
102 dBmin = '1'
77 dBmax = '85'
103 dBmax = '85'
78 xmin = '15'
104 xmin = '17'
79 xmax = '15.25'
105 xmax = '17.25'
80 ymin = '0'
106 ymin = '0'
81 ymax = '600'
107 ymax = '600'
82 #######################################################################
108 #######################################################################
@@ -97,9 +123,9 controllerObj.setup(id = '191', name='Test_USRP', description=desc)
97 #######################################################################
123 #######################################################################
98 readUnitConfObj = controllerObj.addReadUnit(datatype='DigitalRFReader',
124 readUnitConfObj = controllerObj.addReadUnit(datatype='DigitalRFReader',
99 path=path,
125 path=path,
100 startDate="2021/01/01",#today,
126 startDate="2021/11/10",#today,
101 endDate="2021/12/30",#today,
127 endDate="2021/12/30",#today,
102 startTime='00:00:00',
128 startTime='17:10:25',
103 endTime='23:59:59',
129 endTime='23:59:59',
104 delay=0,
130 delay=0,
105 #set=0,
131 #set=0,
@@ -109,7 +135,16 readUnitConfObj = controllerObj.addReadUnit(datatype='DigitalRFReader',
109
135
110 opObj11 = readUnitConfObj.addOperation(name='printInfo')
136 opObj11 = readUnitConfObj.addOperation(name='printInfo')
111
137
112 procUnitConfObjA = controllerObj.addProcUnit(datatype='VoltageProc', inputId=readUnitConfObj.getId())
138 procUnitConfObjA = controllerObj.addProcUnit(datatype='VoltageProc',inputId=readUnitConfObj.getId())
139
140
141 #opObj11 = procUnitConfObjA.addOperation(name='setH0')
142 #opObj11.addParameter(name='h0', value='-2.8', format='float')
143
144 opObj11 = procUnitConfObjA.addOperation(name='selectHeights')
145 opObj11.addParameter(name='minIndex', value='1', format='int')
146 # opObj11.addParameter(name='maxIndex', value='10000', format='int')
147 opObj11.addParameter(name='maxIndex', value='400', format='int')
113
148
114 if mode ==0:
149 if mode ==0:
115 ####################### METODO PULSE PAIR ######################################################################
150 ####################### METODO PULSE PAIR ######################################################################
@@ -131,16 +166,10 if mode ==0:
131 opObj11.addParameter(name='save_period', value=50)
166 opObj11.addParameter(name='save_period', value=50)
132
167
133 ####################### METODO ESCRITURA #######################################################################
168 ####################### METODO ESCRITURA #######################################################################
134 if save==1:
169
135 opObj10 = procUnitConfObjB.addOperation(name='HDFWriter')
136 opObj10.addParameter(name='path',value=path_save)
137 #opObj10.addParameter(name='mode',value=0)
138 opObj10.addParameter(name='blocksPerFile',value='100',format='int')
139 opObj10.addParameter(name='metadataList',value='utctimeInit,timeZone,paramInterval,profileIndex,channelList,heightList,flagDataAsBlock',format='list')
140 opObj10.addParameter(name='dataList',value='dataPP_POW,dataPP_DOP,utctime',format='list')#,format='list'
141 if integration==1:
170 if integration==1:
142 V=10
171 V=V
143 blocksPerfile=360
172 blocksPerfile=100
144 print("* Velocidad del Pedestal:",V)
173 print("* Velocidad del Pedestal:",V)
145 tmp_blocksPerfile = 100
174 tmp_blocksPerfile = 100
146 f_a_p= int(tmp_blocksPerfile/V)
175 f_a_p= int(tmp_blocksPerfile/V)
@@ -153,15 +182,24 if mode ==0:
153 opObj11.addParameter(name='n_Muestras_p', value='100', format='float')
182 opObj11.addParameter(name='n_Muestras_p', value='100', format='float')
154 opObj11.addParameter(name='f_a_p', value=f_a_p, format='int')
183 opObj11.addParameter(name='f_a_p', value=f_a_p, format='int')
155 opObj11.addParameter(name='online', value='0', format='int')
184 opObj11.addParameter(name='online', value='0', format='int')
156
185 '''
157 opObj11 = procUnitConfObjB.addOperation(name='Block360')
186 opObj11 = procUnitConfObjB.addOperation(name='Block360')
158 opObj11.addParameter(name='n', value='10', format='int')
187 opObj11.addParameter(name='n', value='10', format='int')
159 opObj11.addParameter(name='mode', value=mode, format='int')
188 opObj11.addParameter(name='mode', value=mode, format='int')
160
189 '''
161 # este bloque funciona bien con divisores de 360 no olvidar 0 10 20 30 40 60 90 120 180
190 # este bloque funciona bien con divisores de 360 no olvidar 0 10 20 30 40 60 90 120 180
162
191 '''
163 opObj11= procUnitConfObjB.addOperation(name='WeatherPlot',optype='other')
192 opObj11= procUnitConfObjB.addOperation(name='WeatherPlot',optype='other')
164
193 opObj11.addParameter(name='save', value=figpath_ppi_pp)
194 opObj11.addParameter(name='save_period', value=1)
195 '''
196 if save==1:
197 opObj10 = procUnitConfObjB.addOperation(name='HDFWriter')
198 opObj10.addParameter(name='path',value=path_save)
199 #opObj10.addParameter(name='mode',value=0)
200 opObj10.addParameter(name='blocksPerFile',value='100',format='int')
201 opObj10.addParameter(name='metadataList',value='utctimeInit,timeZone,paramInterval,profileIndex,channelList,heightList,flagDataAsBlock',format='list')
202 opObj10.addParameter(name='dataList',value='dataPP_POW,dataPP_DOP,azimuth,utctime',format='list')#,format='list'
165
203
166 else:
204 else:
167 ####################### METODO SPECTROS ######################################################################
205 ####################### METODO SPECTROS ######################################################################
@@ -183,18 +221,10 else:
183 opObj11.addParameter(name='showprofile', value=0)
221 opObj11.addParameter(name='showprofile', value=0)
184 opObj11.addParameter(name='save_period', value=100)
222 opObj11.addParameter(name='save_period', value=100)
185
223
186 if save==1:
187 opObj10 = procUnitConfObjC.addOperation(name='HDFWriter')
188 opObj10.addParameter(name='path',value=path_save)
189 #opObj10.addParameter(name='mode',value=0)
190 opObj10.addParameter(name='blocksPerFile',value='360',format='int')
191 #opObj10.addParameter(name='metadataList',value='utctimeInit,heightList,nIncohInt,nCohInt,nProfiles,channelList',format='list')#profileIndex
192 opObj10.addParameter(name='metadataList',value='utctimeInit,heightList,nIncohInt,nCohInt,nProfiles,channelList',format='list')#profileIndex
193 opObj10.addParameter(name='dataList',value='data_pow,data_dop,utctime',format='list')#,format='list'
194
224
195 if integration==1:
225 if integration==1:
196 V=10
226 V=V
197 blocksPerfile=360
227 blocksPerfile=100
198 print("* Velocidad del Pedestal:",V)
228 print("* Velocidad del Pedestal:",V)
199 tmp_blocksPerfile = 100
229 tmp_blocksPerfile = 100
200 f_a_p= int(tmp_blocksPerfile/V)
230 f_a_p= int(tmp_blocksPerfile/V)
@@ -209,9 +239,31 else:
209 opObj11.addParameter(name='online', value='0', format='int')
239 opObj11.addParameter(name='online', value='0', format='int')
210
240
211 opObj11 = procUnitConfObjC.addOperation(name='Block360')
241 opObj11 = procUnitConfObjC.addOperation(name='Block360')
212 opObj11.addParameter(name='n', value='10', format='int')
242 opObj11.addParameter(name='n', value='1', format='int')
213 opObj11.addParameter(name='mode', value=mode, format='int')
243 opObj11.addParameter(name='mode', value=mode, format='int')
244 '''
245 # este bloque funciona bien con divisores de 360 no olvidar 0 10 20 30 40 60 90 120 180
246 opObj11= procUnitConfObjC.addOperation(name='WeatherPlot',optype='other')
247 opObj11.addParameter(name='save', value=figpath_ppi)
248 opObj11.addParameter(name='save_period', value=1)
249 '''
250
251 if save==1:
252 opObj10 = procUnitConfObjC.addOperation(name='HDFWriter')
253 opObj10.addParameter(name='path',value=path_save)
254 opObj10.addParameter(name='mode',value='weather')
255 opObj10.addParameter(name='blocksPerFile',value='360',format='int')
256 #opObj10.addParameter(name='metadataList',value='utctimeInit,heightList,nIncohInt,nCohInt,nProfiles,channelList',format='list')#profileIndex
257 opObj10.addParameter(name='metadataList',value='utctimeInit,heightList,nIncohInt,nCohInt,nProfiles,channelList',format='list')#profileIndex
258 #opObj10.addParameter(name='dataList',value='data_pow,data_dop,azimuth,utctime',format='list')#,format='list'
259 opObj10.addParameter(name='dataList',value='data_360,data_azi,utctime',format='list')#,format='list'
260
261
214
262
263 '''
215 # este bloque funciona bien con divisores de 360 no olvidar 0 10 20 30 40 60 90 120 180
264 # este bloque funciona bien con divisores de 360 no olvidar 0 10 20 30 40 60 90 120 180
216 opObj11= procUnitConfObjC.addOperation(name='WeatherPlot',optype='other')
265 opObj11= procUnitConfObjC.addOperation(name='WeatherPlot',optype='other')
266 opObj11.addParameter(name='save', value=figpath_ppi)
267 opObj11.addParameter(name='save_period', value=1)
268 '''
217 controllerObj.start()
269 controllerObj.start()
@@ -13,6 +13,9 import matplotlib.pyplot as plt
13
13
14 #path_ped = '/DATA_RM/TEST_PEDESTAL/P20211012-082745'
14 #path_ped = '/DATA_RM/TEST_PEDESTAL/P20211012-082745'
15 path_ped = '/DATA_RM/TEST_PEDESTAL/P20211020-131248'
15 path_ped = '/DATA_RM/TEST_PEDESTAL/P20211020-131248'
16 path_ped = '/DATA_RM/TEST_PEDESTAL/P20211110-171003'
17 path_ped = '/DATA_RM/TEST_PEDESTAL/P20211111-173856'
18 #path_ped = '/DATA_RM/TEST_PEDESTAL/P20211111-173409'
16 # Metodo para verificar numero
19 # Metodo para verificar numero
17 def isNumber(str):
20 def isNumber(str):
18 try:
21 try:
@@ -108,7 +111,7 t=numpy.arange(len(ele_pos))*0.01/60.0
108 plt.plot(t,ele_pos,label='ELEVATION_POS',color='red')#*10
111 plt.plot(t,ele_pos,label='ELEVATION_POS',color='red')#*10
109
112
110 #ax.set_xlim(0, 9)
113 #ax.set_xlim(0, 9)
111 ax.set_ylim(-5, 400)
114 ax.set_ylim(-5, 20)
112 plt.ylabel("Azimuth Position")
115 plt.ylabel("Azimuth Position")
113 plt.xlabel("Muestra")
116 plt.xlabel("Muestra")
114 plt.title('Azimuth Position vs Muestra ', fontsize=20)
117 plt.title('Azimuth Position vs Muestra ', fontsize=20)
General Comments 0
You need to be logged in to leave comments. Login now