The requested changes are too big and content was truncated. Show full diff
1 | NO CONTENT: modified file |
|
NO CONTENT: modified file | ||
The requested commit or file is too big and content was truncated. Show full diff |
@@ -1,122 +1,122 | |||||
1 | # Ing. AVP |
|
1 | # Ing. AVP | |
2 | # 04/01/2022 |
|
2 | # 04/01/2022 | |
3 | # ARCHIVO DE LECTURA |
|
3 | # ARCHIVO DE LECTURA | |
4 | #---- DATA RHI --- 23 DE NOVIEMBRE DEL 2021 --- 23/11/2021--- |
|
4 | #---- DATA RHI --- 23 DE NOVIEMBRE DEL 2021 --- 23/11/2021--- | |
5 | #---- PEDESTAL ---------------------------------------------- |
|
5 | #---- PEDESTAL ---------------------------------------------- | |
6 | #------- HORA 143826 /DATA_RM/TEST_PEDESTAL/P20211123-143826 14:38-15:10 |
|
6 | #------- HORA 143826 /DATA_RM/TEST_PEDESTAL/P20211123-143826 14:38-15:10 | |
7 | #---- RADAR ---------------------------------------------- |
|
7 | #---- RADAR ---------------------------------------------- | |
8 | #------- 14:26-15:00 |
|
8 | #------- 14:26-15:00 | |
9 | #------- /DATA_RM/DRONE/2MHZ_5V_ELEVACION/ |
|
9 | #------- /DATA_RM/DRONE/2MHZ_5V_ELEVACION/ | |
10 | #------- /DATA_RM/DRONE/2MHZ_5V_ELEVACION/ch0/2021-11-23T19-00-00 |
|
10 | #------- /DATA_RM/DRONE/2MHZ_5V_ELEVACION/ch0/2021-11-23T19-00-00 | |
11 |
|
11 | |||
12 | import os, sys |
|
12 | import os, sys | |
13 | import datetime |
|
13 | import datetime | |
14 | import time |
|
14 | import time | |
15 | import numpy |
|
15 | import numpy | |
16 | from ext_met import getfirstFilefromPath,getDatavaluefromDirFilename |
|
16 | from ext_met import getfirstFilefromPath,getDatavaluefromDirFilename | |
17 | from schainpy.controller import Project |
|
17 | from schainpy.controller import Project | |
18 | #----------------------------------------------------------------------------------------- |
|
18 | #----------------------------------------------------------------------------------------- | |
19 | print("[SETUP]-RADAR METEOROLOGICO-") |
|
19 | print("[SETUP]-RADAR METEOROLOGICO-") | |
20 | path_ped = "/DATA_RM/TEST_PEDESTAL/P20211123-143826" |
|
20 | path_ped = "/DATA_RM/TEST_PEDESTAL/P20211123-143826" | |
21 | print("PATH PEDESTAL :",path_ped) |
|
21 | print("PATH PEDESTAL :",path_ped) | |
22 | path_adq = "/DATA_RM/DRONE/2MHZ_5V_ELEVACION/" |
|
22 | path_adq = "/DATA_RM/DRONE/2MHZ_5V_ELEVACION/" | |
23 | print("PATH DATA :",path_adq) |
|
23 | print("PATH DATA :",path_adq) | |
24 | figpath_pp_rti = "/home/soporte/Pictures/TEST_PP_RHI" |
|
24 | figpath_pp_rti = "/home/soporte/Pictures/TEST_PP_RHI" | |
25 | print("PATH PP RTI :",figpath_pp_rti) |
|
25 | print("PATH PP RTI :",figpath_pp_rti) | |
26 | figpath_pp_rhi = "/home/soporte/Pictures/TEST_PP_RHI" |
|
26 | figpath_pp_rhi = "/home/soporte/Pictures/TEST_PP_RHI" | |
27 | print("PATH PP RHI :",figpath_pp_rhi) |
|
27 | print("PATH PP RHI :",figpath_pp_rhi) | |
28 | path_pp_save_int = "/DATA_RM/TEST_SAVE_PP_INT_RHI" |
|
28 | path_pp_save_int = "/DATA_RM/TEST_SAVE_PP_INT_RHI" | |
29 | print("PATH SAVE PP INT :",path_pp_save_int) |
|
29 | print("PATH SAVE PP INT :",path_pp_save_int) | |
30 | print(" ") |
|
30 | print(" ") | |
31 | #------------------------------------------------------------------------------------------- |
|
31 | #------------------------------------------------------------------------------------------- | |
32 | print("SELECCIONAR MODO: PPI (0) O RHI (1)") |
|
32 | print("SELECCIONAR MODO: PPI (0) O RHI (1)") | |
33 | mode_wr = 1 |
|
33 | mode_wr = 1 | |
34 | if mode_wr==0: |
|
34 | if mode_wr==0: | |
35 | print("[ ON ] MODE PPI") |
|
35 | print("[ ON ] MODE PPI") | |
36 | list_ped = getfirstFilefromPath(path=path_ped,meta="PE",ext=".hdf5") |
|
36 | list_ped = getfirstFilefromPath(path=path_ped,meta="PE",ext=".hdf5") | |
37 | ff_pedestal = list_ped[2] |
|
37 | ff_pedestal = list_ped[2] | |
38 | azi_vel = getDatavaluefromDirFilename(path=path_ped,file=ff_pedestal,value="azi_vel") |
|
38 | azi_vel = getDatavaluefromDirFilename(path=path_ped,file=ff_pedestal,value="azi_vel") | |
39 | V = round(azi_vel[0]) |
|
39 | V = round(azi_vel[0]) | |
40 | print("VELOCIDAD AZI :", int(numpy.mean(azi_vel)),"°/seg") |
|
40 | print("VELOCIDAD AZI :", int(numpy.mean(azi_vel)),"°/seg") | |
41 | else: |
|
41 | else: | |
42 | print("[ ON ] MODE RHI") |
|
42 | print("[ ON ] MODE RHI") | |
43 | list_ped = getfirstFilefromPath(path=path_ped,meta="PE",ext=".hdf5") |
|
43 | list_ped = getfirstFilefromPath(path=path_ped,meta="PE",ext=".hdf5") | |
44 | ff_pedestal = list_ped[2] |
|
44 | ff_pedestal = list_ped[2] | |
45 | ele_vel = getDatavaluefromDirFilename(path=path_ped,file=ff_pedestal,value="ele_vel") |
|
45 | ele_vel = getDatavaluefromDirFilename(path=path_ped,file=ff_pedestal,value="ele_vel") | |
46 | V = round(ele_vel[0]) |
|
46 | V = round(ele_vel[0]) | |
47 | V = 10.0 |
|
47 | V = 10.0 | |
48 | print("VELOCIDAD ELE :", int(numpy.mean(ele_vel)),"°/seg") |
|
48 | print("VELOCIDAD ELE :", int(numpy.mean(ele_vel)),"°/seg") | |
49 | print(" ") |
|
49 | print(" ") | |
50 | #--------------------------------------------------------------------------------------- |
|
50 | #--------------------------------------------------------------------------------------- | |
51 | print("SELECCIONAR MODO: PULSE PAIR (0) O FREQUENCY (1)") |
|
51 | print("SELECCIONAR MODO: PULSE PAIR (0) O FREQUENCY (1)") | |
52 | mode_proc = 0 |
|
52 | mode_proc = 0 | |
53 | if mode_proc==0: |
|
53 | if mode_proc==0: | |
54 | print("[ ON ] MODE PULSEPAIR") |
|
54 | print("[ ON ] MODE PULSEPAIR") | |
55 | else: |
|
55 | else: | |
56 | print("[ ON ] MODE FREQUENCY") |
|
56 | print("[ ON ] MODE FREQUENCY") | |
57 | ipp = 60.0 |
|
57 | ipp = 60.0 | |
58 | print("IPP(Km.) : %1.2f"%ipp) |
|
58 | print("IPP(Km.) : %1.2f"%ipp) | |
59 | ipp_sec = (ipp*1.0e3/150.0)*1.0e-6 |
|
59 | ipp_sec = (ipp*1.0e3/150.0)*1.0e-6 | |
60 | print("IPP(useg.) : %1.2f"%(ipp_sec*(1.0e6))) |
|
60 | print("IPP(useg.) : %1.2f"%(ipp_sec*(1.0e6))) | |
61 | VEL=V |
|
61 | VEL=V | |
62 | n= int(1/(VEL*ipp_sec)) |
|
62 | n= int(1/(VEL*ipp_sec)) | |
63 | print("N° Profiles : ", n) |
|
63 | print("N° Profiles : ", n) | |
64 | #-------------------------------------------- |
|
64 | #-------------------------------------------- | |
65 | plot_rti = 0 |
|
65 | plot_rti = 0 | |
66 | plot_rhi = 1 |
|
66 | plot_rhi = 1 | |
67 | integration = 1 |
|
67 | integration = 1 | |
68 | save = 0 |
|
68 | save = 0 | |
69 | #---------------------------RANGO DE PLOTEO---------------------------------- |
|
69 | #---------------------------RANGO DE PLOTEO---------------------------------- | |
70 | dBmin = '1' |
|
70 | dBmin = '1' | |
71 | dBmax = '85' |
|
71 | dBmax = '85' | |
72 | xmin = '17' |
|
72 | xmin = '17' | |
73 | xmax = '17.25' |
|
73 | xmax = '17.25' | |
74 | ymin = '0' |
|
74 | ymin = '0' | |
75 | ymax = '600' |
|
75 | ymax = '600' | |
76 | #---------------------------------------------------------------------------- |
|
76 | #---------------------------------------------------------------------------- | |
77 | time.sleep(3) |
|
77 | time.sleep(3) | |
78 | #---------------------SIGNAL CHAIN ------------------------------------ |
|
78 | #---------------------SIGNAL CHAIN ------------------------------------ | |
79 | desc = "USRP_WEATHER_RADAR" |
|
79 | desc = "USRP_WEATHER_RADAR" | |
80 | filename = "USRP_processing.xml" |
|
80 | filename = "USRP_processing.xml" | |
81 | controllerObj = Project() |
|
81 | controllerObj = Project() | |
82 | controllerObj.setup(id = '191', name='Test_USRP', description=desc) |
|
82 | controllerObj.setup(id = '191', name='Test_USRP', description=desc) | |
83 | #---------------------UNIDAD DE LECTURA-------------------------------- |
|
83 | #---------------------UNIDAD DE LECTURA-------------------------------- | |
84 | readUnitConfObj = controllerObj.addReadUnit(datatype='DigitalRFReader', |
|
84 | readUnitConfObj = controllerObj.addReadUnit(datatype='DigitalRFReader', | |
85 | path=path_adq, |
|
85 | path=path_adq, | |
86 |
startDate="2021/11/ |
|
86 | startDate="2021/11/23",#today, | |
87 | endDate="2021/12/30",#today, |
|
87 | endDate="2021/12/30",#today, | |
88 |
startTime='1 |
|
88 | startTime='14:38:23', | |
89 | endTime='23:59:59', |
|
89 | endTime='23:59:59', | |
90 | delay=0, |
|
90 | delay=0, | |
91 | #set=0, |
|
91 | #set=0, | |
92 | online=0, |
|
92 | online=0, | |
93 | walk=1, |
|
93 | walk=1, | |
94 | ippKm=ipp) |
|
94 | ippKm=ipp) | |
95 |
|
95 | |||
96 | procUnitConfObjA = controllerObj.addProcUnit(datatype='VoltageProc',inputId=readUnitConfObj.getId()) |
|
96 | procUnitConfObjA = controllerObj.addProcUnit(datatype='VoltageProc',inputId=readUnitConfObj.getId()) | |
97 |
|
97 | |||
98 | opObj11 = procUnitConfObjA.addOperation(name='selectHeights') |
|
98 | opObj11 = procUnitConfObjA.addOperation(name='selectHeights') | |
99 | opObj11.addParameter(name='minIndex', value='1', format='int') |
|
99 | opObj11.addParameter(name='minIndex', value='1', format='int') | |
100 | # opObj11.addParameter(name='maxIndex', value='10000', format='int') |
|
100 | # opObj11.addParameter(name='maxIndex', value='10000', format='int') | |
101 | opObj11.addParameter(name='maxIndex', value='400', format='int') |
|
101 | opObj11.addParameter(name='maxIndex', value='400', format='int') | |
102 |
|
102 | |||
103 | if mode_proc==0: |
|
103 | if mode_proc==0: | |
104 | opObj11 = procUnitConfObjA.addOperation(name='PulsePair', optype='other') |
|
104 | opObj11 = procUnitConfObjA.addOperation(name='PulsePair', optype='other') | |
105 | opObj11.addParameter(name='n', value=int(n), format='int') |
|
105 | opObj11.addParameter(name='n', value=int(n), format='int') | |
106 | procUnitConfObjB= controllerObj.addProcUnit(datatype='ParametersProc',inputId=procUnitConfObjA.getId()) |
|
106 | procUnitConfObjB= controllerObj.addProcUnit(datatype='ParametersProc',inputId=procUnitConfObjA.getId()) | |
107 |
|
107 | |||
108 | if integration==1: |
|
108 | if integration==1: | |
109 | opObj11 = procUnitConfObjB.addOperation(name='PedestalInformation') |
|
109 | opObj11 = procUnitConfObjB.addOperation(name='PedestalInformation') | |
110 | opObj11.addParameter(name='path_ped', value=path_ped) |
|
110 | opObj11.addParameter(name='path_ped', value=path_ped) | |
111 | opObj11.addParameter(name='t_Interval_p', value='0.01', format='float') |
|
111 | opObj11.addParameter(name='t_Interval_p', value='0.01', format='float') | |
112 |
|
112 | |||
113 | if plot_rhi==1: |
|
113 | if plot_rhi==1: | |
114 | opObj11 = procUnitConfObjB.addOperation(name='Block360') |
|
114 | opObj11 = procUnitConfObjB.addOperation(name='Block360') | |
115 | opObj11.addParameter(name='n', value='10', format='int') |
|
115 | opObj11.addParameter(name='n', value='10', format='int') | |
116 | opObj11.addParameter(name='mode', value=mode_proc, format='int') |
|
116 | opObj11.addParameter(name='mode', value=mode_proc, format='int') | |
117 | # este bloque funciona bien con divisores de 360 no olvidar 0 10 20 30 40 60 90 120 180 |
|
117 | # este bloque funciona bien con divisores de 360 no olvidar 0 10 20 30 40 60 90 120 180 | |
118 | opObj11= procUnitConfObjB.addOperation(name='WeatherRHIPlot',optype='other') |
|
118 | opObj11= procUnitConfObjB.addOperation(name='WeatherRHIPlot',optype='other') | |
119 | opObj11.addParameter(name='save', value=figpath_pp_rhi) |
|
119 | opObj11.addParameter(name='save', value=figpath_pp_rhi) | |
120 | opObj11.addParameter(name='save_period', value=1) |
|
120 | opObj11.addParameter(name='save_period', value=1) | |
121 |
|
121 | |||
122 | controllerObj.start() |
|
122 | controllerObj.start() |
@@ -1,122 +1,123 | |||||
1 | # Ing-AlexanderValdez |
|
1 | # Ing-AlexanderValdez | |
2 | # Monitoreo de Pedestal |
|
2 | # Monitoreo de Pedestal | |
3 |
|
3 | |||
4 | ############## IMPORTA LIBRERIAS ################### |
|
4 | ############## IMPORTA LIBRERIAS ################### | |
5 | import os,numpy,h5py |
|
5 | import os,numpy,h5py | |
6 | import sys,time |
|
6 | import sys,time | |
7 | import matplotlib.pyplot as plt |
|
7 | import matplotlib.pyplot as plt | |
8 | #################################################### |
|
8 | #################################################### | |
9 | ################################################################# |
|
9 | ################################################################# | |
10 | # LA FECHA 21-10-20 CORRESPONDE A LAS PRUEBAS DEL DIA MIERCOLES |
|
10 | # LA FECHA 21-10-20 CORRESPONDE A LAS PRUEBAS DEL DIA MIERCOLES | |
11 | # 1:15:51 pm hasta 3:49:32 pm |
|
11 | # 1:15:51 pm hasta 3:49:32 pm | |
12 | ################################################################# |
|
12 | ################################################################# | |
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' |
|
16 | path_ped = '/DATA_RM/TEST_PEDESTAL/P20211110-171003' | |
17 | path_ped = '/DATA_RM/TEST_PEDESTAL/P20211111-173856' |
|
17 | path_ped = '/DATA_RM/TEST_PEDESTAL/P20211111-173856' | |
|
18 | path_ped = '/DATA_RM/TEST_PEDESTAL/P20211123-143826' | |||
18 | #path_ped = '/DATA_RM/TEST_PEDESTAL/P20211111-173409' |
|
19 | #path_ped = '/DATA_RM/TEST_PEDESTAL/P20211111-173409' | |
19 | # Metodo para verificar numero |
|
20 | # Metodo para verificar numero | |
20 | def isNumber(str): |
|
21 | def isNumber(str): | |
21 | try: |
|
22 | try: | |
22 | float(str) |
|
23 | float(str) | |
23 | return True |
|
24 | return True | |
24 | except: |
|
25 | except: | |
25 | return False |
|
26 | return False | |
26 | # Metodo para extraer el arreglo |
|
27 | # Metodo para extraer el arreglo | |
27 | def getDatavaluefromDirFilename(path,file,value): |
|
28 | def getDatavaluefromDirFilename(path,file,value): | |
28 | dir_file= path+"/"+file |
|
29 | dir_file= path+"/"+file | |
29 | fp = h5py.File(dir_file,'r') |
|
30 | fp = h5py.File(dir_file,'r') | |
30 | array = fp['Data'].get(value)[()] |
|
31 | array = fp['Data'].get(value)[()] | |
31 | fp.close() |
|
32 | fp.close() | |
32 | return array |
|
33 | return array | |
33 |
|
34 | |||
34 | # LISTA COMPLETA DE ARCHIVOS HDF5 Pedestal |
|
35 | # LISTA COMPLETA DE ARCHIVOS HDF5 Pedestal | |
35 | LIST= sorted(os.listdir(path_ped)) |
|
36 | LIST= sorted(os.listdir(path_ped)) | |
36 | m=len(LIST) |
|
37 | m=len(LIST) | |
37 | print("TOTAL DE ARCHIVOS DE PEDESTAL:",m) |
|
38 | print("TOTAL DE ARCHIVOS DE PEDESTAL:",m) | |
38 | # Contadores temporales |
|
39 | # Contadores temporales | |
39 | k= 0 |
|
40 | k= 0 | |
40 | l= 0 |
|
41 | l= 0 | |
41 | t= 0 |
|
42 | t= 0 | |
42 | # Marca de tiempo temporal |
|
43 | # Marca de tiempo temporal | |
43 | time_ = numpy.zeros([m]) |
|
44 | time_ = numpy.zeros([m]) | |
44 | # creacion de |
|
45 | # creacion de | |
45 | for i in range(m): |
|
46 | for i in range(m): | |
46 | print("order:",i) |
|
47 | print("order:",i) | |
47 | tmp_azi_pos = getDatavaluefromDirFilename(path=path_ped,file=LIST[i],value="azi_pos") |
|
48 | tmp_azi_pos = getDatavaluefromDirFilename(path=path_ped,file=LIST[i],value="azi_pos") | |
48 | tmp_ele_pos = getDatavaluefromDirFilename(path=path_ped,file=LIST[i],value="ele_pos") |
|
49 | tmp_ele_pos = getDatavaluefromDirFilename(path=path_ped,file=LIST[i],value="ele_pos") | |
49 | tmp_azi_vel = getDatavaluefromDirFilename(path=path_ped,file=LIST[i],value="azi_vel") |
|
50 | tmp_azi_vel = getDatavaluefromDirFilename(path=path_ped,file=LIST[i],value="azi_vel") | |
50 | tmp_ele_vel = getDatavaluefromDirFilename(path=path_ped,file=LIST[i],value="azi_vel")# nuevo :D |
|
51 | tmp_ele_vel = getDatavaluefromDirFilename(path=path_ped,file=LIST[i],value="azi_vel")# nuevo :D | |
51 |
|
52 | |||
52 | time_[i] = getDatavaluefromDirFilename(path=path_ped,file=LIST[i],value="utc") |
|
53 | time_[i] = getDatavaluefromDirFilename(path=path_ped,file=LIST[i],value="utc") | |
53 |
|
54 | |||
54 | k=k +tmp_azi_pos.shape[0] |
|
55 | k=k +tmp_azi_pos.shape[0] | |
55 | l=l +tmp_ele_pos.shape[0] |
|
56 | l=l +tmp_ele_pos.shape[0] | |
56 | t=t +tmp_azi_vel.shape[0] |
|
57 | t=t +tmp_azi_vel.shape[0] | |
57 |
|
58 | |||
58 | print("TOTAL DE MUESTRAS, ARCHIVOS X100:",k) |
|
59 | print("TOTAL DE MUESTRAS, ARCHIVOS X100:",k) | |
59 | time.sleep(5) |
|
60 | time.sleep(5) | |
60 | ######CREACION DE ARREGLOS CANTIDAD DE VALORES POR MUESTRA################# |
|
61 | ######CREACION DE ARREGLOS CANTIDAD DE VALORES POR MUESTRA################# | |
61 | azi_pos = numpy.zeros([k]) |
|
62 | azi_pos = numpy.zeros([k]) | |
62 | ele_pos = numpy.zeros([l]) |
|
63 | ele_pos = numpy.zeros([l]) | |
63 | time_azi_pos= numpy.zeros([k]) |
|
64 | time_azi_pos= numpy.zeros([k]) | |
64 | # Contadores temporales |
|
65 | # Contadores temporales | |
65 | p=0 |
|
66 | p=0 | |
66 | r=0 |
|
67 | r=0 | |
67 | z=0 |
|
68 | z=0 | |
68 | # VARIABLES TMP para almacenar azimuth, elevacion y tiempo |
|
69 | # VARIABLES TMP para almacenar azimuth, elevacion y tiempo | |
69 |
|
70 | |||
70 | #for filename in sorted(os.listdir(path_ped)): |
|
71 | #for filename in sorted(os.listdir(path_ped)): | |
71 | # CONDICION POR LEER EN TIEMPO REAL NO OFFLINE |
|
72 | # CONDICION POR LEER EN TIEMPO REAL NO OFFLINE | |
72 |
|
73 | |||
73 | for filename in LIST: |
|
74 | for filename in LIST: | |
74 | tmp_azi_pos = getDatavaluefromDirFilename(path=path_ped,file=filename,value="azi_pos") |
|
75 | tmp_azi_pos = getDatavaluefromDirFilename(path=path_ped,file=filename,value="azi_pos") | |
75 | tmp_ele_pos = getDatavaluefromDirFilename(path=path_ped,file=filename,value="ele_pos") |
|
76 | tmp_ele_pos = getDatavaluefromDirFilename(path=path_ped,file=filename,value="ele_pos") | |
76 | # CONDICION POR LEER EN TIEMPO REAL NO OFFLINE |
|
77 | # CONDICION POR LEER EN TIEMPO REAL NO OFFLINE | |
77 |
|
78 | |||
78 | if z==(m-1): |
|
79 | if z==(m-1): | |
79 | tmp_azi_time=numpy.arange(time_[z],time_[z]+1,1/(tmp_azi_pos.shape[0])) |
|
80 | tmp_azi_time=numpy.arange(time_[z],time_[z]+1,1/(tmp_azi_pos.shape[0])) | |
80 | else: |
|
81 | else: | |
81 | tmp_azi_time=numpy.arange(time_[z],time_[z+1],(time_[z+1]-time_[z])/(tmp_azi_pos.shape[0])) |
|
82 | tmp_azi_time=numpy.arange(time_[z],time_[z+1],(time_[z+1]-time_[z])/(tmp_azi_pos.shape[0])) | |
82 |
|
83 | |||
83 | print(filename,time_[z]) |
|
84 | print(filename,time_[z]) | |
84 | print(z,tmp_azi_pos.shape[0]) |
|
85 | print(z,tmp_azi_pos.shape[0]) | |
85 |
|
86 | |||
86 | i=0 |
|
87 | i=0 | |
87 | for i in range(tmp_azi_pos.shape[0]): |
|
88 | for i in range(tmp_azi_pos.shape[0]): | |
88 | index=p+i |
|
89 | index=p+i | |
89 | azi_pos[index]=tmp_azi_pos[i] |
|
90 | azi_pos[index]=tmp_azi_pos[i] | |
90 | time_azi_pos[index]=tmp_azi_time[i] |
|
91 | time_azi_pos[index]=tmp_azi_time[i] | |
91 | p=p+tmp_azi_pos.shape[0] |
|
92 | p=p+tmp_azi_pos.shape[0] | |
92 | i=0 |
|
93 | i=0 | |
93 | for i in range(tmp_ele_pos.shape[0]): |
|
94 | for i in range(tmp_ele_pos.shape[0]): | |
94 | index=r+i |
|
95 | index=r+i | |
95 | ele_pos[index]=tmp_ele_pos[i] |
|
96 | ele_pos[index]=tmp_ele_pos[i] | |
96 | r=r+tmp_ele_pos.shape[0] |
|
97 | r=r+tmp_ele_pos.shape[0] | |
97 |
|
98 | |||
98 |
|
99 | |||
99 | z+=1 |
|
100 | z+=1 | |
100 |
|
101 | |||
101 |
|
102 | |||
102 | ######## GRAFIQUEMOS Y VEAMOS LOS DATOS DEL Pedestal |
|
103 | ######## GRAFIQUEMOS Y VEAMOS LOS DATOS DEL Pedestal | |
103 | fig, ax = plt.subplots(figsize=(16,8)) |
|
104 | fig, ax = plt.subplots(figsize=(16,8)) | |
104 | print(time_azi_pos.shape) |
|
105 | print(time_azi_pos.shape) | |
105 | print(azi_pos.shape) |
|
106 | print(azi_pos.shape) | |
106 | t=numpy.arange(time_azi_pos.shape[0])*0.01/(60.0) |
|
107 | t=numpy.arange(time_azi_pos.shape[0])*0.01/(60.0) | |
107 | plt.plot(t,azi_pos,label='AZIMUTH_POS',color='blue') |
|
108 | plt.plot(t,azi_pos,label='AZIMUTH_POS',color='blue') | |
108 |
|
109 | |||
109 | # AQUI ESTOY ADICIONANDO LA POSICION EN elevaciont=numpy.arange(len(ele_pos))*0.01/60.0 |
|
110 | # AQUI ESTOY ADICIONANDO LA POSICION EN elevaciont=numpy.arange(len(ele_pos))*0.01/60.0 | |
110 | t=numpy.arange(len(ele_pos))*0.01/60.0 |
|
111 | t=numpy.arange(len(ele_pos))*0.01/60.0 | |
111 | plt.plot(t,ele_pos,label='ELEVATION_POS',color='red')#*10 |
|
112 | plt.plot(t,ele_pos,label='ELEVATION_POS',color='red')#*10 | |
112 |
|
113 | |||
113 |
|
|
114 | ax.set_xlim(0, 4) | |
114 |
ax.set_ylim(-5, |
|
115 | ax.set_ylim(-5, 50) | |
115 | plt.ylabel("Azimuth Position") |
|
116 | plt.ylabel("Azimuth Position") | |
116 | plt.xlabel("Muestra") |
|
117 | plt.xlabel("Muestra") | |
117 | plt.title('Azimuth Position vs Muestra ', fontsize=20) |
|
118 | plt.title('Azimuth Position vs Muestra ', fontsize=20) | |
118 | axes = plt.gca() |
|
119 | axes = plt.gca() | |
119 | axes.yaxis.grid() |
|
120 | axes.yaxis.grid() | |
120 | plt.xticks(fontsize=16) |
|
121 | plt.xticks(fontsize=16) | |
121 | plt.yticks(fontsize=16) |
|
122 | plt.yticks(fontsize=16) | |
122 | plt.show() |
|
123 | plt.show() |
@@ -1,57 +1,58 | |||||
1 | import numpy as np |
|
1 | import numpy as np | |
2 | import matplotlib.pyplot as plt |
|
2 | import matplotlib.pyplot as plt | |
3 | import wradlib as wrl |
|
3 | import wradlib as wrl | |
4 | import warnings |
|
4 | import warnings | |
5 | # libreia nueva |
|
5 | # libreia nueva | |
|
6 | #export WRADLIB_DATA="/home/soporte/Downloads/2014-06-09--185000.rhi.mvol" | |||
6 | from mpl_toolkits.axisartist.grid_finder import FixedLocator, DictFormatter |
|
7 | from mpl_toolkits.axisartist.grid_finder import FixedLocator, DictFormatter | |
7 | warnings.filterwarnings('ignore') |
|
8 | warnings.filterwarnings('ignore') | |
8 | # lectura de gaMIC hdf5 file |
|
9 | # lectura de gaMIC hdf5 file | |
9 | filename = wrl.util.get_wradlib_data_file("/home/soporte/Downloads/2014-06-09--185000.rhi.mvol") |
|
10 | filename = wrl.util.get_wradlib_data_file("/home/soporte/Downloads/2014-06-09--185000.rhi.mvol") | |
10 | data1, metadata = wrl.io.read_gamic_hdf5(filename) |
|
11 | data1, metadata = wrl.io.read_gamic_hdf5(filename) | |
11 | print(data1) |
|
12 | print(data1) | |
12 | data1 = data1['SCAN0']['ZH']['data'] |
|
13 | data1 = data1['SCAN0']['ZH']['data'] | |
13 | print(data1) |
|
14 | print(data1) | |
14 | print("SHAPE Data",np.array(data1).shape) |
|
15 | print("SHAPE Data",np.array(data1).shape) | |
15 | r = metadata['SCAN0']['r'] |
|
16 | r = metadata['SCAN0']['r'] | |
16 | print("r",r) |
|
17 | print("r",r) | |
17 | print("longitud r",len(r)) |
|
18 | print("longitud r",len(r)) | |
18 | th = metadata['SCAN0']['el'] |
|
19 | th = metadata['SCAN0']['el'] | |
19 | print("th",th) |
|
20 | print("th",th) | |
20 | print("longitud th",len(th)) |
|
21 | print("longitud th",len(th)) | |
21 | az = metadata['SCAN0']['az'] |
|
22 | az = metadata['SCAN0']['az'] | |
22 | print("az",az) |
|
23 | print("az",az) | |
23 | site = (metadata['VOL']['Longitude'], metadata['VOL']['Latitude'], |
|
24 | site = (metadata['VOL']['Longitude'], metadata['VOL']['Latitude'], | |
24 | metadata['VOL']['Height']) |
|
25 | metadata['VOL']['Height']) | |
25 |
|
26 | |||
26 | print("Longitud,Latitud,Altura",site) |
|
27 | print("Longitud,Latitud,Altura",site) | |
27 | ma1 = np.array(data1) |
|
28 | ma1 = np.array(data1) | |
28 | ''' |
|
29 | ''' | |
29 | mask_ind = np.where(data1 <= np.nanmin(data1)) |
|
30 | mask_ind = np.where(data1 <= np.nanmin(data1)) | |
30 | data1[mask_ind] = np.nan |
|
31 | data1[mask_ind] = np.nan | |
31 | ma1 = np.ma.array(data1, mask=np.isnan(data1)) |
|
32 | ma1 = np.ma.array(data1, mask=np.isnan(data1)) | |
32 | ''' |
|
33 | ''' | |
33 | #cgax, pm = wrl.vis.plot_rhi(ma1,r=r,th=th,rf=1e3) |
|
34 | #cgax, pm = wrl.vis.plot_rhi(ma1,r=r,th=th,rf=1e3) | |
34 | fig = plt.figure(figsize=(10,8)) |
|
35 | fig = plt.figure(figsize=(10,8)) | |
35 | cgax, pm = wrl.vis.plot_rhi(ma1,r=r,th=th,rf=1e3,fig=fig, ax=111,proj='cg') |
|
36 | cgax, pm = wrl.vis.plot_rhi(ma1,r=r,th=th,rf=1e3,fig=fig, ax=111,proj='cg') | |
36 | caax = cgax.parasites[0] |
|
37 | caax = cgax.parasites[0] | |
37 | paax = cgax.parasites[1] |
|
38 | paax = cgax.parasites[1] | |
38 | cgax.set_ylim(0, 14) |
|
39 | cgax.set_ylim(0, 14) | |
39 | #caax = cgax.parasites[0] |
|
40 | #caax = cgax.parasites[0] | |
40 | #paax = cgax.parasites[1] |
|
41 | #paax = cgax.parasites[1] | |
41 | #cgax, pm = wrl.vis.plot_rhi(ma1, r=r, th=th, rf=1e3, fig=fig, ax=111, proj='cg') |
|
42 | #cgax, pm = wrl.vis.plot_rhi(ma1, r=r, th=th, rf=1e3, fig=fig, ax=111, proj='cg') | |
42 | txt = plt.title('Simple RHI',y=1.05) |
|
43 | txt = plt.title('Simple RHI',y=1.05) | |
43 | #cbar = plt.gcf().colorbar(pm, pad=0.05, ax=paax) |
|
44 | #cbar = plt.gcf().colorbar(pm, pad=0.05, ax=paax) | |
44 | cbar = plt.gcf().colorbar(pm, pad=0.05) |
|
45 | cbar = plt.gcf().colorbar(pm, pad=0.05) | |
45 | cbar.set_label('reflectivity [dBZ]') |
|
46 | cbar.set_label('reflectivity [dBZ]') | |
46 | caax.set_xlabel('x_range [km]') |
|
47 | caax.set_xlabel('x_range [km]') | |
47 | caax.set_ylabel('y_range [km]') |
|
48 | caax.set_ylabel('y_range [km]') | |
48 | plt.text(1.0, 1.05, 'azimuth', transform=caax.transAxes, va='bottom',ha='right') |
|
49 | plt.text(1.0, 1.05, 'azimuth', transform=caax.transAxes, va='bottom',ha='right') | |
49 | gh = cgax.get_grid_helper() |
|
50 | gh = cgax.get_grid_helper() | |
50 |
|
51 | |||
51 | # set theta to some nice values |
|
52 | # set theta to some nice values | |
52 | locs = [0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., |
|
53 | locs = [0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., | |
53 | 15., 16., 17., 18., 20., 22., 25., 30., 35., 40., 50., 60., 70., 80., 90.] |
|
54 | 15., 16., 17., 18., 20., 22., 25., 30., 35., 40., 50., 60., 70., 80., 90.] | |
54 | gh.grid_finder.grid_locator1 = FixedLocator(locs) |
|
55 | gh.grid_finder.grid_locator1 = FixedLocator(locs) | |
55 | gh.grid_finder.tick_formatter1 = DictFormatter(dict([(i, r"${0:.0f}^\circ$".format(i)) for i in locs])) |
|
56 | gh.grid_finder.tick_formatter1 = DictFormatter(dict([(i, r"${0:.0f}^\circ$".format(i)) for i in locs])) | |
56 |
|
57 | |||
57 | plt.show() |
|
58 | plt.show() |
General Comments 0
You need to be logged in to leave comments.
Login now