##// END OF EJS Templates
Add angles to Block360 fix plotting codes
Juan C. Espinoza -
r1589:0234d27936fd
parent child
Show More
@@ -432,6 +432,8 class Plot(Operation):
432 432 ax.plt, ax=ax, fraction=0.05, pad=0.06, aspect=10)
433 433 if self.colormap=='sophy_r':
434 434 ax.cbar.set_ticks([0.2, 0.73, 0.83, 0.93, 0.96, 0.99, 1.02, 1.05])
435 elif self.colormap=='sophy_d':
436 ax.cbar.set_ticks([-9, -6, -3, 0, 3, 6, 9, 12])
435 437 ax.cbar.ax.tick_params(labelsize=8)
436 438 ax.cbar.ax.press = None
437 439 if self.cb_label:
@@ -40,7 +40,7 refl = [
40 40 "#bf0000", "#7f0000", "#fe00fe", "#8e59ff", "#f0f0f0",
41 41 ]
42 42
43 refl_bounds = [-20, -15, -10, -5, 0, 5, 10 ,15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80]
43 #refl_bounds = [-25, -20, -15, -10, -5, 0, 5, 10 ,15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80]
44 44
45 45 doppler = [
46 46 "#003300", "#005500", "#007700", "#009900", "#00bb00", "#24ce24", "#6cd26c", "#b4d6b4",
@@ -58,7 +58,7 width = [
58 58
59 59 zdr = [
60 60 "#7333cc", "#7e3cd5", "#8945de", "#944ee7", "#9f57f0", "#aa5ff8",
61 "#82345c", "#984272", "#ae4f88", "#c55c9f", "#db6ab5", "#db6ab5",
61 "#82345c", "#984272", "#ae4f88", "#c55c9f", "#db6ab5", "#f177cb",
62 62 "#b5842d", "#c29a4c", "#d0b16b", "#ddc78a", "#ebddaa", "#f8f4c9",
63 63 "#f0f5ff", "#c4d8ff", "#97bbff", "#6a9eff", "#3e81ff", "#1164ff",
64 64 "#17f576", "#13df60", "#0ec949", "#0ab233", "#059c1d", "#018606",
@@ -99,7 +99,7 cb_tables = {
99 99 'sophy_z': {'colors': refl, 'norm': None },
100 100 'sophy_v': {'colors': doppler, 'norm': None },
101 101 'sophy_w': {'colors': width, 'norm': None },
102 'sophy_d': {'colors': zdr, 'norm': None },
102 'sophy_d': {'colors': zdr, 'norm': None},
103 103 'sophy_p': {'colors': phi, 'norm': None },
104 104 'sophy_r': {'colors': rho, 'norm': matplotlib.colors.BoundaryNorm(rho_bounds, 37), 'extremes': ['#15191d', '#333899']},
105 105 }
@@ -4250,7 +4250,7 class Block360(Operation):
4250 4250 def __init__(self,**kwargs):
4251 4251 Operation.__init__(self,**kwargs)
4252 4252
4253 def setup(self, dataOut, attr):
4253 def setup(self, dataOut, attr, angles):
4254 4254 '''
4255 4255 n= Numero de PRF's de entrada
4256 4256 '''
@@ -4263,6 +4263,7 class Block360(Operation):
4263 4263 self.__buffer = []
4264 4264 self.azi = []
4265 4265 self.ele = []
4266 self.angles = angles
4266 4267
4267 4268 def putData(self, data, attr):
4268 4269 '''
@@ -4384,27 +4385,31 class Block360(Operation):
4384 4385 elif (middle>start and end<middle):
4385 4386 return -1
4386 4387
4387 def run(self, dataOut, attr_data='dataPP_POWER', runNextOp = False,**kwargs):
4388 def run(self, dataOut, attr_data='dataPP_POWER', runNextOp = False, angles=[], **kwargs):
4388 4389
4389 4390 dataOut.attr_data = attr_data
4390 4391 dataOut.runNextOp = runNextOp
4391 4392
4392 4393 if not self.isConfig:
4393 self.setup(dataOut = dataOut, attr = attr_data ,**kwargs)
4394 self.setup(dataOut=dataOut, attr=attr_data, angles=angles, **kwargs)
4394 4395 self.isConfig = True
4395 4396
4396 4397 data_360, avgdatatime, data_p, data_e = self.blockOp(dataOut, dataOut.utctime)
4397 4398
4398 dataOut.flagNoData = True
4399
4399 dataOut.flagNoData = True
4400 4400 if self.__dataReady:
4401 setattr(dataOut, attr_data, data_360 )
4402 dataOut.data_azi = data_p
4403 dataOut.data_ele = data_e
4404 dataOut.utctime = avgdatatime
4405 dataOut.flagNoData = False
4406 dataOut.flagMode = self.flagMode
4407 dataOut.mode_op = self.mode_op
4401 mean_az = numpy.mean(data_p[25:-25])
4402 mean_el = numpy.mean(data_e[25:-25])
4403 if round(mean_az,1) in angles or round(mean_el,1) in angles:
4404 setattr(dataOut, attr_data, data_360 )
4405 dataOut.data_azi = data_p
4406 dataOut.data_ele = data_e
4407 dataOut.utctime = avgdatatime
4408 dataOut.flagNoData = False
4409 dataOut.flagMode = self.flagMode
4410 dataOut.mode_op = self.mode_op
4411 else:
4412 log.warning('Skipping angle {} / {}'.format(round(mean_az,1), round(mean_el,1)))
4408 4413
4409 4414 return dataOut
4410 4415
@@ -4482,6 +4487,7 class MergeProc(ProcessingUnit):
4482 4487 g = [getattr(data, attr_data) for data in data_inputs][1]
4483 4488 data = numpy.concatenate((f,g),axis=3)
4484 4489 setattr(self.dataOut, attr_data, data)
4490
4485 4491 # snr
4486 4492 # self.dataOut.data_snr = numpy.concatenate((data_inputs[0].data_snr, data_inputs[1].data_snr), axis=2)
4487 4493
General Comments 0
You need to be logged in to leave comments. Login now