@@ -17,6 +17,8 for name, cb_table in sophy_cb_tables: | |||
|
17 | 17 | ncmap = matplotlib.colors.ListedColormap(cb_table, name=name) |
|
18 | 18 | matplotlib.pyplot.register_cmap(cmap=ncmap) |
|
19 | 19 | #LINUX bash: export WRADLIB_DATA=/path/to/wradlib-data |
|
20 | #example | |
|
21 | #export WRADLIB_DATA="/home/soporte/Documents/EVENTO/HYO_PM@2022-06-09T15-05-12/paramC0N36.0/2022-06-09T18-00-00/" | |
|
20 | 22 | warnings.filterwarnings('ignore') |
|
21 | 23 | PARAM = { |
|
22 | 24 | 'S': {'var': 'power','vmin': -45, 'vmax': -15, 'cmap': 'jet', 'label': 'Power','unit': 'dBm'}, |
@@ -91,6 +93,22 class Readsophy(): | |||
|
91 | 93 | new_h = heightList[minIndex:maxIndex] |
|
92 | 94 | return new_h |
|
93 | 95 | |
|
96 | def readAttributes(self,obj,variable): | |
|
97 | var = PARAM[variable]['var'] | |
|
98 | unit = PARAM[variable]['unit'] | |
|
99 | cmap = PARAM[variable]['cmap'] | |
|
100 | vmin = PARAM[variable]['vmin'] | |
|
101 | vmax = PARAM[variable]['vmax'] | |
|
102 | label = PARAM[variable]['label'] | |
|
103 | var_ = 'Data/'+var+'/H' | |
|
104 | data_arr = numpy.array(obj[var_]['data']) # data | |
|
105 | utc_time = numpy.array(obj['Data/time']['data']) | |
|
106 | data_azi = numpy.array(obj['Metadata/azimuth']['data']) # th | |
|
107 | data_ele = numpy.array(obj["Metadata/elevation"]['data']) | |
|
108 | heightList = numpy.array(obj["Metadata/range"]['data']) # r | |
|
109 | ||
|
110 | return data_arr, utc_time, data_azi,data_ele, heightList,unit,cmap,vmin,vmax,label | |
|
111 | ||
|
94 | 112 | def run(self): |
|
95 | 113 | count= 0 |
|
96 | 114 | len_files = len(self.list_file) |
@@ -101,24 +119,14 class Readsophy(): | |||
|
101 | 119 | filename = get_wradlib_data_file(fullpathfile) |
|
102 | 120 | test_hdf5 = read_generic_hdf5(filename) |
|
103 | 121 | |
|
104 | var = PARAM[self.variable]['var'] | |
|
105 | unit = PARAM[self.variable]['unit'] | |
|
106 | cmap = PARAM[self.variable]['cmap'] | |
|
107 | vmin = PARAM[self.variable]['vmin'] | |
|
108 | vmax = PARAM[self.variable]['vmax'] | |
|
109 | label = PARAM[self.variable]['label'] | |
|
110 | var_ = 'Data/'+var+'/H' | |
|
111 | data_arr = numpy.array(test_hdf5[var_]['data']) # data | |
|
112 | utc_time = numpy.array(test_hdf5['Data/time']['data']) | |
|
113 | data_azi = numpy.array(test_hdf5['Metadata/azimuth']['data']) # th | |
|
114 | data_ele = numpy.array(test_hdf5["Metadata/elevation"]['data']) | |
|
115 | heightList = numpy.array(test_hdf5["Metadata/range"]['data']) # r | |
|
122 | # LECTURA | |
|
123 | data_arr, utc_time, data_azi,data_ele, heightList,unit,cmap,vmin,vmax,label = self.readAttributes(obj= test_hdf5,variable=self.variable) | |
|
116 | 124 | |
|
117 | 125 | if self.range==0: |
|
118 | 126 | self.range == heightList[-1] |
|
119 | 127 | new_heightList,minIndex,maxIndex = self.selectHeights(heightList,0.06,self.range) |
|
120 | 128 | |
|
121 | ||
|
129 | # TIEMPO | |
|
122 | 130 | my_time = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(utc_time[0])) |
|
123 | 131 | time_save = time.strftime('%Y%m%d_%H%M%S',time.localtime(utc_time[0])) |
|
124 | 132 |
General Comments 0
You need to be logged in to leave comments.
Login now