##// END OF EJS Templates
Fix weatherplot for two channels
jespinoza -
r1544:24f1bea5f47d
parent child
Show More
@@ -526,14 +526,17 class WeatherParamsPlot(Plot):
526 526 self.grid = True
527 527 if self.channels is not None:
528 528 self.nplots = len(self.channels)
529 self.nrows = len(self.channels)
529 self.ncols = len(self.channels)
530 530 else:
531 531 self.nplots = self.data.shape(self.CODE)[0]
532 self.nrows = self.nplots
532 self.ncols = self.nplots
533 533 self.channels = list(range(self.nplots))
534 534
535 535 self.colorbar=True
536 self.width =8
536 if len(self.channels)>1:
537 self.width = 12
538 else:
539 self.width =8
537 540 self.height =8
538 541 self.ini =0
539 542 self.len_azi =0
@@ -584,10 +587,13 class WeatherParamsPlot(Plot):
584 587 valid = numpy.where(r>=0)[0]
585 588 data['r'] = numpy.arange(len(valid))*delta_height
586 589
587 try:
588 data['data'] = tmp[self.channels[0]][:,valid]
589 except:
590 data['data'] = tmp[0][:,valid]
590 data['data'] = [0, 0]
591
592 #try:
593 data['data'][0] = tmp[0][:,valid]
594 data['data'][1] = tmp[1][:,valid]
595 #except:
596 # data['data'] = tmp[0][:,valid]
591 597
592 598 if dataOut.mode_op == 'PPI':
593 599 self.CODE = 'PPI'
@@ -600,10 +606,10 class WeatherParamsPlot(Plot):
600 606 data['ele'] = dataOut.data_ele
601 607 data['mode_op'] = dataOut.mode_op
602 608 self.mode = dataOut.mode_op
603 var = data['data'].flatten()
604 r = numpy.tile(data['r'], data['data'].shape[0])
605 az = numpy.repeat(data['azi'], data['data'].shape[1])
606 el = numpy.repeat(data['ele'], data['data'].shape[1])
609 var = data['data'][0].flatten()
610 r = numpy.tile(data['r'], data['data'][0].shape[0])
611 az = numpy.repeat(data['azi'], data['data'][0].shape[1])
612 el = numpy.repeat(data['ele'], data['data'][0].shape[1])
607 613
608 614 # lla = georef.spherical_to_proj(r, data['azi'], data['ele'], (-75.295893, -12.040436, 3379.2147))
609 615
@@ -661,14 +667,14 class WeatherParamsPlot(Plot):
661 667
662 668 if ax.firsttime:
663 669 ax.set_xlim(numpy.radians(self.ang_min),numpy.radians(self.ang_max))
664 ax.plt = ax.pcolormesh(theta, r, z, cmap=self.colormap, vmin=self.zmin, vmax=self.zmax)
670 ax.plt = ax.pcolormesh(theta, r, z[i], cmap=self.colormap, vmin=self.zmin, vmax=self.zmax)
665 671 if data['mode_op'] == 'PPI':
666 672 ax.set_theta_direction(-1)
667 673 ax.set_theta_offset(numpy.pi/2)
668 674
669 675 else:
670 676 ax.set_xlim(numpy.radians(self.ang_min),numpy.radians(self.ang_max))
671 ax.plt = ax.pcolormesh(theta, r, z, cmap=self.colormap, vmin=self.zmin, vmax=self.zmax)
677 ax.plt = ax.pcolormesh(theta, r, z[i], cmap=self.colormap, vmin=self.zmin, vmax=self.zmax)
672 678 if data['mode_op'] == 'PPI':
673 679 ax.set_theta_direction(-1)
674 680 ax.set_theta_offset(numpy.pi/2)
@@ -678,14 +684,14 class WeatherParamsPlot(Plot):
678 684 len_aux = int(data['azi'].shape[0]/4)
679 685 mean = numpy.mean(data['azi'][len_aux:-len_aux])
680 686 if len(self.channels) !=1:
681 self.titles = ['RHI {} at AZ: {} CH {}'.format(self.labels[x], str(round(mean,1)), x) for x in range(self.nrows)]
687 self.titles = ['RHI {} at AZ: {} CH {}'.format(self.labels[x], str(round(mean,1)), x) for x in self.channels]
682 688 else:
683 689 self.titles = ['RHI {} at AZ: {} CH {}'.format(self.labels[0], str(round(mean,1)), self.channels[0])]
684 690 elif data['mode_op'] == 'PPI':
685 691 len_aux = int(data['ele'].shape[0]/4)
686 692 mean = numpy.mean(data['ele'][len_aux:-len_aux])
687 693 if len(self.channels) !=1:
688 self.titles = ['PPI {} at EL: {} CH {}'.format(self.labels[x], str(round(mean,1)), x) for x in range(self.nrows)]
694 self.titles = ['PPI {} at EL: {} CH {}'.format(self.labels[x], str(round(mean,1)), x) for x in self.channels]
689 695 else:
690 696 self.titles = ['PPI {} at EL: {} CH {}'.format(self.labels[0], str(round(mean,1)), self.channels[0])]
691 697 self.mode_value = round(mean,1) No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now