atmospheric_lidar/generic.py

changeset 77
8ea07d18abc2
parent 60
b41e4e4a135a
child 80
48d5e9876708
equal deleted inserted replaced
73:6c06efef397c 77:8ea07d18abc2
590 def average_profile(self): 590 def average_profile(self):
591 """ Return the average profile (NOT range corrected) for all the duration of the measurement. """ 591 """ Return the average profile (NOT range corrected) for all the duration of the measurement. """
592 prof = np.mean(self.matrix, axis=0) 592 prof = np.mean(self.matrix, axis=0)
593 return prof 593 return prof
594 594
595 def plot(self, signal_type='rc', filename=None, zoom=[0, 12000, 0, -1], show_plot=True, cmap=plt.cm.jet, z0=None, 595 def plot(self, figsize=(8, 4), signal_type='rc', zoom=[0, 12000, 0, -1], show_plot=True, cmap=plt.cm.jet, z0=None,
596 title=None, vmin=0, vmax=1.3 * 10 ** 7): 596 title=None, vmin=0, vmax=1.3 * 10 ** 7):
597 # if filename is not None: 597 # if filename is not None:
598 # matplotlib.use('Agg') 598 # matplotlib.use('Agg')
599 599
600 fig = plt.figure() 600 fig = plt.figure(figsize=figsize)
601 ax1 = fig.add_subplot(111) 601 ax1 = fig.add_subplot(111)
602
602 self.draw_plot(ax1, cmap=cmap, signal_type=signal_type, zoom=zoom, z0=z0, vmin=vmin, vmax=vmax) 603 self.draw_plot(ax1, cmap=cmap, signal_type=signal_type, zoom=zoom, z0=z0, vmin=vmin, vmax=vmax)
603 604
604 if title: 605 if title:
605 ax1.set_title(title) 606 ax1.set_title(title)
606 else: 607 else:
607 ax1.set_title("%s signal - %s" % (signal_type.upper(), self.name)) 608 ax1.set_title("%s signal - %s" % (signal_type.upper(), self.name))
608 609
609 if filename is not None: 610 if show_plot:
610 pass 611 plt.show()
611 # plt.savefig(filename)
612 else:
613 if show_plot:
614 plt.show()
615 # plt.close() ???
616 612
617 def draw_plot(self, ax1, cmap=plt.cm.jet, signal_type='rc', 613 def draw_plot(self, ax1, cmap=plt.cm.jet, signal_type='rc',
618 zoom=[0, 12000, 0, -1], z0=None, 614 zoom=[0, 12000, 0, -1], z0=None,
619 add_colorbar=True, cmap_label='a.u.', cb_format=None, 615 add_colorbar=True, cmap_label='a.u.', cb_format=None,
620 vmin=0, vmax=1.3 * 10 ** 7): 616 vmin=0, vmax=1.3 * 10 ** 7):

mercurial