##// END OF EJS Templates
valid en jroproc_parameters
avaldez -
r1394:99588b4ace71
parent child
Show More

The requested changes are too big and content was truncated. Show full diff

@@ -1,509 +1,517
1 import os
1 import os
2 import datetime
2 import datetime
3 import numpy
3 import numpy
4
4
5 from schainpy.model.graphics.jroplot_base import Plot, plt
5 from schainpy.model.graphics.jroplot_base import Plot, plt
6 from schainpy.model.graphics.jroplot_spectra import SpectraPlot, RTIPlot, CoherencePlot, SpectraCutPlot
6 from schainpy.model.graphics.jroplot_spectra import SpectraPlot, RTIPlot, CoherencePlot, SpectraCutPlot
7 from schainpy.utils import log
7 from schainpy.utils import log
8 # libreria wradlib
8 # libreria wradlib
9 import wradlib as wrl
9 import wradlib as wrl
10
10
11 EARTH_RADIUS = 6.3710e3
11 EARTH_RADIUS = 6.3710e3
12
12
13
13
14 def ll2xy(lat1, lon1, lat2, lon2):
14 def ll2xy(lat1, lon1, lat2, lon2):
15
15
16 p = 0.017453292519943295
16 p = 0.017453292519943295
17 a = 0.5 - numpy.cos((lat2 - lat1) * p)/2 + numpy.cos(lat1 * p) * \
17 a = 0.5 - numpy.cos((lat2 - lat1) * p)/2 + numpy.cos(lat1 * p) * \
18 numpy.cos(lat2 * p) * (1 - numpy.cos((lon2 - lon1) * p)) / 2
18 numpy.cos(lat2 * p) * (1 - numpy.cos((lon2 - lon1) * p)) / 2
19 r = 12742 * numpy.arcsin(numpy.sqrt(a))
19 r = 12742 * numpy.arcsin(numpy.sqrt(a))
20 theta = numpy.arctan2(numpy.sin((lon2-lon1)*p)*numpy.cos(lat2*p), numpy.cos(lat1*p)
20 theta = numpy.arctan2(numpy.sin((lon2-lon1)*p)*numpy.cos(lat2*p), numpy.cos(lat1*p)
21 * numpy.sin(lat2*p)-numpy.sin(lat1*p)*numpy.cos(lat2*p)*numpy.cos((lon2-lon1)*p))
21 * numpy.sin(lat2*p)-numpy.sin(lat1*p)*numpy.cos(lat2*p)*numpy.cos((lon2-lon1)*p))
22 theta = -theta + numpy.pi/2
22 theta = -theta + numpy.pi/2
23 return r*numpy.cos(theta), r*numpy.sin(theta)
23 return r*numpy.cos(theta), r*numpy.sin(theta)
24
24
25
25
26 def km2deg(km):
26 def km2deg(km):
27 '''
27 '''
28 Convert distance in km to degrees
28 Convert distance in km to degrees
29 '''
29 '''
30
30
31 return numpy.rad2deg(km/EARTH_RADIUS)
31 return numpy.rad2deg(km/EARTH_RADIUS)
32
32
33
33
34
34
35 class SpectralMomentsPlot(SpectraPlot):
35 class SpectralMomentsPlot(SpectraPlot):
36 '''
36 '''
37 Plot for Spectral Moments
37 Plot for Spectral Moments
38 '''
38 '''
39 CODE = 'spc_moments'
39 CODE = 'spc_moments'
40 # colormap = 'jet'
40 # colormap = 'jet'
41 # plot_type = 'pcolor'
41 # plot_type = 'pcolor'
42
42
43 class DobleGaussianPlot(SpectraPlot):
43 class DobleGaussianPlot(SpectraPlot):
44 '''
44 '''
45 Plot for Double Gaussian Plot
45 Plot for Double Gaussian Plot
46 '''
46 '''
47 CODE = 'gaussian_fit'
47 CODE = 'gaussian_fit'
48 # colormap = 'jet'
48 # colormap = 'jet'
49 # plot_type = 'pcolor'
49 # plot_type = 'pcolor'
50
50
51 class DoubleGaussianSpectraCutPlot(SpectraCutPlot):
51 class DoubleGaussianSpectraCutPlot(SpectraCutPlot):
52 '''
52 '''
53 Plot SpectraCut with Double Gaussian Fit
53 Plot SpectraCut with Double Gaussian Fit
54 '''
54 '''
55 CODE = 'cut_gaussian_fit'
55 CODE = 'cut_gaussian_fit'
56
56
57 class SnrPlot(RTIPlot):
57 class SnrPlot(RTIPlot):
58 '''
58 '''
59 Plot for SNR Data
59 Plot for SNR Data
60 '''
60 '''
61
61
62 CODE = 'snr'
62 CODE = 'snr'
63 colormap = 'jet'
63 colormap = 'jet'
64
64
65 def update(self, dataOut):
65 def update(self, dataOut):
66
66
67 data = {
67 data = {
68 'snr': 10*numpy.log10(dataOut.data_snr)
68 'snr': 10*numpy.log10(dataOut.data_snr)
69 }
69 }
70
70
71 return data, {}
71 return data, {}
72
72
73 class DopplerPlot(RTIPlot):
73 class DopplerPlot(RTIPlot):
74 '''
74 '''
75 Plot for DOPPLER Data (1st moment)
75 Plot for DOPPLER Data (1st moment)
76 '''
76 '''
77
77
78 CODE = 'dop'
78 CODE = 'dop'
79 colormap = 'jet'
79 colormap = 'jet'
80
80
81 def update(self, dataOut):
81 def update(self, dataOut):
82
82
83 data = {
83 data = {
84 'dop': 10*numpy.log10(dataOut.data_dop)
84 'dop': 10*numpy.log10(dataOut.data_dop)
85 }
85 }
86
86
87 return data, {}
87 return data, {}
88
88
89 class PowerPlot(RTIPlot):
89 class PowerPlot(RTIPlot):
90 '''
90 '''
91 Plot for Power Data (0 moment)
91 Plot for Power Data (0 moment)
92 '''
92 '''
93
93
94 CODE = 'pow'
94 CODE = 'pow'
95 colormap = 'jet'
95 colormap = 'jet'
96
96
97 def update(self, dataOut):
97 def update(self, dataOut):
98 data = {
98 data = {
99 'pow': 10*numpy.log10(dataOut.data_pow/dataOut.normFactor)
99 'pow': 10*numpy.log10(dataOut.data_pow/dataOut.normFactor)
100 }
100 }
101 return data, {}
101 return data, {}
102
102
103 class SpectralWidthPlot(RTIPlot):
103 class SpectralWidthPlot(RTIPlot):
104 '''
104 '''
105 Plot for Spectral Width Data (2nd moment)
105 Plot for Spectral Width Data (2nd moment)
106 '''
106 '''
107
107
108 CODE = 'width'
108 CODE = 'width'
109 colormap = 'jet'
109 colormap = 'jet'
110
110
111 def update(self, dataOut):
111 def update(self, dataOut):
112
112
113 data = {
113 data = {
114 'width': dataOut.data_width
114 'width': dataOut.data_width
115 }
115 }
116
116
117 return data, {}
117 return data, {}
118
118
119 class SkyMapPlot(Plot):
119 class SkyMapPlot(Plot):
120 '''
120 '''
121 Plot for meteors detection data
121 Plot for meteors detection data
122 '''
122 '''
123
123
124 CODE = 'param'
124 CODE = 'param'
125
125
126 def setup(self):
126 def setup(self):
127
127
128 self.ncols = 1
128 self.ncols = 1
129 self.nrows = 1
129 self.nrows = 1
130 self.width = 7.2
130 self.width = 7.2
131 self.height = 7.2
131 self.height = 7.2
132 self.nplots = 1
132 self.nplots = 1
133 self.xlabel = 'Zonal Zenith Angle (deg)'
133 self.xlabel = 'Zonal Zenith Angle (deg)'
134 self.ylabel = 'Meridional Zenith Angle (deg)'
134 self.ylabel = 'Meridional Zenith Angle (deg)'
135 self.polar = True
135 self.polar = True
136 self.ymin = -180
136 self.ymin = -180
137 self.ymax = 180
137 self.ymax = 180
138 self.colorbar = False
138 self.colorbar = False
139
139
140 def plot(self):
140 def plot(self):
141
141
142 arrayParameters = numpy.concatenate(self.data['param'])
142 arrayParameters = numpy.concatenate(self.data['param'])
143 error = arrayParameters[:, -1]
143 error = arrayParameters[:, -1]
144 indValid = numpy.where(error == 0)[0]
144 indValid = numpy.where(error == 0)[0]
145 finalMeteor = arrayParameters[indValid, :]
145 finalMeteor = arrayParameters[indValid, :]
146 finalAzimuth = finalMeteor[:, 3]
146 finalAzimuth = finalMeteor[:, 3]
147 finalZenith = finalMeteor[:, 4]
147 finalZenith = finalMeteor[:, 4]
148
148
149 x = finalAzimuth * numpy.pi / 180
149 x = finalAzimuth * numpy.pi / 180
150 y = finalZenith
150 y = finalZenith
151
151
152 ax = self.axes[0]
152 ax = self.axes[0]
153
153
154 if ax.firsttime:
154 if ax.firsttime:
155 ax.plot = ax.plot(x, y, 'bo', markersize=5)[0]
155 ax.plot = ax.plot(x, y, 'bo', markersize=5)[0]
156 else:
156 else:
157 ax.plot.set_data(x, y)
157 ax.plot.set_data(x, y)
158
158
159 dt1 = self.getDateTime(self.data.min_time).strftime('%y/%m/%d %H:%M:%S')
159 dt1 = self.getDateTime(self.data.min_time).strftime('%y/%m/%d %H:%M:%S')
160 dt2 = self.getDateTime(self.data.max_time).strftime('%y/%m/%d %H:%M:%S')
160 dt2 = self.getDateTime(self.data.max_time).strftime('%y/%m/%d %H:%M:%S')
161 title = 'Meteor Detection Sky Map\n %s - %s \n Number of events: %5.0f\n' % (dt1,
161 title = 'Meteor Detection Sky Map\n %s - %s \n Number of events: %5.0f\n' % (dt1,
162 dt2,
162 dt2,
163 len(x))
163 len(x))
164 self.titles[0] = title
164 self.titles[0] = title
165
165
166
166
167 class GenericRTIPlot(Plot):
167 class GenericRTIPlot(Plot):
168 '''
168 '''
169 Plot for data_xxxx object
169 Plot for data_xxxx object
170 '''
170 '''
171
171
172 CODE = 'param'
172 CODE = 'param'
173 colormap = 'viridis'
173 colormap = 'viridis'
174 plot_type = 'pcolorbuffer'
174 plot_type = 'pcolorbuffer'
175
175
176 def setup(self):
176 def setup(self):
177 self.xaxis = 'time'
177 self.xaxis = 'time'
178 self.ncols = 1
178 self.ncols = 1
179 self.nrows = self.data.shape('param')[0]
179 self.nrows = self.data.shape('param')[0]
180 self.nplots = self.nrows
180 self.nplots = self.nrows
181 self.plots_adjust.update({'hspace':0.8, 'left': 0.1, 'bottom': 0.08, 'right':0.95, 'top': 0.95})
181 self.plots_adjust.update({'hspace':0.8, 'left': 0.1, 'bottom': 0.08, 'right':0.95, 'top': 0.95})
182
182
183 if not self.xlabel:
183 if not self.xlabel:
184 self.xlabel = 'Time'
184 self.xlabel = 'Time'
185
185
186 self.ylabel = 'Range [km]'
186 self.ylabel = 'Range [km]'
187 if not self.titles:
187 if not self.titles:
188 self.titles = ['Param {}'.format(x) for x in range(self.nrows)]
188 self.titles = ['Param {}'.format(x) for x in range(self.nrows)]
189
189
190 def update(self, dataOut):
190 def update(self, dataOut):
191
191
192 data = {
192 data = {
193 'param' : numpy.concatenate([getattr(dataOut, attr) for attr in self.attr_data], axis=0)
193 'param' : numpy.concatenate([getattr(dataOut, attr) for attr in self.attr_data], axis=0)
194 }
194 }
195
195
196 meta = {}
196 meta = {}
197
197
198 return data, meta
198 return data, meta
199
199
200 def plot(self):
200 def plot(self):
201 # self.data.normalize_heights()
201 # self.data.normalize_heights()
202 self.x = self.data.times
202 self.x = self.data.times
203 self.y = self.data.yrange
203 self.y = self.data.yrange
204 self.z = self.data['param']
204 self.z = self.data['param']
205 self.z = 10*numpy.log10(self.z)
205 self.z = 10*numpy.log10(self.z)
206 self.z = numpy.ma.masked_invalid(self.z)
206 self.z = numpy.ma.masked_invalid(self.z)
207
207
208 if self.decimation is None:
208 if self.decimation is None:
209 x, y, z = self.fill_gaps(self.x, self.y, self.z)
209 x, y, z = self.fill_gaps(self.x, self.y, self.z)
210 else:
210 else:
211 x, y, z = self.fill_gaps(*self.decimate())
211 x, y, z = self.fill_gaps(*self.decimate())
212
212
213 for n, ax in enumerate(self.axes):
213 for n, ax in enumerate(self.axes):
214
214
215 self.zmax = self.zmax if self.zmax is not None else numpy.max(
215 self.zmax = self.zmax if self.zmax is not None else numpy.max(
216 self.z[n])
216 self.z[n])
217 self.zmin = self.zmin if self.zmin is not None else numpy.min(
217 self.zmin = self.zmin if self.zmin is not None else numpy.min(
218 self.z[n])
218 self.z[n])
219
219
220 if ax.firsttime:
220 if ax.firsttime:
221 if self.zlimits is not None:
221 if self.zlimits is not None:
222 self.zmin, self.zmax = self.zlimits[n]
222 self.zmin, self.zmax = self.zlimits[n]
223
223
224 ax.plt = ax.pcolormesh(x, y, z[n].T * self.factors[n],
224 ax.plt = ax.pcolormesh(x, y, z[n].T * self.factors[n],
225 vmin=self.zmin,
225 vmin=self.zmin,
226 vmax=self.zmax,
226 vmax=self.zmax,
227 cmap=self.cmaps[n]
227 cmap=self.cmaps[n]
228 )
228 )
229 else:
229 else:
230 if self.zlimits is not None:
230 if self.zlimits is not None:
231 self.zmin, self.zmax = self.zlimits[n]
231 self.zmin, self.zmax = self.zlimits[n]
232 ax.collections.remove(ax.collections[0])
232 ax.collections.remove(ax.collections[0])
233 ax.plt = ax.pcolormesh(x, y, z[n].T * self.factors[n],
233 ax.plt = ax.pcolormesh(x, y, z[n].T * self.factors[n],
234 vmin=self.zmin,
234 vmin=self.zmin,
235 vmax=self.zmax,
235 vmax=self.zmax,
236 cmap=self.cmaps[n]
236 cmap=self.cmaps[n]
237 )
237 )
238
238
239
239
240 class PolarMapPlot(Plot):
240 class PolarMapPlot(Plot):
241 '''
241 '''
242 Plot for weather radar
242 Plot for weather radar
243 '''
243 '''
244
244
245 CODE = 'param'
245 CODE = 'param'
246 colormap = 'seismic'
246 colormap = 'seismic'
247
247
248 def setup(self):
248 def setup(self):
249 self.ncols = 1
249 self.ncols = 1
250 self.nrows = 1
250 self.nrows = 1
251 self.width = 9
251 self.width = 9
252 self.height = 8
252 self.height = 8
253 self.mode = self.data.meta['mode']
253 self.mode = self.data.meta['mode']
254 if self.channels is not None:
254 if self.channels is not None:
255 self.nplots = len(self.channels)
255 self.nplots = len(self.channels)
256 self.nrows = len(self.channels)
256 self.nrows = len(self.channels)
257 else:
257 else:
258 self.nplots = self.data.shape(self.CODE)[0]
258 self.nplots = self.data.shape(self.CODE)[0]
259 self.nrows = self.nplots
259 self.nrows = self.nplots
260 self.channels = list(range(self.nplots))
260 self.channels = list(range(self.nplots))
261 if self.mode == 'E':
261 if self.mode == 'E':
262 self.xlabel = 'Longitude'
262 self.xlabel = 'Longitude'
263 self.ylabel = 'Latitude'
263 self.ylabel = 'Latitude'
264 else:
264 else:
265 self.xlabel = 'Range (km)'
265 self.xlabel = 'Range (km)'
266 self.ylabel = 'Height (km)'
266 self.ylabel = 'Height (km)'
267 self.bgcolor = 'white'
267 self.bgcolor = 'white'
268 self.cb_labels = self.data.meta['units']
268 self.cb_labels = self.data.meta['units']
269 self.lat = self.data.meta['latitude']
269 self.lat = self.data.meta['latitude']
270 self.lon = self.data.meta['longitude']
270 self.lon = self.data.meta['longitude']
271 self.xmin, self.xmax = float(
271 self.xmin, self.xmax = float(
272 km2deg(self.xmin) + self.lon), float(km2deg(self.xmax) + self.lon)
272 km2deg(self.xmin) + self.lon), float(km2deg(self.xmax) + self.lon)
273 self.ymin, self.ymax = float(
273 self.ymin, self.ymax = float(
274 km2deg(self.ymin) + self.lat), float(km2deg(self.ymax) + self.lat)
274 km2deg(self.ymin) + self.lat), float(km2deg(self.ymax) + self.lat)
275 # self.polar = True
275 # self.polar = True
276
276
277 def plot(self):
277 def plot(self):
278
278
279 for n, ax in enumerate(self.axes):
279 for n, ax in enumerate(self.axes):
280 data = self.data['param'][self.channels[n]]
280 data = self.data['param'][self.channels[n]]
281
281
282 zeniths = numpy.linspace(
282 zeniths = numpy.linspace(
283 0, self.data.meta['max_range'], data.shape[1])
283 0, self.data.meta['max_range'], data.shape[1])
284 if self.mode == 'E':
284 if self.mode == 'E':
285 azimuths = -numpy.radians(self.data.yrange)+numpy.pi/2
285 azimuths = -numpy.radians(self.data.yrange)+numpy.pi/2
286 r, theta = numpy.meshgrid(zeniths, azimuths)
286 r, theta = numpy.meshgrid(zeniths, azimuths)
287 x, y = r*numpy.cos(theta)*numpy.cos(numpy.radians(self.data.meta['elevation'])), r*numpy.sin(
287 x, y = r*numpy.cos(theta)*numpy.cos(numpy.radians(self.data.meta['elevation'])), r*numpy.sin(
288 theta)*numpy.cos(numpy.radians(self.data.meta['elevation']))
288 theta)*numpy.cos(numpy.radians(self.data.meta['elevation']))
289 x = km2deg(x) + self.lon
289 x = km2deg(x) + self.lon
290 y = km2deg(y) + self.lat
290 y = km2deg(y) + self.lat
291 else:
291 else:
292 azimuths = numpy.radians(self.data.yrange)
292 azimuths = numpy.radians(self.data.yrange)
293 r, theta = numpy.meshgrid(zeniths, azimuths)
293 r, theta = numpy.meshgrid(zeniths, azimuths)
294 x, y = r*numpy.cos(theta), r*numpy.sin(theta)
294 x, y = r*numpy.cos(theta), r*numpy.sin(theta)
295 self.y = zeniths
295 self.y = zeniths
296
296
297 if ax.firsttime:
297 if ax.firsttime:
298 if self.zlimits is not None:
298 if self.zlimits is not None:
299 self.zmin, self.zmax = self.zlimits[n]
299 self.zmin, self.zmax = self.zlimits[n]
300 ax.plt = ax.pcolormesh( # r, theta, numpy.ma.array(data, mask=numpy.isnan(data)),
300 ax.plt = ax.pcolormesh( # r, theta, numpy.ma.array(data, mask=numpy.isnan(data)),
301 x, y, numpy.ma.array(data, mask=numpy.isnan(data)),
301 x, y, numpy.ma.array(data, mask=numpy.isnan(data)),
302 vmin=self.zmin,
302 vmin=self.zmin,
303 vmax=self.zmax,
303 vmax=self.zmax,
304 cmap=self.cmaps[n])
304 cmap=self.cmaps[n])
305 else:
305 else:
306 if self.zlimits is not None:
306 if self.zlimits is not None:
307 self.zmin, self.zmax = self.zlimits[n]
307 self.zmin, self.zmax = self.zlimits[n]
308 ax.collections.remove(ax.collections[0])
308 ax.collections.remove(ax.collections[0])
309 ax.plt = ax.pcolormesh( # r, theta, numpy.ma.array(data, mask=numpy.isnan(data)),
309 ax.plt = ax.pcolormesh( # r, theta, numpy.ma.array(data, mask=numpy.isnan(data)),
310 x, y, numpy.ma.array(data, mask=numpy.isnan(data)),
310 x, y, numpy.ma.array(data, mask=numpy.isnan(data)),
311 vmin=self.zmin,
311 vmin=self.zmin,
312 vmax=self.zmax,
312 vmax=self.zmax,
313 cmap=self.cmaps[n])
313 cmap=self.cmaps[n])
314
314
315 if self.mode == 'A':
315 if self.mode == 'A':
316 continue
316 continue
317
317
318 # plot district names
318 # plot district names
319 f = open('/data/workspace/schain_scripts/distrito.csv')
319 f = open('/data/workspace/schain_scripts/distrito.csv')
320 for line in f:
320 for line in f:
321 label, lon, lat = [s.strip() for s in line.split(',') if s]
321 label, lon, lat = [s.strip() for s in line.split(',') if s]
322 lat = float(lat)
322 lat = float(lat)
323 lon = float(lon)
323 lon = float(lon)
324 # ax.plot(lon, lat, '.b', ms=2)
324 # ax.plot(lon, lat, '.b', ms=2)
325 ax.text(lon, lat, label.decode('utf8'), ha='center',
325 ax.text(lon, lat, label.decode('utf8'), ha='center',
326 va='bottom', size='8', color='black')
326 va='bottom', size='8', color='black')
327
327
328 # plot limites
328 # plot limites
329 limites = []
329 limites = []
330 tmp = []
330 tmp = []
331 for line in open('/data/workspace/schain_scripts/lima.csv'):
331 for line in open('/data/workspace/schain_scripts/lima.csv'):
332 if '#' in line:
332 if '#' in line:
333 if tmp:
333 if tmp:
334 limites.append(tmp)
334 limites.append(tmp)
335 tmp = []
335 tmp = []
336 continue
336 continue
337 values = line.strip().split(',')
337 values = line.strip().split(',')
338 tmp.append((float(values[0]), float(values[1])))
338 tmp.append((float(values[0]), float(values[1])))
339 for points in limites:
339 for points in limites:
340 ax.add_patch(
340 ax.add_patch(
341 Polygon(points, ec='k', fc='none', ls='--', lw=0.5))
341 Polygon(points, ec='k', fc='none', ls='--', lw=0.5))
342
342
343 # plot Cuencas
343 # plot Cuencas
344 for cuenca in ('rimac', 'lurin', 'mala', 'chillon', 'chilca', 'chancay-huaral'):
344 for cuenca in ('rimac', 'lurin', 'mala', 'chillon', 'chilca', 'chancay-huaral'):
345 f = open('/data/workspace/schain_scripts/{}.csv'.format(cuenca))
345 f = open('/data/workspace/schain_scripts/{}.csv'.format(cuenca))
346 values = [line.strip().split(',') for line in f]
346 values = [line.strip().split(',') for line in f]
347 points = [(float(s[0]), float(s[1])) for s in values]
347 points = [(float(s[0]), float(s[1])) for s in values]
348 ax.add_patch(Polygon(points, ec='b', fc='none'))
348 ax.add_patch(Polygon(points, ec='b', fc='none'))
349
349
350 # plot grid
350 # plot grid
351 for r in (15, 30, 45, 60):
351 for r in (15, 30, 45, 60):
352 ax.add_artist(plt.Circle((self.lon, self.lat),
352 ax.add_artist(plt.Circle((self.lon, self.lat),
353 km2deg(r), color='0.6', fill=False, lw=0.2))
353 km2deg(r), color='0.6', fill=False, lw=0.2))
354 ax.text(
354 ax.text(
355 self.lon + (km2deg(r))*numpy.cos(60*numpy.pi/180),
355 self.lon + (km2deg(r))*numpy.cos(60*numpy.pi/180),
356 self.lat + (km2deg(r))*numpy.sin(60*numpy.pi/180),
356 self.lat + (km2deg(r))*numpy.sin(60*numpy.pi/180),
357 '{}km'.format(r),
357 '{}km'.format(r),
358 ha='center', va='bottom', size='8', color='0.6', weight='heavy')
358 ha='center', va='bottom', size='8', color='0.6', weight='heavy')
359
359
360 if self.mode == 'E':
360 if self.mode == 'E':
361 title = 'El={}$^\circ$'.format(self.data.meta['elevation'])
361 title = 'El={}$^\circ$'.format(self.data.meta['elevation'])
362 label = 'E{:02d}'.format(int(self.data.meta['elevation']))
362 label = 'E{:02d}'.format(int(self.data.meta['elevation']))
363 else:
363 else:
364 title = 'Az={}$^\circ$'.format(self.data.meta['azimuth'])
364 title = 'Az={}$^\circ$'.format(self.data.meta['azimuth'])
365 label = 'A{:02d}'.format(int(self.data.meta['azimuth']))
365 label = 'A{:02d}'.format(int(self.data.meta['azimuth']))
366
366
367 self.save_labels = ['{}-{}'.format(lbl, label) for lbl in self.labels]
367 self.save_labels = ['{}-{}'.format(lbl, label) for lbl in self.labels]
368 self.titles = ['{} {}'.format(
368 self.titles = ['{} {}'.format(
369 self.data.parameters[x], title) for x in self.channels]
369 self.data.parameters[x], title) for x in self.channels]
370
370
371 class WeatherPlot(Plot):
371 class WeatherPlot(Plot):
372 CODE = 'weather'
372 CODE = 'weather'
373 plot_name = 'weather'
373 plot_name = 'weather'
374 plot_type = 'ppistyle'
374 plot_type = 'ppistyle'
375 buffering = False
375 buffering = False
376
376
377 def setup(self):
377 def setup(self):
378 self.ncols = 1
378 self.ncols = 1
379 self.nrows = 1
379 self.nrows = 1
380 self.nplots= 1
380 self.nplots= 1
381 self.ylabel= 'Range [Km]'
381 self.ylabel= 'Range [Km]'
382 self.titles= ['Weather']
382 self.titles= ['Weather']
383 self.colorbar=False
383 self.colorbar=False
384 self.width =8
384 self.width =8
385 self.height =8
385 self.height =8
386 self.ini =0
386 self.ini =0
387 self.len_azi =0
387 self.len_azi =0
388 self.buffer_ini = None
388 self.buffer_ini = None
389 self.buffer_azi = None
389 self.buffer_azi = None
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
393
394 def update(self, dataOut):
394 def update(self, dataOut):
395
395
396 data = {}
396 data = {}
397 meta = {}
397 meta = {}
398 data['weather'] = 10*numpy.log10(dataOut.data_360[0]/(250.0))
398 if hasattr(dataOut, 'dataPP_POWER'):
399 factor = 1
400
401 if hasattr(dataOut, 'nFFTPoints'):
402 factor = dataOut.normFactor
403
404 print("factor",factor)
405 data['weather'] = 10*numpy.log10(dataOut.data_360[0]/(factor))
406 print("weather",data['weather'])
399 data['azi'] = dataOut.data_azi
407 data['azi'] = dataOut.data_azi
400 return data, meta
408 return data, meta
401
409
402 def const_ploteo(self,data_weather,data_azi,step,res):
410 def const_ploteo(self,data_weather,data_azi,step,res):
403 if self.ini==0:
411 if self.ini==0:
404 #------- AZIMUTH
412 #------- AZIMUTH
405 n = (360/res)-len(data_azi)
413 n = (360/res)-len(data_azi)
406 start = data_azi[-1] + res
414 start = data_azi[-1] + res
407 end = data_azi[0] - res
415 end = data_azi[0] - res
408 if start>end:
416 if start>end:
409 end = end + 360
417 end = end + 360
410 azi_vacia = numpy.linspace(start,end,int(n))
418 azi_vacia = numpy.linspace(start,end,int(n))
411 azi_vacia = numpy.where(azi_vacia>360,azi_vacia-360,azi_vacia)
419 azi_vacia = numpy.where(azi_vacia>360,azi_vacia-360,azi_vacia)
412 data_azi = numpy.hstack((data_azi,azi_vacia))
420 data_azi = numpy.hstack((data_azi,azi_vacia))
413 # RADAR
421 # RADAR
414 val_mean = numpy.mean(data_weather[:,0])
422 val_mean = numpy.mean(data_weather[:,0])
415 data_weather_cmp = numpy.ones([(360-data_weather.shape[0]),data_weather.shape[1]])*val_mean
423 data_weather_cmp = numpy.ones([(360-data_weather.shape[0]),data_weather.shape[1]])*val_mean
416 data_weather = numpy.vstack((data_weather,data_weather_cmp))
424 data_weather = numpy.vstack((data_weather,data_weather_cmp))
417 else:
425 else:
418 # azimuth
426 # azimuth
419 flag=0
427 flag=0
420 start_azi = self.res_azi[0]
428 start_azi = self.res_azi[0]
421 start = data_azi[0]
429 start = data_azi[0]
422 end = data_azi[-1]
430 end = data_azi[-1]
423 print("start",start)
431 print("start",start)
424 print("end",end)
432 print("end",end)
425 if start< start_azi:
433 if start< start_azi:
426 start = start +360
434 start = start +360
427 if end <start_azi:
435 if end <start_azi:
428 end = end +360
436 end = end +360
429
437
430 print("start",start)
438 print("start",start)
431 print("end",end)
439 print("end",end)
432 #### AQUI SERA LA MAGIA
440 #### AQUI SERA LA MAGIA
433 pos_ini = int((start-start_azi)/res)
441 pos_ini = int((start-start_azi)/res)
434 len_azi = len(data_azi)
442 len_azi = len(data_azi)
435 if (360-pos_ini)<len_azi:
443 if (360-pos_ini)<len_azi:
436 if pos_ini+1==360:
444 if pos_ini+1==360:
437 pos_ini=0
445 pos_ini=0
438 else:
446 else:
439 flag=1
447 flag=1
440 dif= 360-pos_ini
448 dif= 360-pos_ini
441 comp= len_azi-dif
449 comp= len_azi-dif
442
450
443 print(pos_ini)
451 print(pos_ini)
444 print(len_azi)
452 print(len_azi)
445 print("shape",self.res_azi.shape)
453 print("shape",self.res_azi.shape)
446 if flag==0:
454 if flag==0:
447 # AZIMUTH
455 # AZIMUTH
448 self.res_azi[pos_ini:pos_ini+len_azi] = data_azi
456 self.res_azi[pos_ini:pos_ini+len_azi] = data_azi
449 # RADAR
457 # RADAR
450 self.res_weather[pos_ini:pos_ini+len_azi,:] = data_weather
458 self.res_weather[pos_ini:pos_ini+len_azi,:] = data_weather
451 else:
459 else:
452 # AZIMUTH
460 # AZIMUTH
453 self.res_azi[pos_ini:pos_ini+dif] = data_azi[0:dif]
461 self.res_azi[pos_ini:pos_ini+dif] = data_azi[0:dif]
454 self.res_azi[0:comp] = data_azi[dif:]
462 self.res_azi[0:comp] = data_azi[dif:]
455 # RADAR
463 # RADAR
456 self.res_weather[pos_ini:pos_ini+dif,:] = data_weather[0:dif,:]
464 self.res_weather[pos_ini:pos_ini+dif,:] = data_weather[0:dif,:]
457 self.res_weather[0:comp,:] = data_weather[dif:,:]
465 self.res_weather[0:comp,:] = data_weather[dif:,:]
458 flag=0
466 flag=0
459 data_azi = self.res_azi
467 data_azi = self.res_azi
460 data_weather = self.res_weather
468 data_weather = self.res_weather
461
469
462 return data_weather,data_azi
470 return data_weather,data_azi
463
471
464 def plot(self):
472 def plot(self):
465 print("--------------------------------------",self.ini,"-----------------------------------")
473 print("--------------------------------------",self.ini,"-----------------------------------")
466 #numpy.set_printoptions(suppress=True)
474 #numpy.set_printoptions(suppress=True)
467 #print(self.data.times)
475 #print(self.data.times)
468 thisDatetime = datetime.datetime.utcfromtimestamp(self.data.times[-1])
476 thisDatetime = datetime.datetime.utcfromtimestamp(self.data.times[-1])
469 data = self.data[-1]
477 data = self.data[-1]
470 # ALTURA altura_tmp_h
478 # ALTURA altura_tmp_h
471 altura_h = (data['weather'].shape[1])/10.0
479 altura_h = (data['weather'].shape[1])/10.0
472 stoprange = float(altura_h*1.5)#stoprange = float(33*1.5) por ahora 400
480 stoprange = float(altura_h*1.5)#stoprange = float(33*1.5) por ahora 400
473 rangestep = float(0.15)
481 rangestep = float(0.15)
474 r = numpy.arange(0, stoprange, rangestep)
482 r = numpy.arange(0, stoprange, rangestep)
475 self.y = 2*r
483 self.y = 2*r
476 # RADAR
484 # RADAR
477 #data_weather = data['weather']
485 #data_weather = data['weather']
478 # PEDESTAL
486 # PEDESTAL
479 #data_azi = data['azi']
487 #data_azi = data['azi']
480 res = 1
488 res = 1
481 # STEP
489 # STEP
482 step = (360/(res*data['weather'].shape[0]))
490 step = (360/(res*data['weather'].shape[0]))
483 #print("shape wr_data", wr_data.shape)
491 #print("shape wr_data", wr_data.shape)
484 #print("shape wr_azi",wr_azi.shape)
492 #print("shape wr_azi",wr_azi.shape)
485 #print("step",step)
493 #print("step",step)
486 print("Time---->",self.data.times[-1],thisDatetime)
494 print("Time---->",self.data.times[-1],thisDatetime)
487 #print("alturas", len(self.y))
495 #print("alturas", len(self.y))
488 self.res_weather, self.res_azi = self.const_ploteo(data_weather=data['weather'],data_azi=data['azi'],step=step,res=res)
496 self.res_weather, self.res_azi = self.const_ploteo(data_weather=data['weather'],data_azi=data['azi'],step=step,res=res)
489 #numpy.set_printoptions(suppress=True)
497 #numpy.set_printoptions(suppress=True)
490 #print("resultado",self.res_azi)
498 #print("resultado",self.res_azi)
491 ##########################################################
499 ##########################################################
492 ################# PLOTEO ###################
500 ################# PLOTEO ###################
493 ##########################################################
501 ##########################################################
494
502
495 for i,ax in enumerate(self.axes):
503 for i,ax in enumerate(self.axes):
496 if ax.firsttime:
504 if ax.firsttime:
497 plt.clf()
505 plt.clf()
498 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)
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)
499 else:
507 else:
500 plt.clf()
508 plt.clf()
501 cgax, pm = wrl.vis.plot_ppi(self.res_weather,r=r,az=self.res_azi,fig=self.figures[0], proj='cg', vmin=0, vmax=60)
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)
502 caax = cgax.parasites[0]
510 caax = cgax.parasites[0]
503 paax = cgax.parasites[1]
511 paax = cgax.parasites[1]
504 cbar = plt.gcf().colorbar(pm, pad=0.075)
512 cbar = plt.gcf().colorbar(pm, pad=0.075)
505 caax.set_xlabel('x_range [km]')
513 caax.set_xlabel('x_range [km]')
506 caax.set_ylabel('y_range [km]')
514 caax.set_ylabel('y_range [km]')
507 plt.text(1.0, 1.05, 'azimuth '+str(thisDatetime)+"step"+str(self.ini), transform=caax.transAxes, va='bottom',ha='right')
515 plt.text(1.0, 1.05, 'azimuth '+str(thisDatetime)+"step"+str(self.ini), transform=caax.transAxes, va='bottom',ha='right')
508
516
509 self.ini= self.ini+1
517 self.ini= self.ini+1
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,898 +1,898
1 # Copyright (c) 2012-2020 Jicamarca Radio Observatory
1 # Copyright (c) 2012-2020 Jicamarca Radio Observatory
2 # All rights reserved.
2 # All rights reserved.
3 #
3 #
4 # Distributed under the terms of the BSD 3-clause license.
4 # Distributed under the terms of the BSD 3-clause license.
5 """Spectra processing Unit and operations
5 """Spectra processing Unit and operations
6
6
7 Here you will find the processing unit `SpectraProc` and several operations
7 Here you will find the processing unit `SpectraProc` and several operations
8 to work with Spectra data type
8 to work with Spectra data type
9 """
9 """
10
10
11 import time
11 import time
12 import itertools
12 import itertools
13
13
14 import numpy
14 import numpy
15
15
16 from schainpy.model.proc.jroproc_base import ProcessingUnit, MPDecorator, Operation
16 from schainpy.model.proc.jroproc_base import ProcessingUnit, MPDecorator, Operation
17 from schainpy.model.data.jrodata import Spectra
17 from schainpy.model.data.jrodata import Spectra
18 from schainpy.model.data.jrodata import hildebrand_sekhon
18 from schainpy.model.data.jrodata import hildebrand_sekhon
19 from schainpy.utils import log
19 from schainpy.utils import log
20
20
21
21
22 class SpectraProc(ProcessingUnit):
22 class SpectraProc(ProcessingUnit):
23
23
24 def __init__(self):
24 def __init__(self):
25
25
26 ProcessingUnit.__init__(self)
26 ProcessingUnit.__init__(self)
27
27
28 self.buffer = None
28 self.buffer = None
29 self.firstdatatime = None
29 self.firstdatatime = None
30 self.profIndex = 0
30 self.profIndex = 0
31 self.dataOut = Spectra()
31 self.dataOut = Spectra()
32 self.id_min = None
32 self.id_min = None
33 self.id_max = None
33 self.id_max = None
34 self.setupReq = False #Agregar a todas las unidades de proc
34 self.setupReq = False #Agregar a todas las unidades de proc
35
35
36 def __updateSpecFromVoltage(self):
36 def __updateSpecFromVoltage(self):
37
37
38 self.dataOut.timeZone = self.dataIn.timeZone
38 self.dataOut.timeZone = self.dataIn.timeZone
39 self.dataOut.dstFlag = self.dataIn.dstFlag
39 self.dataOut.dstFlag = self.dataIn.dstFlag
40 self.dataOut.errorCount = self.dataIn.errorCount
40 self.dataOut.errorCount = self.dataIn.errorCount
41 self.dataOut.useLocalTime = self.dataIn.useLocalTime
41 self.dataOut.useLocalTime = self.dataIn.useLocalTime
42 try:
42 try:
43 self.dataOut.processingHeaderObj = self.dataIn.processingHeaderObj.copy()
43 self.dataOut.processingHeaderObj = self.dataIn.processingHeaderObj.copy()
44 except:
44 except:
45 pass
45 pass
46 self.dataOut.radarControllerHeaderObj = self.dataIn.radarControllerHeaderObj.copy()
46 self.dataOut.radarControllerHeaderObj = self.dataIn.radarControllerHeaderObj.copy()
47 self.dataOut.systemHeaderObj = self.dataIn.systemHeaderObj.copy()
47 self.dataOut.systemHeaderObj = self.dataIn.systemHeaderObj.copy()
48 self.dataOut.channelList = self.dataIn.channelList
48 self.dataOut.channelList = self.dataIn.channelList
49 self.dataOut.heightList = self.dataIn.heightList
49 self.dataOut.heightList = self.dataIn.heightList
50 self.dataOut.dtype = numpy.dtype([('real', '<f4'), ('imag', '<f4')])
50 self.dataOut.dtype = numpy.dtype([('real', '<f4'), ('imag', '<f4')])
51 self.dataOut.nProfiles = self.dataOut.nFFTPoints
51 self.dataOut.nProfiles = self.dataOut.nFFTPoints
52 self.dataOut.flagDiscontinuousBlock = self.dataIn.flagDiscontinuousBlock
52 self.dataOut.flagDiscontinuousBlock = self.dataIn.flagDiscontinuousBlock
53 self.dataOut.utctime = self.firstdatatime
53 self.dataOut.utctime = self.firstdatatime
54 self.dataOut.flagDecodeData = self.dataIn.flagDecodeData
54 self.dataOut.flagDecodeData = self.dataIn.flagDecodeData
55 self.dataOut.flagDeflipData = self.dataIn.flagDeflipData
55 self.dataOut.flagDeflipData = self.dataIn.flagDeflipData
56 self.dataOut.flagShiftFFT = False
56 self.dataOut.flagShiftFFT = False
57 self.dataOut.nCohInt = self.dataIn.nCohInt
57 self.dataOut.nCohInt = self.dataIn.nCohInt
58 self.dataOut.nIncohInt = 1
58 self.dataOut.nIncohInt = 1
59 self.dataOut.windowOfFilter = self.dataIn.windowOfFilter
59 self.dataOut.windowOfFilter = self.dataIn.windowOfFilter
60 self.dataOut.frequency = self.dataIn.frequency
60 self.dataOut.frequency = self.dataIn.frequency
61 self.dataOut.realtime = self.dataIn.realtime
61 self.dataOut.realtime = self.dataIn.realtime
62 self.dataOut.azimuth = self.dataIn.azimuth
62 self.dataOut.azimuth = self.dataIn.azimuth
63 self.dataOut.zenith = self.dataIn.zenith
63 self.dataOut.zenith = self.dataIn.zenith
64 self.dataOut.beam.codeList = self.dataIn.beam.codeList
64 self.dataOut.beam.codeList = self.dataIn.beam.codeList
65 self.dataOut.beam.azimuthList = self.dataIn.beam.azimuthList
65 self.dataOut.beam.azimuthList = self.dataIn.beam.azimuthList
66 self.dataOut.beam.zenithList = self.dataIn.beam.zenithList
66 self.dataOut.beam.zenithList = self.dataIn.beam.zenithList
67
67
68 def __getFft(self):
68 def __getFft(self):
69 """
69 """
70 Convierte valores de Voltaje a Spectra
70 Convierte valores de Voltaje a Spectra
71
71
72 Affected:
72 Affected:
73 self.dataOut.data_spc
73 self.dataOut.data_spc
74 self.dataOut.data_cspc
74 self.dataOut.data_cspc
75 self.dataOut.data_dc
75 self.dataOut.data_dc
76 self.dataOut.heightList
76 self.dataOut.heightList
77 self.profIndex
77 self.profIndex
78 self.buffer
78 self.buffer
79 self.dataOut.flagNoData
79 self.dataOut.flagNoData
80 """
80 """
81 fft_volt = numpy.fft.fft(
81 fft_volt = numpy.fft.fft(
82 self.buffer, n=self.dataOut.nFFTPoints, axis=1)
82 self.buffer, n=self.dataOut.nFFTPoints, axis=1)
83 fft_volt = fft_volt.astype(numpy.dtype('complex'))
83 fft_volt = fft_volt.astype(numpy.dtype('complex'))
84 dc = fft_volt[:, 0, :]
84 dc = fft_volt[:, 0, :]
85
85
86 # calculo de self-spectra
86 # calculo de self-spectra
87 fft_volt = numpy.fft.fftshift(fft_volt, axes=(1,))
87 fft_volt = numpy.fft.fftshift(fft_volt, axes=(1,))
88 spc = fft_volt * numpy.conjugate(fft_volt)
88 spc = fft_volt * numpy.conjugate(fft_volt)
89 spc = spc.real
89 spc = spc.real
90
90
91 blocksize = 0
91 blocksize = 0
92 blocksize += dc.size
92 blocksize += dc.size
93 blocksize += spc.size
93 blocksize += spc.size
94
94
95 cspc = None
95 cspc = None
96 pairIndex = 0
96 pairIndex = 0
97 if self.dataOut.pairsList != None:
97 if self.dataOut.pairsList != None:
98 # calculo de cross-spectra
98 # calculo de cross-spectra
99 cspc = numpy.zeros(
99 cspc = numpy.zeros(
100 (self.dataOut.nPairs, self.dataOut.nFFTPoints, self.dataOut.nHeights), dtype='complex')
100 (self.dataOut.nPairs, self.dataOut.nFFTPoints, self.dataOut.nHeights), dtype='complex')
101 for pair in self.dataOut.pairsList:
101 for pair in self.dataOut.pairsList:
102 if pair[0] not in self.dataOut.channelList:
102 if pair[0] not in self.dataOut.channelList:
103 raise ValueError("Error getting CrossSpectra: pair 0 of %s is not in channelList = %s" % (
103 raise ValueError("Error getting CrossSpectra: pair 0 of %s is not in channelList = %s" % (
104 str(pair), str(self.dataOut.channelList)))
104 str(pair), str(self.dataOut.channelList)))
105 if pair[1] not in self.dataOut.channelList:
105 if pair[1] not in self.dataOut.channelList:
106 raise ValueError("Error getting CrossSpectra: pair 1 of %s is not in channelList = %s" % (
106 raise ValueError("Error getting CrossSpectra: pair 1 of %s is not in channelList = %s" % (
107 str(pair), str(self.dataOut.channelList)))
107 str(pair), str(self.dataOut.channelList)))
108
108
109 cspc[pairIndex, :, :] = fft_volt[pair[0], :, :] * \
109 cspc[pairIndex, :, :] = fft_volt[pair[0], :, :] * \
110 numpy.conjugate(fft_volt[pair[1], :, :])
110 numpy.conjugate(fft_volt[pair[1], :, :])
111 pairIndex += 1
111 pairIndex += 1
112 blocksize += cspc.size
112 blocksize += cspc.size
113
113
114 self.dataOut.data_spc = spc
114 self.dataOut.data_spc = spc
115 self.dataOut.data_cspc = cspc
115 self.dataOut.data_cspc = cspc
116 self.dataOut.data_dc = dc
116 self.dataOut.data_dc = dc
117 self.dataOut.blockSize = blocksize
117 self.dataOut.blockSize = blocksize
118 self.dataOut.flagShiftFFT = False
118 self.dataOut.flagShiftFFT = False
119
119
120 def run(self, nProfiles=None, nFFTPoints=None, pairsList=None, ippFactor=None, shift_fft=False):
120 def run(self, nProfiles=None, nFFTPoints=None, pairsList=None, ippFactor=None, shift_fft=False):
121
121
122 if self.dataIn.type == "Spectra":
122 if self.dataIn.type == "Spectra":
123 self.dataOut.copy(self.dataIn)
123 self.dataOut.copy(self.dataIn)
124 if shift_fft:
124 if shift_fft:
125 #desplaza a la derecha en el eje 2 determinadas posiciones
125 #desplaza a la derecha en el eje 2 determinadas posiciones
126 shift = int(self.dataOut.nFFTPoints/2)
126 shift = int(self.dataOut.nFFTPoints/2)
127 self.dataOut.data_spc = numpy.roll(self.dataOut.data_spc, shift , axis=1)
127 self.dataOut.data_spc = numpy.roll(self.dataOut.data_spc, shift , axis=1)
128
128
129 if self.dataOut.data_cspc is not None:
129 if self.dataOut.data_cspc is not None:
130 #desplaza a la derecha en el eje 2 determinadas posiciones
130 #desplaza a la derecha en el eje 2 determinadas posiciones
131 self.dataOut.data_cspc = numpy.roll(self.dataOut.data_cspc, shift, axis=1)
131 self.dataOut.data_cspc = numpy.roll(self.dataOut.data_cspc, shift, axis=1)
132 if pairsList:
132 if pairsList:
133 self.__selectPairs(pairsList)
133 self.__selectPairs(pairsList)
134
134
135 elif self.dataIn.type == "Voltage":
135 elif self.dataIn.type == "Voltage":
136
136
137 self.dataOut.flagNoData = True
137 self.dataOut.flagNoData = True
138
138
139 if nFFTPoints == None:
139 if nFFTPoints == None:
140 raise ValueError("This SpectraProc.run() need nFFTPoints input variable")
140 raise ValueError("This SpectraProc.run() need nFFTPoints input variable")
141
141
142 if nProfiles == None:
142 if nProfiles == None:
143 nProfiles = nFFTPoints
143 nProfiles = nFFTPoints
144
144
145 if ippFactor == None:
145 if ippFactor == None:
146 self.dataOut.ippFactor = 1
146 self.dataOut.ippFactor = 1
147
147
148 self.dataOut.nFFTPoints = nFFTPoints
148 self.dataOut.nFFTPoints = nFFTPoints
149
149
150 if self.buffer is None:
150 if self.buffer is None:
151 self.buffer = numpy.zeros((self.dataIn.nChannels,
151 self.buffer = numpy.zeros((self.dataIn.nChannels,
152 nProfiles,
152 nProfiles,
153 self.dataIn.nHeights),
153 self.dataIn.nHeights),
154 dtype='complex')
154 dtype='complex')
155
155
156 if self.dataIn.flagDataAsBlock:
156 if self.dataIn.flagDataAsBlock:
157 nVoltProfiles = self.dataIn.data.shape[1]
157 nVoltProfiles = self.dataIn.data.shape[1]
158
158
159 if nVoltProfiles == nProfiles:
159 if nVoltProfiles == nProfiles:
160 self.buffer = self.dataIn.data.copy()
160 self.buffer = self.dataIn.data.copy()
161 self.profIndex = nVoltProfiles
161 self.profIndex = nVoltProfiles
162
162
163 elif nVoltProfiles < nProfiles:
163 elif nVoltProfiles < nProfiles:
164
164
165 if self.profIndex == 0:
165 if self.profIndex == 0:
166 self.id_min = 0
166 self.id_min = 0
167 self.id_max = nVoltProfiles
167 self.id_max = nVoltProfiles
168
168
169 self.buffer[:, self.id_min:self.id_max,
169 self.buffer[:, self.id_min:self.id_max,
170 :] = self.dataIn.data
170 :] = self.dataIn.data
171 self.profIndex += nVoltProfiles
171 self.profIndex += nVoltProfiles
172 self.id_min += nVoltProfiles
172 self.id_min += nVoltProfiles
173 self.id_max += nVoltProfiles
173 self.id_max += nVoltProfiles
174 else:
174 else:
175 raise ValueError("The type object %s has %d profiles, it should just has %d profiles" % (
175 raise ValueError("The type object %s has %d profiles, it should just has %d profiles" % (
176 self.dataIn.type, self.dataIn.data.shape[1], nProfiles))
176 self.dataIn.type, self.dataIn.data.shape[1], nProfiles))
177 self.dataOut.flagNoData = True
177 self.dataOut.flagNoData = True
178 else:
178 else:
179 self.buffer[:, self.profIndex, :] = self.dataIn.data.copy()
179 self.buffer[:, self.profIndex, :] = self.dataIn.data.copy()
180 self.profIndex += 1
180 self.profIndex += 1
181
181
182 if self.firstdatatime == None:
182 if self.firstdatatime == None:
183 self.firstdatatime = self.dataIn.utctime
183 self.firstdatatime = self.dataIn.utctime
184
184
185 if self.profIndex == nProfiles:
185 if self.profIndex == nProfiles:
186 self.__updateSpecFromVoltage()
186 self.__updateSpecFromVoltage()
187 if pairsList == None:
187 if pairsList == None:
188 self.dataOut.pairsList = [pair for pair in itertools.combinations(self.dataOut.channelList, 2)]
188 self.dataOut.pairsList = [pair for pair in itertools.combinations(self.dataOut.channelList, 2)]
189 else:
189 else:
190 self.dataOut.pairsList = pairsList
190 self.dataOut.pairsList = pairsList
191 self.__getFft()
191 self.__getFft()
192 self.dataOut.flagNoData = False
192 self.dataOut.flagNoData = False
193 self.firstdatatime = None
193 self.firstdatatime = None
194 self.profIndex = 0
194 self.profIndex = 0
195 else:
195 else:
196 raise ValueError("The type of input object '%s' is not valid".format(
196 raise ValueError("The type of input object '%s' is not valid".format(
197 self.dataIn.type))
197 self.dataIn.type))
198
198
199 def __selectPairs(self, pairsList):
199 def __selectPairs(self, pairsList):
200
200
201 if not pairsList:
201 if not pairsList:
202 return
202 return
203
203
204 pairs = []
204 pairs = []
205 pairsIndex = []
205 pairsIndex = []
206
206
207 for pair in pairsList:
207 for pair in pairsList:
208 if pair[0] not in self.dataOut.channelList or pair[1] not in self.dataOut.channelList:
208 if pair[0] not in self.dataOut.channelList or pair[1] not in self.dataOut.channelList:
209 continue
209 continue
210 pairs.append(pair)
210 pairs.append(pair)
211 pairsIndex.append(pairs.index(pair))
211 pairsIndex.append(pairs.index(pair))
212
212
213 self.dataOut.data_cspc = self.dataOut.data_cspc[pairsIndex]
213 self.dataOut.data_cspc = self.dataOut.data_cspc[pairsIndex]
214 self.dataOut.pairsList = pairs
214 self.dataOut.pairsList = pairs
215
215
216 return
216 return
217
217
218 def selectFFTs(self, minFFT, maxFFT ):
218 def selectFFTs(self, minFFT, maxFFT ):
219 """
219 """
220 Selecciona un bloque de datos en base a un grupo de valores de puntos FFTs segun el rango
220 Selecciona un bloque de datos en base a un grupo de valores de puntos FFTs segun el rango
221 minFFT<= FFT <= maxFFT
221 minFFT<= FFT <= maxFFT
222 """
222 """
223
223
224 if (minFFT > maxFFT):
224 if (minFFT > maxFFT):
225 raise ValueError("Error selecting heights: Height range (%d,%d) is not valid" % (minFFT, maxFFT))
225 raise ValueError("Error selecting heights: Height range (%d,%d) is not valid" % (minFFT, maxFFT))
226
226
227 if (minFFT < self.dataOut.getFreqRange()[0]):
227 if (minFFT < self.dataOut.getFreqRange()[0]):
228 minFFT = self.dataOut.getFreqRange()[0]
228 minFFT = self.dataOut.getFreqRange()[0]
229
229
230 if (maxFFT > self.dataOut.getFreqRange()[-1]):
230 if (maxFFT > self.dataOut.getFreqRange()[-1]):
231 maxFFT = self.dataOut.getFreqRange()[-1]
231 maxFFT = self.dataOut.getFreqRange()[-1]
232
232
233 minIndex = 0
233 minIndex = 0
234 maxIndex = 0
234 maxIndex = 0
235 FFTs = self.dataOut.getFreqRange()
235 FFTs = self.dataOut.getFreqRange()
236
236
237 inda = numpy.where(FFTs >= minFFT)
237 inda = numpy.where(FFTs >= minFFT)
238 indb = numpy.where(FFTs <= maxFFT)
238 indb = numpy.where(FFTs <= maxFFT)
239
239
240 try:
240 try:
241 minIndex = inda[0][0]
241 minIndex = inda[0][0]
242 except:
242 except:
243 minIndex = 0
243 minIndex = 0
244
244
245 try:
245 try:
246 maxIndex = indb[0][-1]
246 maxIndex = indb[0][-1]
247 except:
247 except:
248 maxIndex = len(FFTs)
248 maxIndex = len(FFTs)
249
249
250 self.selectFFTsByIndex(minIndex, maxIndex)
250 self.selectFFTsByIndex(minIndex, maxIndex)
251
251
252 return 1
252 return 1
253
253
254 def getBeaconSignal(self, tauindex=0, channelindex=0, hei_ref=None):
254 def getBeaconSignal(self, tauindex=0, channelindex=0, hei_ref=None):
255 newheis = numpy.where(
255 newheis = numpy.where(
256 self.dataOut.heightList > self.dataOut.radarControllerHeaderObj.Taus[tauindex])
256 self.dataOut.heightList > self.dataOut.radarControllerHeaderObj.Taus[tauindex])
257
257
258 if hei_ref != None:
258 if hei_ref != None:
259 newheis = numpy.where(self.dataOut.heightList > hei_ref)
259 newheis = numpy.where(self.dataOut.heightList > hei_ref)
260
260
261 minIndex = min(newheis[0])
261 minIndex = min(newheis[0])
262 maxIndex = max(newheis[0])
262 maxIndex = max(newheis[0])
263 data_spc = self.dataOut.data_spc[:, :, minIndex:maxIndex + 1]
263 data_spc = self.dataOut.data_spc[:, :, minIndex:maxIndex + 1]
264 heightList = self.dataOut.heightList[minIndex:maxIndex + 1]
264 heightList = self.dataOut.heightList[minIndex:maxIndex + 1]
265
265
266 # determina indices
266 # determina indices
267 nheis = int(self.dataOut.radarControllerHeaderObj.txB /
267 nheis = int(self.dataOut.radarControllerHeaderObj.txB /
268 (self.dataOut.heightList[1] - self.dataOut.heightList[0]))
268 (self.dataOut.heightList[1] - self.dataOut.heightList[0]))
269 avg_dB = 10 * \
269 avg_dB = 10 * \
270 numpy.log10(numpy.sum(data_spc[channelindex, :, :], axis=0))
270 numpy.log10(numpy.sum(data_spc[channelindex, :, :], axis=0))
271 beacon_dB = numpy.sort(avg_dB)[-nheis:]
271 beacon_dB = numpy.sort(avg_dB)[-nheis:]
272 beacon_heiIndexList = []
272 beacon_heiIndexList = []
273 for val in avg_dB.tolist():
273 for val in avg_dB.tolist():
274 if val >= beacon_dB[0]:
274 if val >= beacon_dB[0]:
275 beacon_heiIndexList.append(avg_dB.tolist().index(val))
275 beacon_heiIndexList.append(avg_dB.tolist().index(val))
276
276
277 #data_spc = data_spc[:,:,beacon_heiIndexList]
277 #data_spc = data_spc[:,:,beacon_heiIndexList]
278 data_cspc = None
278 data_cspc = None
279 if self.dataOut.data_cspc is not None:
279 if self.dataOut.data_cspc is not None:
280 data_cspc = self.dataOut.data_cspc[:, :, minIndex:maxIndex + 1]
280 data_cspc = self.dataOut.data_cspc[:, :, minIndex:maxIndex + 1]
281 #data_cspc = data_cspc[:,:,beacon_heiIndexList]
281 #data_cspc = data_cspc[:,:,beacon_heiIndexList]
282
282
283 data_dc = None
283 data_dc = None
284 if self.dataOut.data_dc is not None:
284 if self.dataOut.data_dc is not None:
285 data_dc = self.dataOut.data_dc[:, minIndex:maxIndex + 1]
285 data_dc = self.dataOut.data_dc[:, minIndex:maxIndex + 1]
286 #data_dc = data_dc[:,beacon_heiIndexList]
286 #data_dc = data_dc[:,beacon_heiIndexList]
287
287
288 self.dataOut.data_spc = data_spc
288 self.dataOut.data_spc = data_spc
289 self.dataOut.data_cspc = data_cspc
289 self.dataOut.data_cspc = data_cspc
290 self.dataOut.data_dc = data_dc
290 self.dataOut.data_dc = data_dc
291 self.dataOut.heightList = heightList
291 self.dataOut.heightList = heightList
292 self.dataOut.beacon_heiIndexList = beacon_heiIndexList
292 self.dataOut.beacon_heiIndexList = beacon_heiIndexList
293
293
294 return 1
294 return 1
295
295
296 def selectFFTsByIndex(self, minIndex, maxIndex):
296 def selectFFTsByIndex(self, minIndex, maxIndex):
297 """
297 """
298
298
299 """
299 """
300
300
301 if (minIndex < 0) or (minIndex > maxIndex):
301 if (minIndex < 0) or (minIndex > maxIndex):
302 raise ValueError("Error selecting heights: Index range (%d,%d) is not valid" % (minIndex, maxIndex))
302 raise ValueError("Error selecting heights: Index range (%d,%d) is not valid" % (minIndex, maxIndex))
303
303
304 if (maxIndex >= self.dataOut.nProfiles):
304 if (maxIndex >= self.dataOut.nProfiles):
305 maxIndex = self.dataOut.nProfiles-1
305 maxIndex = self.dataOut.nProfiles-1
306
306
307 #Spectra
307 #Spectra
308 data_spc = self.dataOut.data_spc[:,minIndex:maxIndex+1,:]
308 data_spc = self.dataOut.data_spc[:,minIndex:maxIndex+1,:]
309
309
310 data_cspc = None
310 data_cspc = None
311 if self.dataOut.data_cspc is not None:
311 if self.dataOut.data_cspc is not None:
312 data_cspc = self.dataOut.data_cspc[:,minIndex:maxIndex+1,:]
312 data_cspc = self.dataOut.data_cspc[:,minIndex:maxIndex+1,:]
313
313
314 data_dc = None
314 data_dc = None
315 if self.dataOut.data_dc is not None:
315 if self.dataOut.data_dc is not None:
316 data_dc = self.dataOut.data_dc[minIndex:maxIndex+1,:]
316 data_dc = self.dataOut.data_dc[minIndex:maxIndex+1,:]
317
317
318 self.dataOut.data_spc = data_spc
318 self.dataOut.data_spc = data_spc
319 self.dataOut.data_cspc = data_cspc
319 self.dataOut.data_cspc = data_cspc
320 self.dataOut.data_dc = data_dc
320 self.dataOut.data_dc = data_dc
321
321
322 self.dataOut.ippSeconds = self.dataOut.ippSeconds*(self.dataOut.nFFTPoints / numpy.shape(data_cspc)[1])
322 self.dataOut.ippSeconds = self.dataOut.ippSeconds*(self.dataOut.nFFTPoints / numpy.shape(data_cspc)[1])
323 self.dataOut.nFFTPoints = numpy.shape(data_cspc)[1]
323 self.dataOut.nFFTPoints = numpy.shape(data_cspc)[1]
324 self.dataOut.profilesPerBlock = numpy.shape(data_cspc)[1]
324 self.dataOut.profilesPerBlock = numpy.shape(data_cspc)[1]
325
325
326 return 1
326 return 1
327
327
328 def getNoise(self, minHei=None, maxHei=None, minVel=None, maxVel=None):
328 def getNoise(self, minHei=None, maxHei=None, minVel=None, maxVel=None):
329 # validacion de rango
329 # validacion de rango
330 if minHei == None:
330 if minHei == None:
331 minHei = self.dataOut.heightList[0]
331 minHei = self.dataOut.heightList[0]
332
332
333 if maxHei == None:
333 if maxHei == None:
334 maxHei = self.dataOut.heightList[-1]
334 maxHei = self.dataOut.heightList[-1]
335
335
336 if (minHei < self.dataOut.heightList[0]) or (minHei > maxHei):
336 if (minHei < self.dataOut.heightList[0]) or (minHei > maxHei):
337 print('minHei: %.2f is out of the heights range' % (minHei))
337 print('minHei: %.2f is out of the heights range' % (minHei))
338 print('minHei is setting to %.2f' % (self.dataOut.heightList[0]))
338 print('minHei is setting to %.2f' % (self.dataOut.heightList[0]))
339 minHei = self.dataOut.heightList[0]
339 minHei = self.dataOut.heightList[0]
340
340
341 if (maxHei > self.dataOut.heightList[-1]) or (maxHei < minHei):
341 if (maxHei > self.dataOut.heightList[-1]) or (maxHei < minHei):
342 print('maxHei: %.2f is out of the heights range' % (maxHei))
342 print('maxHei: %.2f is out of the heights range' % (maxHei))
343 print('maxHei is setting to %.2f' % (self.dataOut.heightList[-1]))
343 print('maxHei is setting to %.2f' % (self.dataOut.heightList[-1]))
344 maxHei = self.dataOut.heightList[-1]
344 maxHei = self.dataOut.heightList[-1]
345
345
346 # validacion de velocidades
346 # validacion de velocidades
347 velrange = self.dataOut.getVelRange(1)
347 velrange = self.dataOut.getVelRange(1)
348
348
349 if minVel == None:
349 if minVel == None:
350 minVel = velrange[0]
350 minVel = velrange[0]
351
351
352 if maxVel == None:
352 if maxVel == None:
353 maxVel = velrange[-1]
353 maxVel = velrange[-1]
354
354
355 if (minVel < velrange[0]) or (minVel > maxVel):
355 if (minVel < velrange[0]) or (minVel > maxVel):
356 print('minVel: %.2f is out of the velocity range' % (minVel))
356 print('minVel: %.2f is out of the velocity range' % (minVel))
357 print('minVel is setting to %.2f' % (velrange[0]))
357 print('minVel is setting to %.2f' % (velrange[0]))
358 minVel = velrange[0]
358 minVel = velrange[0]
359
359
360 if (maxVel > velrange[-1]) or (maxVel < minVel):
360 if (maxVel > velrange[-1]) or (maxVel < minVel):
361 print('maxVel: %.2f is out of the velocity range' % (maxVel))
361 print('maxVel: %.2f is out of the velocity range' % (maxVel))
362 print('maxVel is setting to %.2f' % (velrange[-1]))
362 print('maxVel is setting to %.2f' % (velrange[-1]))
363 maxVel = velrange[-1]
363 maxVel = velrange[-1]
364
364
365 # seleccion de indices para rango
365 # seleccion de indices para rango
366 minIndex = 0
366 minIndex = 0
367 maxIndex = 0
367 maxIndex = 0
368 heights = self.dataOut.heightList
368 heights = self.dataOut.heightList
369
369
370 inda = numpy.where(heights >= minHei)
370 inda = numpy.where(heights >= minHei)
371 indb = numpy.where(heights <= maxHei)
371 indb = numpy.where(heights <= maxHei)
372
372
373 try:
373 try:
374 minIndex = inda[0][0]
374 minIndex = inda[0][0]
375 except:
375 except:
376 minIndex = 0
376 minIndex = 0
377
377
378 try:
378 try:
379 maxIndex = indb[0][-1]
379 maxIndex = indb[0][-1]
380 except:
380 except:
381 maxIndex = len(heights)
381 maxIndex = len(heights)
382
382
383 if (minIndex < 0) or (minIndex > maxIndex):
383 if (minIndex < 0) or (minIndex > maxIndex):
384 raise ValueError("some value in (%d,%d) is not valid" % (
384 raise ValueError("some value in (%d,%d) is not valid" % (
385 minIndex, maxIndex))
385 minIndex, maxIndex))
386
386
387 if (maxIndex >= self.dataOut.nHeights):
387 if (maxIndex >= self.dataOut.nHeights):
388 maxIndex = self.dataOut.nHeights - 1
388 maxIndex = self.dataOut.nHeights - 1
389
389
390 # seleccion de indices para velocidades
390 # seleccion de indices para velocidades
391 indminvel = numpy.where(velrange >= minVel)
391 indminvel = numpy.where(velrange >= minVel)
392 indmaxvel = numpy.where(velrange <= maxVel)
392 indmaxvel = numpy.where(velrange <= maxVel)
393 try:
393 try:
394 minIndexVel = indminvel[0][0]
394 minIndexVel = indminvel[0][0]
395 except:
395 except:
396 minIndexVel = 0
396 minIndexVel = 0
397
397
398 try:
398 try:
399 maxIndexVel = indmaxvel[0][-1]
399 maxIndexVel = indmaxvel[0][-1]
400 except:
400 except:
401 maxIndexVel = len(velrange)
401 maxIndexVel = len(velrange)
402
402
403 # seleccion del espectro
403 # seleccion del espectro
404 data_spc = self.dataOut.data_spc[:,
404 data_spc = self.dataOut.data_spc[:,
405 minIndexVel:maxIndexVel + 1, minIndex:maxIndex + 1]
405 minIndexVel:maxIndexVel + 1, minIndex:maxIndex + 1]
406 # estimacion de ruido
406 # estimacion de ruido
407 noise = numpy.zeros(self.dataOut.nChannels)
407 noise = numpy.zeros(self.dataOut.nChannels)
408
408
409 for channel in range(self.dataOut.nChannels):
409 for channel in range(self.dataOut.nChannels):
410 daux = data_spc[channel, :, :]
410 daux = data_spc[channel, :, :]
411 sortdata = numpy.sort(daux, axis=None)
411 sortdata = numpy.sort(daux, axis=None)
412 noise[channel] = hildebrand_sekhon(sortdata, self.dataOut.nIncohInt)
412 noise[channel] = hildebrand_sekhon(sortdata, self.dataOut.nIncohInt)
413
413
414 self.dataOut.noise_estimation = noise.copy()
414 self.dataOut.noise_estimation = noise.copy()
415
415
416 return 1
416 return 1
417
417
418 class removeDC(Operation):
418 class removeDC(Operation):
419
419
420 def run(self, dataOut, mode=2):
420 def run(self, dataOut, mode=2):
421 self.dataOut = dataOut
421 self.dataOut = dataOut
422 jspectra = self.dataOut.data_spc
422 jspectra = self.dataOut.data_spc
423 jcspectra = self.dataOut.data_cspc
423 jcspectra = self.dataOut.data_cspc
424
424
425 num_chan = jspectra.shape[0]
425 num_chan = jspectra.shape[0]
426 num_hei = jspectra.shape[2]
426 num_hei = jspectra.shape[2]
427
427
428 if jcspectra is not None:
428 if jcspectra is not None:
429 jcspectraExist = True
429 jcspectraExist = True
430 num_pairs = jcspectra.shape[0]
430 num_pairs = jcspectra.shape[0]
431 else:
431 else:
432 jcspectraExist = False
432 jcspectraExist = False
433
433
434 freq_dc = int(jspectra.shape[1] / 2)
434 freq_dc = int(jspectra.shape[1] / 2)
435 ind_vel = numpy.array([-2, -1, 1, 2]) + freq_dc
435 ind_vel = numpy.array([-2, -1, 1, 2]) + freq_dc
436 ind_vel = ind_vel.astype(int)
436 ind_vel = ind_vel.astype(int)
437
437
438 if ind_vel[0] < 0:
438 if ind_vel[0] < 0:
439 ind_vel[list(range(0, 1))] = ind_vel[list(range(0, 1))] + self.num_prof
439 ind_vel[list(range(0, 1))] = ind_vel[list(range(0, 1))] + self.num_prof
440
440
441 if mode == 1:
441 if mode == 1:
442 jspectra[:, freq_dc, :] = (
442 jspectra[:, freq_dc, :] = (
443 jspectra[:, ind_vel[1], :] + jspectra[:, ind_vel[2], :]) / 2 # CORRECCION
443 jspectra[:, ind_vel[1], :] + jspectra[:, ind_vel[2], :]) / 2 # CORRECCION
444
444
445 if jcspectraExist:
445 if jcspectraExist:
446 jcspectra[:, freq_dc, :] = (
446 jcspectra[:, freq_dc, :] = (
447 jcspectra[:, ind_vel[1], :] + jcspectra[:, ind_vel[2], :]) / 2
447 jcspectra[:, ind_vel[1], :] + jcspectra[:, ind_vel[2], :]) / 2
448
448
449 if mode == 2:
449 if mode == 2:
450
450
451 vel = numpy.array([-2, -1, 1, 2])
451 vel = numpy.array([-2, -1, 1, 2])
452 xx = numpy.zeros([4, 4])
452 xx = numpy.zeros([4, 4])
453
453
454 for fil in range(4):
454 for fil in range(4):
455 xx[fil, :] = vel[fil]**numpy.asarray(list(range(4)))
455 xx[fil, :] = vel[fil]**numpy.asarray(list(range(4)))
456
456
457 xx_inv = numpy.linalg.inv(xx)
457 xx_inv = numpy.linalg.inv(xx)
458 xx_aux = xx_inv[0, :]
458 xx_aux = xx_inv[0, :]
459
459
460 for ich in range(num_chan):
460 for ich in range(num_chan):
461 yy = jspectra[ich, ind_vel, :]
461 yy = jspectra[ich, ind_vel, :]
462 jspectra[ich, freq_dc, :] = numpy.dot(xx_aux, yy)
462 jspectra[ich, freq_dc, :] = numpy.dot(xx_aux, yy)
463
463
464 junkid = jspectra[ich, freq_dc, :] <= 0
464 junkid = jspectra[ich, freq_dc, :] <= 0
465 cjunkid = sum(junkid)
465 cjunkid = sum(junkid)
466
466
467 if cjunkid.any():
467 if cjunkid.any():
468 jspectra[ich, freq_dc, junkid.nonzero()] = (
468 jspectra[ich, freq_dc, junkid.nonzero()] = (
469 jspectra[ich, ind_vel[1], junkid] + jspectra[ich, ind_vel[2], junkid]) / 2
469 jspectra[ich, ind_vel[1], junkid] + jspectra[ich, ind_vel[2], junkid]) / 2
470
470
471 if jcspectraExist:
471 if jcspectraExist:
472 for ip in range(num_pairs):
472 for ip in range(num_pairs):
473 yy = jcspectra[ip, ind_vel, :]
473 yy = jcspectra[ip, ind_vel, :]
474 jcspectra[ip, freq_dc, :] = numpy.dot(xx_aux, yy)
474 jcspectra[ip, freq_dc, :] = numpy.dot(xx_aux, yy)
475
475
476 self.dataOut.data_spc = jspectra
476 self.dataOut.data_spc = jspectra
477 self.dataOut.data_cspc = jcspectra
477 self.dataOut.data_cspc = jcspectra
478
478
479 return self.dataOut
479 return self.dataOut
480
480
481 class removeInterference(Operation):
481 class removeInterference(Operation):
482
482
483 def removeInterference2(self):
483 def removeInterference2(self):
484
484
485 cspc = self.dataOut.data_cspc
485 cspc = self.dataOut.data_cspc
486 spc = self.dataOut.data_spc
486 spc = self.dataOut.data_spc
487 Heights = numpy.arange(cspc.shape[2])
487 Heights = numpy.arange(cspc.shape[2])
488 realCspc = numpy.abs(cspc)
488 realCspc = numpy.abs(cspc)
489
489
490 for i in range(cspc.shape[0]):
490 for i in range(cspc.shape[0]):
491 LinePower= numpy.sum(realCspc[i], axis=0)
491 LinePower= numpy.sum(realCspc[i], axis=0)
492 Threshold = numpy.amax(LinePower)-numpy.sort(LinePower)[len(Heights)-int(len(Heights)*0.1)]
492 Threshold = numpy.amax(LinePower)-numpy.sort(LinePower)[len(Heights)-int(len(Heights)*0.1)]
493 SelectedHeights = Heights[ numpy.where( LinePower < Threshold ) ]
493 SelectedHeights = Heights[ numpy.where( LinePower < Threshold ) ]
494 InterferenceSum = numpy.sum( realCspc[i,:,SelectedHeights], axis=0 )
494 InterferenceSum = numpy.sum( realCspc[i,:,SelectedHeights], axis=0 )
495 InterferenceThresholdMin = numpy.sort(InterferenceSum)[int(len(InterferenceSum)*0.98)]
495 InterferenceThresholdMin = numpy.sort(InterferenceSum)[int(len(InterferenceSum)*0.98)]
496 InterferenceThresholdMax = numpy.sort(InterferenceSum)[int(len(InterferenceSum)*0.99)]
496 InterferenceThresholdMax = numpy.sort(InterferenceSum)[int(len(InterferenceSum)*0.99)]
497
497
498
498
499 InterferenceRange = numpy.where( ([InterferenceSum > InterferenceThresholdMin]))# , InterferenceSum < InterferenceThresholdMax]) )
499 InterferenceRange = numpy.where( ([InterferenceSum > InterferenceThresholdMin]))# , InterferenceSum < InterferenceThresholdMax]) )
500 #InterferenceRange = numpy.where( ([InterferenceRange < InterferenceThresholdMax]))
500 #InterferenceRange = numpy.where( ([InterferenceRange < InterferenceThresholdMax]))
501 if len(InterferenceRange)<int(cspc.shape[1]*0.3):
501 if len(InterferenceRange)<int(cspc.shape[1]*0.3):
502 cspc[i,InterferenceRange,:] = numpy.NaN
502 cspc[i,InterferenceRange,:] = numpy.NaN
503
503
504 self.dataOut.data_cspc = cspc
504 self.dataOut.data_cspc = cspc
505
505
506 def removeInterference(self, interf = 2, hei_interf = None, nhei_interf = None, offhei_interf = None):
506 def removeInterference(self, interf = 2, hei_interf = None, nhei_interf = None, offhei_interf = None):
507
507
508 jspectra = self.dataOut.data_spc
508 jspectra = self.dataOut.data_spc
509 jcspectra = self.dataOut.data_cspc
509 jcspectra = self.dataOut.data_cspc
510 jnoise = self.dataOut.getNoise()
510 jnoise = self.dataOut.getNoise()
511 num_incoh = self.dataOut.nIncohInt
511 num_incoh = self.dataOut.nIncohInt
512
512
513 num_channel = jspectra.shape[0]
513 num_channel = jspectra.shape[0]
514 num_prof = jspectra.shape[1]
514 num_prof = jspectra.shape[1]
515 num_hei = jspectra.shape[2]
515 num_hei = jspectra.shape[2]
516
516
517 # hei_interf
517 # hei_interf
518 if hei_interf is None:
518 if hei_interf is None:
519 count_hei = int(num_hei / 2)
519 count_hei = int(num_hei / 2)
520 hei_interf = numpy.asmatrix(list(range(count_hei))) + num_hei - count_hei
520 hei_interf = numpy.asmatrix(list(range(count_hei))) + num_hei - count_hei
521 hei_interf = numpy.asarray(hei_interf)[0]
521 hei_interf = numpy.asarray(hei_interf)[0]
522 # nhei_interf
522 # nhei_interf
523 if (nhei_interf == None):
523 if (nhei_interf == None):
524 nhei_interf = 5
524 nhei_interf = 5
525 if (nhei_interf < 1):
525 if (nhei_interf < 1):
526 nhei_interf = 1
526 nhei_interf = 1
527 if (nhei_interf > count_hei):
527 if (nhei_interf > count_hei):
528 nhei_interf = count_hei
528 nhei_interf = count_hei
529 if (offhei_interf == None):
529 if (offhei_interf == None):
530 offhei_interf = 0
530 offhei_interf = 0
531
531
532 ind_hei = list(range(num_hei))
532 ind_hei = list(range(num_hei))
533 # mask_prof = numpy.asarray(range(num_prof - 2)) + 1
533 # mask_prof = numpy.asarray(range(num_prof - 2)) + 1
534 # mask_prof[range(num_prof/2 - 1,len(mask_prof))] += 1
534 # mask_prof[range(num_prof/2 - 1,len(mask_prof))] += 1
535 mask_prof = numpy.asarray(list(range(num_prof)))
535 mask_prof = numpy.asarray(list(range(num_prof)))
536 num_mask_prof = mask_prof.size
536 num_mask_prof = mask_prof.size
537 comp_mask_prof = [0, num_prof / 2]
537 comp_mask_prof = [0, num_prof / 2]
538
538
539 # noise_exist: Determina si la variable jnoise ha sido definida y contiene la informacion del ruido de cada canal
539 # noise_exist: Determina si la variable jnoise ha sido definida y contiene la informacion del ruido de cada canal
540 if (jnoise.size < num_channel or numpy.isnan(jnoise).any()):
540 if (jnoise.size < num_channel or numpy.isnan(jnoise).any()):
541 jnoise = numpy.nan
541 jnoise = numpy.nan
542 noise_exist = jnoise[0] < numpy.Inf
542 noise_exist = jnoise[0] < numpy.Inf
543
543
544 # Subrutina de Remocion de la Interferencia
544 # Subrutina de Remocion de la Interferencia
545 for ich in range(num_channel):
545 for ich in range(num_channel):
546 # Se ordena los espectros segun su potencia (menor a mayor)
546 # Se ordena los espectros segun su potencia (menor a mayor)
547 power = jspectra[ich, mask_prof, :]
547 power = jspectra[ich, mask_prof, :]
548 power = power[:, hei_interf]
548 power = power[:, hei_interf]
549 power = power.sum(axis=0)
549 power = power.sum(axis=0)
550 psort = power.ravel().argsort()
550 psort = power.ravel().argsort()
551
551
552 # Se estima la interferencia promedio en los Espectros de Potencia empleando
552 # Se estima la interferencia promedio en los Espectros de Potencia empleando
553 junkspc_interf = jspectra[ich, :, hei_interf[psort[list(range(
553 junkspc_interf = jspectra[ich, :, hei_interf[psort[list(range(
554 offhei_interf, nhei_interf + offhei_interf))]]]
554 offhei_interf, nhei_interf + offhei_interf))]]]
555
555
556 if noise_exist:
556 if noise_exist:
557 # tmp_noise = jnoise[ich] / num_prof
557 # tmp_noise = jnoise[ich] / num_prof
558 tmp_noise = jnoise[ich]
558 tmp_noise = jnoise[ich]
559 junkspc_interf = junkspc_interf - tmp_noise
559 junkspc_interf = junkspc_interf - tmp_noise
560 #junkspc_interf[:,comp_mask_prof] = 0
560 #junkspc_interf[:,comp_mask_prof] = 0
561
561
562 jspc_interf = junkspc_interf.sum(axis=0) / nhei_interf
562 jspc_interf = junkspc_interf.sum(axis=0) / nhei_interf
563 jspc_interf = jspc_interf.transpose()
563 jspc_interf = jspc_interf.transpose()
564 # Calculando el espectro de interferencia promedio
564 # Calculando el espectro de interferencia promedio
565 noiseid = numpy.where(
565 noiseid = numpy.where(
566 jspc_interf <= tmp_noise / numpy.sqrt(num_incoh))
566 jspc_interf <= tmp_noise / numpy.sqrt(num_incoh))
567 noiseid = noiseid[0]
567 noiseid = noiseid[0]
568 cnoiseid = noiseid.size
568 cnoiseid = noiseid.size
569 interfid = numpy.where(
569 interfid = numpy.where(
570 jspc_interf > tmp_noise / numpy.sqrt(num_incoh))
570 jspc_interf > tmp_noise / numpy.sqrt(num_incoh))
571 interfid = interfid[0]
571 interfid = interfid[0]
572 cinterfid = interfid.size
572 cinterfid = interfid.size
573
573
574 if (cnoiseid > 0):
574 if (cnoiseid > 0):
575 jspc_interf[noiseid] = 0
575 jspc_interf[noiseid] = 0
576
576
577 # Expandiendo los perfiles a limpiar
577 # Expandiendo los perfiles a limpiar
578 if (cinterfid > 0):
578 if (cinterfid > 0):
579 new_interfid = (
579 new_interfid = (
580 numpy.r_[interfid - 1, interfid, interfid + 1] + num_prof) % num_prof
580 numpy.r_[interfid - 1, interfid, interfid + 1] + num_prof) % num_prof
581 new_interfid = numpy.asarray(new_interfid)
581 new_interfid = numpy.asarray(new_interfid)
582 new_interfid = {x for x in new_interfid}
582 new_interfid = {x for x in new_interfid}
583 new_interfid = numpy.array(list(new_interfid))
583 new_interfid = numpy.array(list(new_interfid))
584 new_cinterfid = new_interfid.size
584 new_cinterfid = new_interfid.size
585 else:
585 else:
586 new_cinterfid = 0
586 new_cinterfid = 0
587
587
588 for ip in range(new_cinterfid):
588 for ip in range(new_cinterfid):
589 ind = junkspc_interf[:, new_interfid[ip]].ravel().argsort()
589 ind = junkspc_interf[:, new_interfid[ip]].ravel().argsort()
590 jspc_interf[new_interfid[ip]
590 jspc_interf[new_interfid[ip]
591 ] = junkspc_interf[ind[nhei_interf // 2], new_interfid[ip]]
591 ] = junkspc_interf[ind[nhei_interf // 2], new_interfid[ip]]
592
592
593 jspectra[ich, :, ind_hei] = jspectra[ich, :,
593 jspectra[ich, :, ind_hei] = jspectra[ich, :,
594 ind_hei] - jspc_interf # Corregir indices
594 ind_hei] - jspc_interf # Corregir indices
595
595
596 # Removiendo la interferencia del punto de mayor interferencia
596 # Removiendo la interferencia del punto de mayor interferencia
597 ListAux = jspc_interf[mask_prof].tolist()
597 ListAux = jspc_interf[mask_prof].tolist()
598 maxid = ListAux.index(max(ListAux))
598 maxid = ListAux.index(max(ListAux))
599
599
600 if cinterfid > 0:
600 if cinterfid > 0:
601 for ip in range(cinterfid * (interf == 2) - 1):
601 for ip in range(cinterfid * (interf == 2) - 1):
602 ind = (jspectra[ich, interfid[ip], :] < tmp_noise *
602 ind = (jspectra[ich, interfid[ip], :] < tmp_noise *
603 (1 + 1 / numpy.sqrt(num_incoh))).nonzero()
603 (1 + 1 / numpy.sqrt(num_incoh))).nonzero()
604 cind = len(ind)
604 cind = len(ind)
605
605
606 if (cind > 0):
606 if (cind > 0):
607 jspectra[ich, interfid[ip], ind] = tmp_noise * \
607 jspectra[ich, interfid[ip], ind] = tmp_noise * \
608 (1 + (numpy.random.uniform(cind) - 0.5) /
608 (1 + (numpy.random.uniform(cind) - 0.5) /
609 numpy.sqrt(num_incoh))
609 numpy.sqrt(num_incoh))
610
610
611 ind = numpy.array([-2, -1, 1, 2])
611 ind = numpy.array([-2, -1, 1, 2])
612 xx = numpy.zeros([4, 4])
612 xx = numpy.zeros([4, 4])
613
613
614 for id1 in range(4):
614 for id1 in range(4):
615 xx[:, id1] = ind[id1]**numpy.asarray(list(range(4)))
615 xx[:, id1] = ind[id1]**numpy.asarray(list(range(4)))
616
616
617 xx_inv = numpy.linalg.inv(xx)
617 xx_inv = numpy.linalg.inv(xx)
618 xx = xx_inv[:, 0]
618 xx = xx_inv[:, 0]
619 ind = (ind + maxid + num_mask_prof) % num_mask_prof
619 ind = (ind + maxid + num_mask_prof) % num_mask_prof
620 yy = jspectra[ich, mask_prof[ind], :]
620 yy = jspectra[ich, mask_prof[ind], :]
621 jspectra[ich, mask_prof[maxid], :] = numpy.dot(
621 jspectra[ich, mask_prof[maxid], :] = numpy.dot(
622 yy.transpose(), xx)
622 yy.transpose(), xx)
623
623
624 indAux = (jspectra[ich, :, :] < tmp_noise *
624 indAux = (jspectra[ich, :, :] < tmp_noise *
625 (1 - 1 / numpy.sqrt(num_incoh))).nonzero()
625 (1 - 1 / numpy.sqrt(num_incoh))).nonzero()
626 jspectra[ich, indAux[0], indAux[1]] = tmp_noise * \
626 jspectra[ich, indAux[0], indAux[1]] = tmp_noise * \
627 (1 - 1 / numpy.sqrt(num_incoh))
627 (1 - 1 / numpy.sqrt(num_incoh))
628
628
629 # Remocion de Interferencia en el Cross Spectra
629 # Remocion de Interferencia en el Cross Spectra
630 if jcspectra is None:
630 if jcspectra is None:
631 return jspectra, jcspectra
631 return jspectra, jcspectra
632 num_pairs = int(jcspectra.size / (num_prof * num_hei))
632 num_pairs = int(jcspectra.size / (num_prof * num_hei))
633 jcspectra = jcspectra.reshape(num_pairs, num_prof, num_hei)
633 jcspectra = jcspectra.reshape(num_pairs, num_prof, num_hei)
634
634
635 for ip in range(num_pairs):
635 for ip in range(num_pairs):
636
636
637 #-------------------------------------------
637 #-------------------------------------------
638
638
639 cspower = numpy.abs(jcspectra[ip, mask_prof, :])
639 cspower = numpy.abs(jcspectra[ip, mask_prof, :])
640 cspower = cspower[:, hei_interf]
640 cspower = cspower[:, hei_interf]
641 cspower = cspower.sum(axis=0)
641 cspower = cspower.sum(axis=0)
642
642
643 cspsort = cspower.ravel().argsort()
643 cspsort = cspower.ravel().argsort()
644 junkcspc_interf = jcspectra[ip, :, hei_interf[cspsort[list(range(
644 junkcspc_interf = jcspectra[ip, :, hei_interf[cspsort[list(range(
645 offhei_interf, nhei_interf + offhei_interf))]]]
645 offhei_interf, nhei_interf + offhei_interf))]]]
646 junkcspc_interf = junkcspc_interf.transpose()
646 junkcspc_interf = junkcspc_interf.transpose()
647 jcspc_interf = junkcspc_interf.sum(axis=1) / nhei_interf
647 jcspc_interf = junkcspc_interf.sum(axis=1) / nhei_interf
648
648
649 ind = numpy.abs(jcspc_interf[mask_prof]).ravel().argsort()
649 ind = numpy.abs(jcspc_interf[mask_prof]).ravel().argsort()
650
650
651 median_real = int(numpy.median(numpy.real(
651 median_real = int(numpy.median(numpy.real(
652 junkcspc_interf[mask_prof[ind[list(range(3 * num_prof // 4))]], :])))
652 junkcspc_interf[mask_prof[ind[list(range(3 * num_prof // 4))]], :])))
653 median_imag = int(numpy.median(numpy.imag(
653 median_imag = int(numpy.median(numpy.imag(
654 junkcspc_interf[mask_prof[ind[list(range(3 * num_prof // 4))]], :])))
654 junkcspc_interf[mask_prof[ind[list(range(3 * num_prof // 4))]], :])))
655 comp_mask_prof = [int(e) for e in comp_mask_prof]
655 comp_mask_prof = [int(e) for e in comp_mask_prof]
656 junkcspc_interf[comp_mask_prof, :] = numpy.complex(
656 junkcspc_interf[comp_mask_prof, :] = numpy.complex(
657 median_real, median_imag)
657 median_real, median_imag)
658
658
659 for iprof in range(num_prof):
659 for iprof in range(num_prof):
660 ind = numpy.abs(junkcspc_interf[iprof, :]).ravel().argsort()
660 ind = numpy.abs(junkcspc_interf[iprof, :]).ravel().argsort()
661 jcspc_interf[iprof] = junkcspc_interf[iprof, ind[nhei_interf // 2]]
661 jcspc_interf[iprof] = junkcspc_interf[iprof, ind[nhei_interf // 2]]
662
662
663 # Removiendo la Interferencia
663 # Removiendo la Interferencia
664 jcspectra[ip, :, ind_hei] = jcspectra[ip,
664 jcspectra[ip, :, ind_hei] = jcspectra[ip,
665 :, ind_hei] - jcspc_interf
665 :, ind_hei] - jcspc_interf
666
666
667 ListAux = numpy.abs(jcspc_interf[mask_prof]).tolist()
667 ListAux = numpy.abs(jcspc_interf[mask_prof]).tolist()
668 maxid = ListAux.index(max(ListAux))
668 maxid = ListAux.index(max(ListAux))
669
669
670 ind = numpy.array([-2, -1, 1, 2])
670 ind = numpy.array([-2, -1, 1, 2])
671 xx = numpy.zeros([4, 4])
671 xx = numpy.zeros([4, 4])
672
672
673 for id1 in range(4):
673 for id1 in range(4):
674 xx[:, id1] = ind[id1]**numpy.asarray(list(range(4)))
674 xx[:, id1] = ind[id1]**numpy.asarray(list(range(4)))
675
675
676 xx_inv = numpy.linalg.inv(xx)
676 xx_inv = numpy.linalg.inv(xx)
677 xx = xx_inv[:, 0]
677 xx = xx_inv[:, 0]
678
678
679 ind = (ind + maxid + num_mask_prof) % num_mask_prof
679 ind = (ind + maxid + num_mask_prof) % num_mask_prof
680 yy = jcspectra[ip, mask_prof[ind], :]
680 yy = jcspectra[ip, mask_prof[ind], :]
681 jcspectra[ip, mask_prof[maxid], :] = numpy.dot(yy.transpose(), xx)
681 jcspectra[ip, mask_prof[maxid], :] = numpy.dot(yy.transpose(), xx)
682
682
683 # Guardar Resultados
683 # Guardar Resultados
684 self.dataOut.data_spc = jspectra
684 self.dataOut.data_spc = jspectra
685 self.dataOut.data_cspc = jcspectra
685 self.dataOut.data_cspc = jcspectra
686
686
687 return 1
687 return 1
688
688
689 def run(self, dataOut, interf = 2,hei_interf = None, nhei_interf = None, offhei_interf = None, mode=1):
689 def run(self, dataOut, interf = 2,hei_interf = None, nhei_interf = None, offhei_interf = None, mode=1):
690
690
691 self.dataOut = dataOut
691 self.dataOut = dataOut
692
692
693 if mode == 1:
693 if mode == 1:
694 self.removeInterference(interf = 2,hei_interf = None, nhei_interf = None, offhei_interf = None)
694 self.removeInterference(interf = 2,hei_interf = None, nhei_interf = None, offhei_interf = None)
695 elif mode == 2:
695 elif mode == 2:
696 self.removeInterference2()
696 self.removeInterference2()
697
697
698 return self.dataOut
698 return self.dataOut
699
699
700
700
701 class IncohInt(Operation):
701 class IncohInt(Operation):
702
702
703 __profIndex = 0
703 __profIndex = 0
704 __withOverapping = False
704 __withOverapping = False
705
705
706 __byTime = False
706 __byTime = False
707 __initime = None
707 __initime = None
708 __lastdatatime = None
708 __lastdatatime = None
709 __integrationtime = None
709 __integrationtime = None
710
710
711 __buffer_spc = None
711 __buffer_spc = None
712 __buffer_cspc = None
712 __buffer_cspc = None
713 __buffer_dc = None
713 __buffer_dc = None
714
714
715 __dataReady = False
715 __dataReady = False
716
716
717 __timeInterval = None
717 __timeInterval = None
718
718
719 n = None
719 n = None
720
720
721 def __init__(self):
721 def __init__(self):
722
722
723 Operation.__init__(self)
723 Operation.__init__(self)
724
724
725 def setup(self, n=None, timeInterval=None, overlapping=False):
725 def setup(self, n=None, timeInterval=None, overlapping=False):
726 """
726 """
727 Set the parameters of the integration class.
727 Set the parameters of the integration class.
728
728
729 Inputs:
729 Inputs:
730
730
731 n : Number of coherent integrations
731 n : Number of coherent integrations
732 timeInterval : Time of integration. If the parameter "n" is selected this one does not work
732 timeInterval : Time of integration. If the parameter "n" is selected this one does not work
733 overlapping :
733 overlapping :
734
734
735 """
735 """
736
736
737 self.__initime = None
737 self.__initime = None
738 self.__lastdatatime = 0
738 self.__lastdatatime = 0
739
739
740 self.__buffer_spc = 0
740 self.__buffer_spc = 0
741 self.__buffer_cspc = 0
741 self.__buffer_cspc = 0
742 self.__buffer_dc = 0
742 self.__buffer_dc = 0
743
743
744 self.__profIndex = 0
744 self.__profIndex = 0
745 self.__dataReady = False
745 self.__dataReady = False
746 self.__byTime = False
746 self.__byTime = False
747
747
748 if n is None and timeInterval is None:
748 if n is None and timeInterval is None:
749 raise ValueError("n or timeInterval should be specified ...")
749 raise ValueError("n or timeInterval should be specified ...")
750
750
751 if n is not None:
751 if n is not None:
752 self.n = int(n)
752 self.n = int(n)
753 else:
753 else:
754
754
755 self.__integrationtime = int(timeInterval)
755 self.__integrationtime = int(timeInterval)
756 self.n = None
756 self.n = None
757 self.__byTime = True
757 self.__byTime = True
758
758
759 def putData(self, data_spc, data_cspc, data_dc):
759 def putData(self, data_spc, data_cspc, data_dc):
760 """
760 """
761 Add a profile to the __buffer_spc and increase in one the __profileIndex
761 Add a profile to the __buffer_spc and increase in one the __profileIndex
762
762
763 """
763 """
764
764
765 self.__buffer_spc += data_spc
765 self.__buffer_spc += data_spc
766
766
767 if data_cspc is None:
767 if data_cspc is None:
768 self.__buffer_cspc = None
768 self.__buffer_cspc = None
769 else:
769 else:
770 self.__buffer_cspc += data_cspc
770 self.__buffer_cspc += data_cspc
771
771
772 if data_dc is None:
772 if data_dc is None:
773 self.__buffer_dc = None
773 self.__buffer_dc = None
774 else:
774 else:
775 self.__buffer_dc += data_dc
775 self.__buffer_dc += data_dc
776
776
777 self.__profIndex += 1
777 self.__profIndex += 1
778
778
779 return
779 return
780
780
781 def pushData(self):
781 def pushData(self):
782 """
782 """
783 Return the sum of the last profiles and the profiles used in the sum.
783 Return the sum of the last profiles and the profiles used in the sum.
784
784
785 Affected:
785 Affected:
786
786
787 self.__profileIndex
787 self.__profileIndex
788
788
789 """
789 """
790
790
791 data_spc = self.__buffer_spc
791 data_spc = self.__buffer_spc
792 data_cspc = self.__buffer_cspc
792 data_cspc = self.__buffer_cspc
793 data_dc = self.__buffer_dc
793 data_dc = self.__buffer_dc
794 n = self.__profIndex
794 n = self.__profIndex
795
795
796 self.__buffer_spc = 0
796 self.__buffer_spc = 0
797 self.__buffer_cspc = 0
797 self.__buffer_cspc = 0
798 self.__buffer_dc = 0
798 self.__buffer_dc = 0
799 self.__profIndex = 0
799 self.__profIndex = 0
800
800
801 return data_spc, data_cspc, data_dc, n
801 return data_spc, data_cspc, data_dc, n
802
802
803 def byProfiles(self, *args):
803 def byProfiles(self, *args):
804
804
805 self.__dataReady = False
805 self.__dataReady = False
806 avgdata_spc = None
806 avgdata_spc = None
807 avgdata_cspc = None
807 avgdata_cspc = None
808 avgdata_dc = None
808 avgdata_dc = None
809
809
810 self.putData(*args)
810 self.putData(*args)
811
811
812 if self.__profIndex == self.n:
812 if self.__profIndex == self.n:
813
813
814 avgdata_spc, avgdata_cspc, avgdata_dc, n = self.pushData()
814 avgdata_spc, avgdata_cspc, avgdata_dc, n = self.pushData()
815 self.n = n
815 self.n = n
816 self.__dataReady = True
816 self.__dataReady = True
817
817
818 return avgdata_spc, avgdata_cspc, avgdata_dc
818 return avgdata_spc, avgdata_cspc, avgdata_dc
819
819
820 def byTime(self, datatime, *args):
820 def byTime(self, datatime, *args):
821
821
822 self.__dataReady = False
822 self.__dataReady = False
823 avgdata_spc = None
823 avgdata_spc = None
824 avgdata_cspc = None
824 avgdata_cspc = None
825 avgdata_dc = None
825 avgdata_dc = None
826
826
827 self.putData(*args)
827 self.putData(*args)
828
828
829 if (datatime - self.__initime) >= self.__integrationtime:
829 if (datatime - self.__initime) >= self.__integrationtime:
830 avgdata_spc, avgdata_cspc, avgdata_dc, n = self.pushData()
830 avgdata_spc, avgdata_cspc, avgdata_dc, n = self.pushData()
831 self.n = n
831 self.n = n
832 self.__dataReady = True
832 self.__dataReady = True
833
833
834 return avgdata_spc, avgdata_cspc, avgdata_dc
834 return avgdata_spc, avgdata_cspc, avgdata_dc
835
835
836 def integrate(self, datatime, *args):
836 def integrate(self, datatime, *args):
837
837
838 if self.__profIndex == 0:
838 if self.__profIndex == 0:
839 self.__initime = datatime
839 self.__initime = datatime
840
840
841 if self.__byTime:
841 if self.__byTime:
842 avgdata_spc, avgdata_cspc, avgdata_dc = self.byTime(
842 avgdata_spc, avgdata_cspc, avgdata_dc = self.byTime(
843 datatime, *args)
843 datatime, *args)
844 else:
844 else:
845 avgdata_spc, avgdata_cspc, avgdata_dc = self.byProfiles(*args)
845 avgdata_spc, avgdata_cspc, avgdata_dc = self.byProfiles(*args)
846
846
847 if not self.__dataReady:
847 if not self.__dataReady:
848 return None, None, None, None
848 return None, None, None, None
849
849
850 return self.__initime, avgdata_spc, avgdata_cspc, avgdata_dc
850 return self.__initime, avgdata_spc, avgdata_cspc, avgdata_dc
851
851
852 def run(self, dataOut, n=None, timeInterval=None, overlapping=False):
852 def run(self, dataOut, n=None, timeInterval=None, overlapping=False):
853 if n == 1:
853 if n == 1:
854 return dataOut
854 return dataOut
855
855
856 dataOut.flagNoData = True
856 dataOut.flagNoData = True
857
857
858 if not self.isConfig:
858 if not self.isConfig:
859 self.setup(n, timeInterval, overlapping)
859 self.setup(n, timeInterval, overlapping)
860 self.isConfig = True
860 self.isConfig = True
861
861
862 avgdatatime, avgdata_spc, avgdata_cspc, avgdata_dc = self.integrate(dataOut.utctime,
862 avgdatatime, avgdata_spc, avgdata_cspc, avgdata_dc = self.integrate(dataOut.utctime,
863 dataOut.data_spc,
863 dataOut.data_spc,
864 dataOut.data_cspc,
864 dataOut.data_cspc,
865 dataOut.data_dc)
865 dataOut.data_dc)
866
866
867 if self.__dataReady:
867 if self.__dataReady:
868
868
869 dataOut.data_spc = avgdata_spc
869 dataOut.data_spc = avgdata_spc
870 dataOut.data_cspc = avgdata_cspc
870 dataOut.data_cspc = avgdata_cspc
871 dataOut.data_dc = avgdata_dc
871 dataOut.data_dc = avgdata_dc
872 dataOut.nIncohInt *= self.n
872 dataOut.nIncohInt *= self.n
873 dataOut.utctime = avgdatatime
873 dataOut.utctime = avgdatatime
874 dataOut.flagNoData = False
874 dataOut.flagNoData = False
875
875
876 return dataOut
876 return dataOut
877
877
878 class dopplerFlip(Operation):
878 class dopplerFlip(Operation):
879
879
880 def run(self, dataOut):
880 def run(self, dataOut):
881 # arreglo 1: (num_chan, num_profiles, num_heights)
881 # arreglo 1: (num_chan, num_profiles, num_heights)
882 self.dataOut = dataOut
882 self.dataOut = dataOut
883 # JULIA-oblicua, indice 2
883 # JULIA-oblicua, indice 2
884 # arreglo 2: (num_profiles, num_heights)
884 # arreglo 2: (num_profiles, num_heights)
885 jspectra = self.dataOut.data_spc[2]
885 jspectra = self.dataOut.data_spc[2]
886 jspectra_tmp = numpy.zeros(jspectra.shape)
886 jspectra_tmp = numpy.zeros(jspectra.shape)
887 num_profiles = jspectra.shape[0]
887 num_profiles = jspectra.shape[0]
888 freq_dc = int(num_profiles / 2)
888 freq_dc = int(num_profiles / 2)
889 # Flip con for
889 # Flip con for
890 for j in range(num_profiles):
890 for j in range(num_profiles):
891 jspectra_tmp[num_profiles-j-1]= jspectra[j]
891 jspectra_tmp[num_profiles-j-1]= jspectra[j]
892 # Intercambio perfil de DC con perfil inmediato anterior
892 # Intercambio perfil de DC con perfil inmediato anterior
893 jspectra_tmp[freq_dc-1]= jspectra[freq_dc-1]
893 jspectra_tmp[freq_dc-1]= jspectra[freq_dc-1]
894 jspectra_tmp[freq_dc]= jspectra[freq_dc]
894 jspectra_tmp[freq_dc]= jspectra[freq_dc]
895 # canal modificado es re-escrito en el arreglo de canales
895 # canal modificado es re-escrito en el arreglo de canales
896 self.dataOut.data_spc[2] = jspectra_tmp
896 self.dataOut.data_spc[2] = jspectra_tmp
897
897
898 return self.dataOut No newline at end of file
898 return self.dataOut
@@ -1,216 +1,216
1 # Ing. AVP
1 # Ing. AVP
2 # 06/10/2021
2 # 06/10/2021
3 # ARCHIVO DE LECTURA
3 # ARCHIVO DE LECTURA
4 import os, sys
4 import os, sys
5 import datetime
5 import datetime
6 import time
6 import time
7 from schainpy.controller import Project
7 from schainpy.controller import Project
8 #### NOTA###########################################
8 #### NOTA###########################################
9 # INPUT :
9 # INPUT :
10 # VELOCIDAD PARAMETRO : V = 2Β°/seg
10 # VELOCIDAD PARAMETRO : V = 2Β°/seg
11 # MODO PULSE PAIR O MOMENTOS: 0 : Pulse Pair ,1 : Momentos
11 # MODO PULSE PAIR O MOMENTOS: 0 : Pulse Pair ,1 : Momentos
12 ######################################################
12 ######################################################
13 ##### PROCESAMIENTO ##################################
13 ##### PROCESAMIENTO ##################################
14 ##### OJO TENER EN CUENTA EL n= para el Pulse Pair ##
14 ##### OJO TENER EN CUENTA EL n= para el Pulse Pair ##
15 ##### O EL n= nFFTPoints ###
15 ##### O EL n= nFFTPoints ###
16 ######################################################
16 ######################################################
17 ######## BUSCAMOS EL numero de IPP equivalente 1Β°#####
17 ######## BUSCAMOS EL numero de IPP equivalente 1Β°#####
18 ######## Sea V la velocidad del Pedestal en Β°/seg#####
18 ######## Sea V la velocidad del Pedestal en Β°/seg#####
19 ######## 1Β° sera Recorrido en un tiempo de 1/V ######
19 ######## 1Β° sera Recorrido en un tiempo de 1/V ######
20 ######## IPP del Radar 400 useg --> 60 Km ############
20 ######## IPP del Radar 400 useg --> 60 Km ############
21 ######## n = 1/(V(Β°/seg)*IPP(Km)) , NUMERO DE IPP ##
21 ######## n = 1/(V(Β°/seg)*IPP(Km)) , NUMERO DE IPP ##
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 = 10
26 mode = 1
26 mode = 1
27 #path = '/DATA_RM/23/6v'
27 #path = '/DATA_RM/23/6v'
28 ####path = '/DATA_RM/TEST_INTEGRACION_2M'
28 ####path = '/DATA_RM/TEST_INTEGRACION_2M'
29 #path = '/DATA_RM/TEST_19OCTUBRE/10MHZ'
29 #path = '/DATA_RM/TEST_19OCTUBRE/10MHZ'
30 path = '/DATA_RM/WR_20_OCT'
30 path = '/DATA_RM/WR_20_OCT'
31 #### path_ped='/DATA_RM/TEST_PEDESTAL/P20211012-082745'
31 #### path_ped='/DATA_RM/TEST_PEDESTAL/P20211012-082745'
32 #### path_ped='/DATA_RM/TEST_PEDESTAL/P20211019-192244'
32 ####path_ped='/DATA_RM/TEST_PEDESTAL/P20211019-192244'
33 figpath_pp = "/home/soporte/Pictures/TEST_PP"
33 figpath_pp = "/home/soporte/Pictures/TEST_PP"
34 figpath_spec = "/home/soporte/Pictures/TEST_MOM"
34 figpath_spec = "/home/soporte/Pictures/TEST_MOM"
35 plot = 1
35 plot = 0
36 integration = 0
36 integration = 1
37 save = 0
37 save = 0
38 if save == 1:
38 if save == 1:
39 if mode==0:
39 if mode==0:
40 path_save = '/DATA_RM/TEST_HDF5_PP_23/6v'
40 path_save = '/DATA_RM/TEST_HDF5_PP_23/6v'
41 path_save = '/DATA_RM/TEST_HDF5_PP'
41 path_save = '/DATA_RM/TEST_HDF5_PP'
42 path_save = '/DATA_RM/TEST_HDF5_PP_100'
42 path_save = '/DATA_RM/TEST_HDF5_PP_100'
43 else:
43 else:
44 path_save = '/DATA_RM/TEST_HDF5_SPEC_23_V2/6v'
44 path_save = '/DATA_RM/TEST_HDF5_SPEC_23_V2/6v'
45
45
46 print("* PATH data ADQ :", path)
46 print("* PATH data ADQ :", path)
47 print("* Velocidad Pedestal :",V,"Β°/seg")
47 print("* Velocidad Pedestal :",V,"Β°/seg")
48 ############################ NRO Perfiles PROCESAMIENTO ###################
48 ############################ NRO Perfiles PROCESAMIENTO ###################
49 V=V
49 V=V
50 IPP=400*1e-6
50 IPP=400*1e-6
51 n= int(1/(V*IPP))
51 n= int(1/(V*IPP))
52 print("* n - NRO Perfiles Proc:", n )
52 print("* n - NRO Perfiles Proc:", n )
53 ################################## MODE ###################################
53 ################################## MODE ###################################
54 print("* Modo de Operacion :",mode)
54 print("* Modo de Operacion :",mode)
55 if mode ==0:
55 if mode ==0:
56 print("* Met. Seleccionado : Pulse Pair")
56 print("* Met. Seleccionado : Pulse Pair")
57 else:
57 else:
58 print("* Met. Momentos : Momentos")
58 print("* Met. Momentos : Momentos")
59
59
60 ################################## MODE ###################################
60 ################################## MODE ###################################
61 print("* Grabado de datos :",save)
61 print("* Grabado de datos :",save)
62 if save ==1:
62 if save ==1:
63 if mode==0:
63 if mode==0:
64 ope= "Pulse Pair"
64 ope= "Pulse Pair"
65 else:
65 else:
66 ope= "Momentos"
66 ope= "Momentos"
67 print("* Path-Save Data -", ope , path_save)
67 print("* Path-Save Data -", ope , path_save)
68
68
69 print("* Integracion de datos :",integration)
69 print("* Integracion de datos :",integration)
70
70
71 time.sleep(15)
71 time.sleep(15)
72 #remotefolder = "/home/wmaster/graficos"
72 #remotefolder = "/home/wmaster/graficos"
73 #######################################################################
73 #######################################################################
74 ################# RANGO DE PLOTEO######################################
74 ################# RANGO DE PLOTEO######################################
75 dBmin = '1'
75 dBmin = '1'
76 dBmax = '65'
76 dBmax = '65'
77 xmin = '13.2'
77 xmin = '13.2'
78 xmax = '13.5'
78 xmax = '13.5'
79 ymin = '0'
79 ymin = '0'
80 ymax = '60'
80 ymax = '60'
81 #######################################################################
81 #######################################################################
82 ########################FECHA##########################################
82 ########################FECHA##########################################
83 str = datetime.date.today()
83 str = datetime.date.today()
84 today = str.strftime("%Y/%m/%d")
84 today = str.strftime("%Y/%m/%d")
85 str2 = str - datetime.timedelta(days=1)
85 str2 = str - datetime.timedelta(days=1)
86 yesterday = str2.strftime("%Y/%m/%d")
86 yesterday = str2.strftime("%Y/%m/%d")
87 #######################################################################
87 #######################################################################
88 ########################SIGNAL CHAIN ##################################
88 ########################SIGNAL CHAIN ##################################
89 #######################################################################
89 #######################################################################
90 desc = "USRP_test"
90 desc = "USRP_test"
91 filename = "USRP_processing.xml"
91 filename = "USRP_processing.xml"
92 controllerObj = Project()
92 controllerObj = Project()
93 controllerObj.setup(id = '191', name='Test_USRP', description=desc)
93 controllerObj.setup(id = '191', name='Test_USRP', description=desc)
94 #######################################################################
94 #######################################################################
95 ######################## UNIDAD DE LECTURA#############################
95 ######################## UNIDAD DE LECTURA#############################
96 #######################################################################
96 #######################################################################
97 readUnitConfObj = controllerObj.addReadUnit(datatype='DigitalRFReader',
97 readUnitConfObj = controllerObj.addReadUnit(datatype='DigitalRFReader',
98 path=path,
98 path=path,
99 startDate="2021/01/01",#today,
99 startDate="2021/01/01",#today,
100 endDate="2021/12/30",#today,
100 endDate="2021/12/30",#today,
101 startTime='00:00:00',
101 startTime='00:00:00',
102 endTime='23:59:59',
102 endTime='23:59:59',
103 delay=0,
103 delay=0,
104 #set=0,
104 #set=0,
105 online=0,
105 online=0,
106 walk=1,
106 walk=1,
107 ippKm = 60)
107 ippKm = 60)
108
108
109 opObj11 = readUnitConfObj.addOperation(name='printInfo')
109 opObj11 = readUnitConfObj.addOperation(name='printInfo')
110
110
111 procUnitConfObjA = controllerObj.addProcUnit(datatype='VoltageProc', inputId=readUnitConfObj.getId())
111 procUnitConfObjA = controllerObj.addProcUnit(datatype='VoltageProc', inputId=readUnitConfObj.getId())
112
112
113 if mode ==0:
113 if mode ==0:
114 ####################### METODO PULSE PAIR ######################################################################
114 ####################### METODO PULSE PAIR ######################################################################
115 opObj11 = procUnitConfObjA.addOperation(name='PulsePair', optype='other')
115 opObj11 = procUnitConfObjA.addOperation(name='PulsePair', optype='other')
116 opObj11.addParameter(name='n', value=int(n), format='int')#10 VOY A USAR 250 DADO QUE LA VELOCIDAD ES 10 GRADOS
116 opObj11.addParameter(name='n', value=int(n), format='int')#10 VOY A USAR 250 DADO QUE LA VELOCIDAD ES 10 GRADOS
117 #opObj11.addParameter(name='removeDC', value=1, format='int')
117 #opObj11.addParameter(name='removeDC', value=1, format='int')
118 ####################### METODO Parametros ######################################################################
118 ####################### METODO Parametros ######################################################################
119 procUnitConfObjB= controllerObj.addProcUnit(datatype='ParametersProc',inputId=procUnitConfObjA.getId())
119 procUnitConfObjB= controllerObj.addProcUnit(datatype='ParametersProc',inputId=procUnitConfObjA.getId())
120 if plot==1:
120 if plot==1:
121 opObj11 = procUnitConfObjB.addOperation(name='GenericRTIPlot',optype='external')
121 opObj11 = procUnitConfObjB.addOperation(name='GenericRTIPlot',optype='external')
122 opObj11.addParameter(name='attr_data', value='dataPP_POWER')
122 opObj11.addParameter(name='attr_data', value='dataPP_POWER')
123 opObj11.addParameter(name='colormap', value='jet')
123 opObj11.addParameter(name='colormap', value='jet')
124 opObj11.addParameter(name='xmin', value=xmin)
124 opObj11.addParameter(name='xmin', value=xmin)
125 opObj11.addParameter(name='xmax', value=xmax)
125 opObj11.addParameter(name='xmax', value=xmax)
126 opObj11.addParameter(name='zmin', value=dBmin)
126 opObj11.addParameter(name='zmin', value=dBmin)
127 opObj11.addParameter(name='zmax', value=dBmax)
127 opObj11.addParameter(name='zmax', value=dBmax)
128 opObj11.addParameter(name='save', value=figpath_pp)
128 opObj11.addParameter(name='save', value=figpath_pp)
129 opObj11.addParameter(name='showprofile', value=0)
129 opObj11.addParameter(name='showprofile', value=0)
130 opObj11.addParameter(name='save_period', value=10)
130 opObj11.addParameter(name='save_period', value=10)
131
131
132 ####################### METODO ESCRITURA #######################################################################
132 ####################### METODO ESCRITURA #######################################################################
133 if save==1:
133 if save==1:
134 opObj10 = procUnitConfObjB.addOperation(name='HDFWriter')
134 opObj10 = procUnitConfObjB.addOperation(name='HDFWriter')
135 opObj10.addParameter(name='path',value=path_save)
135 opObj10.addParameter(name='path',value=path_save)
136 #opObj10.addParameter(name='mode',value=0)
136 #opObj10.addParameter(name='mode',value=0)
137 opObj10.addParameter(name='blocksPerFile',value='100',format='int')
137 opObj10.addParameter(name='blocksPerFile',value='100',format='int')
138 opObj10.addParameter(name='metadataList',value='utctimeInit,timeZone,paramInterval,profileIndex,channelList,heightList,flagDataAsBlock',format='list')
138 opObj10.addParameter(name='metadataList',value='utctimeInit,timeZone,paramInterval,profileIndex,channelList,heightList,flagDataAsBlock',format='list')
139 opObj10.addParameter(name='dataList',value='dataPP_POWER,dataPP_DOP,utctime',format='list')#,format='list'
139 opObj10.addParameter(name='dataList',value='dataPP_POWER,dataPP_DOP,utctime',format='list')#,format='list'
140 if integration==1:
140 if integration==1:
141 V=10
141 V=10
142 blocksPerfile=360
142 blocksPerfile=360
143 print("* Velocidad del Pedestal:",V)
143 print("* Velocidad del Pedestal:",V)
144 tmp_blocksPerfile = 100
144 tmp_blocksPerfile = 100
145 f_a_p= int(tmp_blocksPerfile/V)
145 f_a_p= int(tmp_blocksPerfile/V)
146
146
147 opObj11 = procUnitConfObjB.addOperation(name='PedestalInformation')
147 opObj11 = procUnitConfObjB.addOperation(name='PedestalInformation')
148 opObj11.addParameter(name='path_ped', value=path_ped)
148 opObj11.addParameter(name='path_ped', value=path_ped)
149 #opObj11.addParameter(name='path_adq', value=path_adq)
149 #opObj11.addParameter(name='path_adq', value=path_adq)
150 opObj11.addParameter(name='t_Interval_p', value='0.01', format='float')
150 opObj11.addParameter(name='t_Interval_p', value='0.01', format='float')
151 opObj11.addParameter(name='blocksPerfile', value=blocksPerfile, format='int')
151 opObj11.addParameter(name='blocksPerfile', value=blocksPerfile, format='int')
152 opObj11.addParameter(name='n_Muestras_p', value='100', format='float')
152 opObj11.addParameter(name='n_Muestras_p', value='100', format='float')
153 opObj11.addParameter(name='f_a_p', value=f_a_p, format='int')
153 opObj11.addParameter(name='f_a_p', value=f_a_p, format='int')
154 opObj11.addParameter(name='online', value='0', format='int')
154 opObj11.addParameter(name='online', value='0', format='int')
155
155
156 opObj11 = procUnitConfObjB.addOperation(name='Block360')
156 opObj11 = procUnitConfObjB.addOperation(name='Block360')
157 opObj11.addParameter(name='n', value='10', format='int')
157 opObj11.addParameter(name='n', value='10', format='int')
158 opObj11.addParameter(name='mode', value=mode, format='int')
158 opObj11.addParameter(name='mode', value=mode, format='int')
159
159
160 # este bloque funciona bien con divisores de 360 no olvidar 0 10 20 30 40 60 90 120 180
160 # este bloque funciona bien con divisores de 360 no olvidar 0 10 20 30 40 60 90 120 180
161
161
162 opObj11= procUnitConfObjB.addOperation(name='WeatherPlot',optype='other')
162 opObj11= procUnitConfObjB.addOperation(name='WeatherPlot',optype='other')
163
163
164
164
165 else:
165 else:
166 ####################### METODO SPECTROS ######################################################################
166 ####################### METODO SPECTROS ######################################################################
167 procUnitConfObjB = controllerObj.addProcUnit(datatype='SpectraProc', inputId=procUnitConfObjA.getId())
167 procUnitConfObjB = controllerObj.addProcUnit(datatype='SpectraProc', inputId=procUnitConfObjA.getId())
168 procUnitConfObjB.addParameter(name='nFFTPoints', value=n, format='int')
168 procUnitConfObjB.addParameter(name='nFFTPoints', value=n, format='int')
169 procUnitConfObjB.addParameter(name='nProfiles' , value=n, format='int')
169 procUnitConfObjB.addParameter(name='nProfiles' , value=n, format='int')
170
170
171 procUnitConfObjC = controllerObj.addProcUnit(datatype='ParametersProc',inputId=procUnitConfObjB.getId())
171 procUnitConfObjC = controllerObj.addProcUnit(datatype='ParametersProc',inputId=procUnitConfObjB.getId())
172 procUnitConfObjC.addOperation(name='SpectralMoments')
172 procUnitConfObjC.addOperation(name='SpectralMoments')
173 if plot==1:
173 if plot==1:
174 dBmin = '1'
174 dBmin = '1'
175 dBmax = '65'
175 dBmax = '65'
176 opObj11 = procUnitConfObjC.addOperation(name='PowerPlot',optype='external')
176 opObj11 = procUnitConfObjC.addOperation(name='PowerPlot',optype='external')
177 opObj11.addParameter(name='xmin', value=xmin)
177 opObj11.addParameter(name='xmin', value=xmin)
178 opObj11.addParameter(name='xmax', value=xmax)
178 opObj11.addParameter(name='xmax', value=xmax)
179 opObj11.addParameter(name='zmin', value=dBmin)
179 opObj11.addParameter(name='zmin', value=dBmin)
180 opObj11.addParameter(name='zmax', value=dBmax)
180 opObj11.addParameter(name='zmax', value=dBmax)
181 opObj11.addParameter(name='save', value=figpath_spec)
181 opObj11.addParameter(name='save', value=figpath_spec)
182 opObj11.addParameter(name='showprofile', value=0)
182 opObj11.addParameter(name='showprofile', value=0)
183 opObj11.addParameter(name='save_period', value=10)
183 opObj11.addParameter(name='save_period', value=10)
184
184
185 if save==1:
185 if save==1:
186 opObj10 = procUnitConfObjC.addOperation(name='HDFWriter')
186 opObj10 = procUnitConfObjC.addOperation(name='HDFWriter')
187 opObj10.addParameter(name='path',value=path_save)
187 opObj10.addParameter(name='path',value=path_save)
188 #opObj10.addParameter(name='mode',value=0)
188 #opObj10.addParameter(name='mode',value=0)
189 opObj10.addParameter(name='blocksPerFile',value='360',format='int')
189 opObj10.addParameter(name='blocksPerFile',value='360',format='int')
190 #opObj10.addParameter(name='metadataList',value='utctimeInit,heightList,nIncohInt,nCohInt,nProfiles,channelList',format='list')#profileIndex
190 #opObj10.addParameter(name='metadataList',value='utctimeInit,heightList,nIncohInt,nCohInt,nProfiles,channelList',format='list')#profileIndex
191 opObj10.addParameter(name='metadataList',value='utctimeInit,heightList,nIncohInt,nCohInt,nProfiles,channelList',format='list')#profileIndex
191 opObj10.addParameter(name='metadataList',value='utctimeInit,heightList,nIncohInt,nCohInt,nProfiles,channelList',format='list')#profileIndex
192 opObj10.addParameter(name='dataList',value='data_pow,data_dop,utctime',format='list')#,format='list'
192 opObj10.addParameter(name='dataList',value='data_pow,data_dop,utctime',format='list')#,format='list'
193
193
194 if integration==1:
194 if integration==1:
195 V=10
195 V=10
196 blocksPerfile=360
196 blocksPerfile=360
197 print("* Velocidad del Pedestal:",V)
197 print("* Velocidad del Pedestal:",V)
198 tmp_blocksPerfile = 100
198 tmp_blocksPerfile = 100
199 f_a_p= int(tmp_blocksPerfile/V)
199 f_a_p= int(tmp_blocksPerfile/V)
200
200
201 opObj11 = procUnitConfObjC.addOperation(name='PedestalInformation')
201 opObj11 = procUnitConfObjC.addOperation(name='PedestalInformation')
202 opObj11.addParameter(name='path_ped', value=path_ped)
202 opObj11.addParameter(name='path_ped', value=path_ped)
203 #opObj11.addParameter(name='path_adq', value=path_adq)
203 #opObj11.addParameter(name='path_adq', value=path_adq)
204 opObj11.addParameter(name='t_Interval_p', value='0.01', format='float')
204 opObj11.addParameter(name='t_Interval_p', value='0.01', format='float')
205 opObj11.addParameter(name='blocksPerfile', value=blocksPerfile, format='int')
205 opObj11.addParameter(name='blocksPerfile', value=blocksPerfile, format='int')
206 opObj11.addParameter(name='n_Muestras_p', value='100', format='float')
206 opObj11.addParameter(name='n_Muestras_p', value='100', format='float')
207 opObj11.addParameter(name='f_a_p', value=f_a_p, format='int')
207 opObj11.addParameter(name='f_a_p', value=f_a_p, format='int')
208 opObj11.addParameter(name='online', value='0', format='int')
208 opObj11.addParameter(name='online', value='0', format='int')
209
209
210 opObj11 = procUnitConfObjC.addOperation(name='Block360')
210 opObj11 = procUnitConfObjC.addOperation(name='Block360')
211 opObj11.addParameter(name='n', value='10', format='int')
211 opObj11.addParameter(name='n', value='10', format='int')
212 opObj11.addParameter(name='mode', value=mode, format='int')
212 opObj11.addParameter(name='mode', value=mode, format='int')
213
213
214 # este bloque funciona bien con divisores de 360 no olvidar 0 10 20 30 40 60 90 120 180
214 # este bloque funciona bien con divisores de 360 no olvidar 0 10 20 30 40 60 90 120 180
215 opObj11= procUnitConfObjC.addOperation(name='WeatherPlot',optype='other')
215 opObj11= procUnitConfObjC.addOperation(name='WeatherPlot',optype='other')
216 controllerObj.start()
216 controllerObj.start()
@@ -1,217 +1,217
1 # Ing. AVP
1 # Ing. AVP
2 # 06/10/2021
2 # 06/10/2021
3 # ARCHIVO DE LECTURA
3 # ARCHIVO DE LECTURA
4 import os, sys
4 import os, sys
5 import datetime
5 import datetime
6 import time
6 import time
7 from schainpy.controller import Project
7 from schainpy.controller import Project
8 #### NOTA###########################################
8 #### NOTA###########################################
9 # INPUT :
9 # INPUT :
10 # VELOCIDAD PARAMETRO : V = 2Β°/seg
10 # VELOCIDAD PARAMETRO : V = 2Β°/seg
11 # MODO PULSE PAIR O MOMENTOS: 0 : Pulse Pair ,1 : Momentos
11 # MODO PULSE PAIR O MOMENTOS: 0 : Pulse Pair ,1 : Momentos
12 ######################################################
12 ######################################################
13 ##### PROCESAMIENTO ##################################
13 ##### PROCESAMIENTO ##################################
14 ##### OJO TENER EN CUENTA EL n= para el Pulse Pair ##
14 ##### OJO TENER EN CUENTA EL n= para el Pulse Pair ##
15 ##### O EL n= nFFTPoints ###
15 ##### O EL n= nFFTPoints ###
16 ######################################################
16 ######################################################
17 ######## BUSCAMOS EL numero de IPP equivalente 1Β°#####
17 ######## BUSCAMOS EL numero de IPP equivalente 1Β°#####
18 ######## Sea V la velocidad del Pedestal en Β°/seg#####
18 ######## Sea V la velocidad del Pedestal en Β°/seg#####
19 ######## 1Β° sera Recorrido en un tiempo de 1/V ######
19 ######## 1Β° sera Recorrido en un tiempo de 1/V ######
20 ######## IPP del Radar 400 useg --> 60 Km ############
20 ######## IPP del Radar 400 useg --> 60 Km ############
21 ######## n = 1/(V(Β°/seg)*IPP(Km)) , NUMERO DE IPP ##
21 ######## n = 1/(V(Β°/seg)*IPP(Km)) , NUMERO DE IPP ##
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 = 10
26 mode = 1
26 mode = 1
27 #path = '/DATA_RM/23/6v'
27 #path = '/DATA_RM/23/6v'
28 #path = '/DATA_RM/TEST_INTEGRACION_2M'
28 #path = '/DATA_RM/TEST_INTEGRACION_2M'
29 path = '/DATA_RM/WR_20_OCT'
29 path = '/DATA_RM/WR_20_OCT'
30
30
31 #path_ped='/DATA_RM/TEST_PEDESTAL/P20211012-082745'
31 #path_ped='/DATA_RM/TEST_PEDESTAL/P20211012-082745'
32 path_ped='/DATA_RM/TEST_PEDESTAL/P20211020-131248'
32 path_ped='/DATA_RM/TEST_PEDESTAL/P20211020-131248'
33
33
34 figpath_pp = "/home/soporte/Pictures/TEST_PP"
34 figpath_pp = "/home/soporte/Pictures/TEST_PP"
35 figpath_mom = "/home/soporte/Pictures/TEST_MOM"
35 figpath_mom = "/home/soporte/Pictures/TEST_MOM"
36 plot = 0
36 plot = 0
37 integration = 1
37 integration = 1
38 save = 0
38 save = 0
39 if save == 1:
39 if save == 1:
40 if mode==0:
40 if mode==0:
41 path_save = '/DATA_RM/TEST_HDF5_PP_23/6v'
41 path_save = '/DATA_RM/TEST_HDF5_PP_23/6v'
42 path_save = '/DATA_RM/TEST_HDF5_PP'
42 path_save = '/DATA_RM/TEST_HDF5_PP'
43 path_save = '/DATA_RM/TEST_HDF5_PP_100'
43 path_save = '/DATA_RM/TEST_HDF5_PP_100'
44 else:
44 else:
45 path_save = '/DATA_RM/TEST_HDF5_SPEC_23_V2/6v'
45 path_save = '/DATA_RM/TEST_HDF5_SPEC_23_V2/6v'
46
46
47 print("* PATH data ADQ :", path)
47 print("* PATH data ADQ :", path)
48 print("* Velocidad Pedestal :",V,"Β°/seg")
48 print("* Velocidad Pedestal :",V,"Β°/seg")
49 ############################ NRO Perfiles PROCESAMIENTO ###################
49 ############################ NRO Perfiles PROCESAMIENTO ###################
50 V=V
50 V=V
51 IPP=400*1e-6
51 IPP=400*1e-6
52 n= int(1/(V*IPP))
52 n= int(1/(V*IPP))
53 print("* n - NRO Perfiles Proc:", n )
53 print("* n - NRO Perfiles Proc:", n )
54 ################################## MODE ###################################
54 ################################## MODE ###################################
55 print("* Modo de Operacion :",mode)
55 print("* Modo de Operacion :",mode)
56 if mode ==0:
56 if mode ==0:
57 print("* Met. Seleccionado : Pulse Pair")
57 print("* Met. Seleccionado : Pulse Pair")
58 else:
58 else:
59 print("* Met. Momentos : Momentos")
59 print("* Met. Momentos : Momentos")
60
60
61 ################################## MODE ###################################
61 ################################## MODE ###################################
62 print("* Grabado de datos :",save)
62 print("* Grabado de datos :",save)
63 if save ==1:
63 if save ==1:
64 if mode==0:
64 if mode==0:
65 ope= "Pulse Pair"
65 ope= "Pulse Pair"
66 else:
66 else:
67 ope= "Momentos"
67 ope= "Momentos"
68 print("* Path-Save Data -", ope , path_save)
68 print("* Path-Save Data -", ope , path_save)
69
69
70 print("* Integracion de datos :",integration)
70 print("* Integracion de datos :",integration)
71
71
72 time.sleep(15)
72 time.sleep(5)
73 #remotefolder = "/home/wmaster/graficos"
73 #remotefolder = "/home/wmaster/graficos"
74 #######################################################################
74 #######################################################################
75 ################# RANGO DE PLOTEO######################################
75 ################# RANGO DE PLOTEO######################################
76 dBmin = '1'
76 dBmin = '1'
77 dBmax = '85'
77 dBmax = '85'
78 xmin = '15'
78 xmin = '15'
79 xmax = '15.25'
79 xmax = '15.25'
80 ymin = '0'
80 ymin = '0'
81 ymax = '600'
81 ymax = '600'
82 #######################################################################
82 #######################################################################
83 ########################FECHA##########################################
83 ########################FECHA##########################################
84 str = datetime.date.today()
84 str = datetime.date.today()
85 today = str.strftime("%Y/%m/%d")
85 today = str.strftime("%Y/%m/%d")
86 str2 = str - datetime.timedelta(days=1)
86 str2 = str - datetime.timedelta(days=1)
87 yesterday = str2.strftime("%Y/%m/%d")
87 yesterday = str2.strftime("%Y/%m/%d")
88 #######################################################################
88 #######################################################################
89 ########################SIGNAL CHAIN ##################################
89 ########################SIGNAL CHAIN ##################################
90 #######################################################################
90 #######################################################################
91 desc = "USRP_test"
91 desc = "USRP_test"
92 filename = "USRP_processing.xml"
92 filename = "USRP_processing.xml"
93 controllerObj = Project()
93 controllerObj = Project()
94 controllerObj.setup(id = '191', name='Test_USRP', description=desc)
94 controllerObj.setup(id = '191', name='Test_USRP', description=desc)
95 #######################################################################
95 #######################################################################
96 ######################## UNIDAD DE LECTURA#############################
96 ######################## UNIDAD DE LECTURA#############################
97 #######################################################################
97 #######################################################################
98 readUnitConfObj = controllerObj.addReadUnit(datatype='DigitalRFReader',
98 readUnitConfObj = controllerObj.addReadUnit(datatype='DigitalRFReader',
99 path=path,
99 path=path,
100 startDate="2021/01/01",#today,
100 startDate="2021/01/01",#today,
101 endDate="2021/12/30",#today,
101 endDate="2021/12/30",#today,
102 startTime='00:00:00',
102 startTime='00:00:00',
103 endTime='23:59:59',
103 endTime='23:59:59',
104 delay=0,
104 delay=0,
105 #set=0,
105 #set=0,
106 online=0,
106 online=0,
107 walk=1,
107 walk=1,
108 ippKm = 60)
108 ippKm = 60)
109
109
110 opObj11 = readUnitConfObj.addOperation(name='printInfo')
110 opObj11 = readUnitConfObj.addOperation(name='printInfo')
111
111
112 procUnitConfObjA = controllerObj.addProcUnit(datatype='VoltageProc', inputId=readUnitConfObj.getId())
112 procUnitConfObjA = controllerObj.addProcUnit(datatype='VoltageProc', inputId=readUnitConfObj.getId())
113
113
114 if mode ==0:
114 if mode ==0:
115 ####################### METODO PULSE PAIR ######################################################################
115 ####################### METODO PULSE PAIR ######################################################################
116 opObj11 = procUnitConfObjA.addOperation(name='PulsePair', optype='other')
116 opObj11 = procUnitConfObjA.addOperation(name='PulsePair', optype='other')
117 opObj11.addParameter(name='n', value=int(n), format='int')#10 VOY A USAR 250 DADO QUE LA VELOCIDAD ES 10 GRADOS
117 opObj11.addParameter(name='n', value=int(n), format='int')#10 VOY A USAR 250 DADO QUE LA VELOCIDAD ES 10 GRADOS
118 #opObj11.addParameter(name='removeDC', value=1, format='int')
118 #opObj11.addParameter(name='removeDC', value=1, format='int')
119 ####################### METODO Parametros ######################################################################
119 ####################### METODO Parametros ######################################################################
120 procUnitConfObjB= controllerObj.addProcUnit(datatype='ParametersProc',inputId=procUnitConfObjA.getId())
120 procUnitConfObjB= controllerObj.addProcUnit(datatype='ParametersProc',inputId=procUnitConfObjA.getId())
121 if plot==1:
121 if plot==1:
122 opObj11 = procUnitConfObjB.addOperation(name='GenericRTIPlot',optype='external')
122 opObj11 = procUnitConfObjB.addOperation(name='GenericRTIPlot',optype='external')
123 opObj11.addParameter(name='attr_data', value='dataPP_POW')
123 opObj11.addParameter(name='attr_data', value='dataPP_POW')
124 opObj11.addParameter(name='colormap', value='jet')
124 opObj11.addParameter(name='colormap', value='jet')
125 opObj11.addParameter(name='xmin', value=xmin)
125 opObj11.addParameter(name='xmin', value=xmin)
126 opObj11.addParameter(name='xmax', value=xmax)
126 opObj11.addParameter(name='xmax', value=xmax)
127 opObj11.addParameter(name='zmin', value=dBmin)
127 opObj11.addParameter(name='zmin', value=dBmin)
128 opObj11.addParameter(name='zmax', value=dBmax)
128 opObj11.addParameter(name='zmax', value=dBmax)
129 opObj11.addParameter(name='save', value=figpath_pp)
129 opObj11.addParameter(name='save', value=figpath_pp)
130 opObj11.addParameter(name='showprofile', value=0)
130 opObj11.addParameter(name='showprofile', value=0)
131 opObj11.addParameter(name='save_period', value=50)
131 opObj11.addParameter(name='save_period', value=50)
132
132
133 ####################### METODO ESCRITURA #######################################################################
133 ####################### METODO ESCRITURA #######################################################################
134 if save==1:
134 if save==1:
135 opObj10 = procUnitConfObjB.addOperation(name='HDFWriter')
135 opObj10 = procUnitConfObjB.addOperation(name='HDFWriter')
136 opObj10.addParameter(name='path',value=path_save)
136 opObj10.addParameter(name='path',value=path_save)
137 #opObj10.addParameter(name='mode',value=0)
137 #opObj10.addParameter(name='mode',value=0)
138 opObj10.addParameter(name='blocksPerFile',value='100',format='int')
138 opObj10.addParameter(name='blocksPerFile',value='100',format='int')
139 opObj10.addParameter(name='metadataList',value='utctimeInit,timeZone,paramInterval,profileIndex,channelList,heightList,flagDataAsBlock',format='list')
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'
140 opObj10.addParameter(name='dataList',value='dataPP_POW,dataPP_DOP,utctime',format='list')#,format='list'
141 if integration==1:
141 if integration==1:
142 V=10
142 V=10
143 blocksPerfile=360
143 blocksPerfile=360
144 print("* Velocidad del Pedestal:",V)
144 print("* Velocidad del Pedestal:",V)
145 tmp_blocksPerfile = 100
145 tmp_blocksPerfile = 100
146 f_a_p= int(tmp_blocksPerfile/V)
146 f_a_p= int(tmp_blocksPerfile/V)
147
147
148 opObj11 = procUnitConfObjB.addOperation(name='PedestalInformation')
148 opObj11 = procUnitConfObjB.addOperation(name='PedestalInformation')
149 opObj11.addParameter(name='path_ped', value=path_ped)
149 opObj11.addParameter(name='path_ped', value=path_ped)
150 #opObj11.addParameter(name='path_adq', value=path_adq)
150 #opObj11.addParameter(name='path_adq', value=path_adq)
151 opObj11.addParameter(name='t_Interval_p', value='0.01', format='float')
151 opObj11.addParameter(name='t_Interval_p', value='0.01', format='float')
152 opObj11.addParameter(name='blocksPerfile', value=blocksPerfile, format='int')
152 opObj11.addParameter(name='blocksPerfile', value=blocksPerfile, format='int')
153 opObj11.addParameter(name='n_Muestras_p', value='100', format='float')
153 opObj11.addParameter(name='n_Muestras_p', value='100', format='float')
154 opObj11.addParameter(name='f_a_p', value=f_a_p, format='int')
154 opObj11.addParameter(name='f_a_p', value=f_a_p, format='int')
155 opObj11.addParameter(name='online', value='0', format='int')
155 opObj11.addParameter(name='online', value='0', format='int')
156
156
157 opObj11 = procUnitConfObjB.addOperation(name='Block360')
157 opObj11 = procUnitConfObjB.addOperation(name='Block360')
158 opObj11.addParameter(name='n', value='10', format='int')
158 opObj11.addParameter(name='n', value='10', format='int')
159 opObj11.addParameter(name='mode', value=mode, format='int')
159 opObj11.addParameter(name='mode', value=mode, format='int')
160
160
161 # este bloque funciona bien con divisores de 360 no olvidar 0 10 20 30 40 60 90 120 180
161 # este bloque funciona bien con divisores de 360 no olvidar 0 10 20 30 40 60 90 120 180
162
162
163 opObj11= procUnitConfObjB.addOperation(name='WeatherPlot',optype='other')
163 opObj11= procUnitConfObjB.addOperation(name='WeatherPlot',optype='other')
164
164
165
165
166 else:
166 else:
167 ####################### METODO SPECTROS ######################################################################
167 ####################### METODO SPECTROS ######################################################################
168 procUnitConfObjB = controllerObj.addProcUnit(datatype='SpectraProc', inputId=procUnitConfObjA.getId())
168 procUnitConfObjB = controllerObj.addProcUnit(datatype='SpectraProc', inputId=procUnitConfObjA.getId())
169 procUnitConfObjB.addParameter(name='nFFTPoints', value=n, format='int')
169 procUnitConfObjB.addParameter(name='nFFTPoints', value=n, format='int')
170 procUnitConfObjB.addParameter(name='nProfiles' , value=n, format='int')
170 procUnitConfObjB.addParameter(name='nProfiles' , value=n, format='int')
171
171
172 procUnitConfObjC = controllerObj.addProcUnit(datatype='ParametersProc',inputId=procUnitConfObjB.getId())
172 procUnitConfObjC = controllerObj.addProcUnit(datatype='ParametersProc',inputId=procUnitConfObjB.getId())
173 procUnitConfObjC.addOperation(name='SpectralMoments')
173 procUnitConfObjC.addOperation(name='SpectralMoments')
174 if plot==1:
174 if plot==1:
175 dBmin = '1'
175 dBmin = '1'
176 dBmax = '65'
176 dBmax = '65'
177 opObj11 = procUnitConfObjC.addOperation(name='PowerPlot',optype='external')
177 opObj11 = procUnitConfObjC.addOperation(name='PowerPlot',optype='external')
178 opObj11.addParameter(name='xmin', value=xmin)
178 opObj11.addParameter(name='xmin', value=xmin)
179 opObj11.addParameter(name='xmax', value=xmax)
179 opObj11.addParameter(name='xmax', value=xmax)
180 opObj11.addParameter(name='zmin', value=dBmin)
180 opObj11.addParameter(name='zmin', value=dBmin)
181 opObj11.addParameter(name='zmax', value=dBmax)
181 opObj11.addParameter(name='zmax', value=dBmax)
182 opObj11.addParameter(name='save', value=figpath_mom)
182 opObj11.addParameter(name='save', value=figpath_mom)
183 opObj11.addParameter(name='showprofile', value=0)
183 opObj11.addParameter(name='showprofile', value=0)
184 opObj11.addParameter(name='save_period', value=100)
184 opObj11.addParameter(name='save_period', value=100)
185
185
186 if save==1:
186 if save==1:
187 opObj10 = procUnitConfObjC.addOperation(name='HDFWriter')
187 opObj10 = procUnitConfObjC.addOperation(name='HDFWriter')
188 opObj10.addParameter(name='path',value=path_save)
188 opObj10.addParameter(name='path',value=path_save)
189 #opObj10.addParameter(name='mode',value=0)
189 #opObj10.addParameter(name='mode',value=0)
190 opObj10.addParameter(name='blocksPerFile',value='360',format='int')
190 opObj10.addParameter(name='blocksPerFile',value='360',format='int')
191 #opObj10.addParameter(name='metadataList',value='utctimeInit,heightList,nIncohInt,nCohInt,nProfiles,channelList',format='list')#profileIndex
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
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'
193 opObj10.addParameter(name='dataList',value='data_pow,data_dop,utctime',format='list')#,format='list'
194
194
195 if integration==1:
195 if integration==1:
196 V=10
196 V=10
197 blocksPerfile=360
197 blocksPerfile=360
198 print("* Velocidad del Pedestal:",V)
198 print("* Velocidad del Pedestal:",V)
199 tmp_blocksPerfile = 100
199 tmp_blocksPerfile = 100
200 f_a_p= int(tmp_blocksPerfile/V)
200 f_a_p= int(tmp_blocksPerfile/V)
201
201
202 opObj11 = procUnitConfObjC.addOperation(name='PedestalInformation')
202 opObj11 = procUnitConfObjC.addOperation(name='PedestalInformation')
203 opObj11.addParameter(name='path_ped', value=path_ped)
203 opObj11.addParameter(name='path_ped', value=path_ped)
204 #opObj11.addParameter(name='path_adq', value=path_adq)
204 #opObj11.addParameter(name='path_adq', value=path_adq)
205 opObj11.addParameter(name='t_Interval_p', value='0.01', format='float')
205 opObj11.addParameter(name='t_Interval_p', value='0.01', format='float')
206 opObj11.addParameter(name='blocksPerfile', value=blocksPerfile, format='int')
206 opObj11.addParameter(name='blocksPerfile', value=blocksPerfile, format='int')
207 opObj11.addParameter(name='n_Muestras_p', value='100', format='float')
207 opObj11.addParameter(name='n_Muestras_p', value='100', format='float')
208 opObj11.addParameter(name='f_a_p', value=f_a_p, format='int')
208 opObj11.addParameter(name='f_a_p', value=f_a_p, format='int')
209 opObj11.addParameter(name='online', value='0', format='int')
209 opObj11.addParameter(name='online', value='0', format='int')
210
210
211 opObj11 = procUnitConfObjC.addOperation(name='Block360')
211 opObj11 = procUnitConfObjC.addOperation(name='Block360')
212 opObj11.addParameter(name='n', value='30', format='int')
212 opObj11.addParameter(name='n', value='10', format='int')
213 opObj11.addParameter(name='mode', value=mode, format='int')
213 opObj11.addParameter(name='mode', value=mode, format='int')
214
214
215 # este bloque funciona bien con divisores de 360 no olvidar 0 10 20 30 40 60 90 120 180
215 # 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')
216 opObj11= procUnitConfObjC.addOperation(name='WeatherPlot',optype='other')
217 controllerObj.start()
217 controllerObj.start()
General Comments 0
You need to be logged in to leave comments. Login now