##// END OF EJS Templates
Add LT time and logo
jespinoza -
r1723:ef15f55c2714
parent child
Show More
@@ -32,6 +32,8 import matplotlib.pyplot as plt
32 from matplotlib.patches import Polygon
32 from matplotlib.patches import Polygon
33 from mpl_toolkits.axes_grid1 import make_axes_locatable
33 from mpl_toolkits.axes_grid1 import make_axes_locatable
34 from matplotlib.ticker import FuncFormatter, LinearLocator, MultipleLocator
34 from matplotlib.ticker import FuncFormatter, LinearLocator, MultipleLocator
35 import matplotlib.cbook as cbook
36 import matplotlib.image as image
35
37
36 import cartopy.crs as ccrs
38 import cartopy.crs as ccrs
37
39
@@ -42,6 +44,10 from schainpy.model.proc.jroproc_base import ProcessingUnit, Operation, MPDecora
42 from schainpy.utils import log
44 from schainpy.utils import log
43
45
44
46
47 path = os.getcwd()
48 global file_logo
49 file_logo =os.path.join(path,"LogoIGP.png")
50
45 EARTH_RADIUS = 6.3710e3
51 EARTH_RADIUS = 6.3710e3
46
52
47 register_cmap()
53 register_cmap()
@@ -466,19 +472,22 class Plot(Operation):
466 if self.grid:
472 if self.grid:
467 ax.grid(True)
473 ax.grid(True)
468 if not self.polar:
474 if not self.polar:
469 ax.set_title('{} {} {}'.format(
475 ax.set_title('{} \n{} {} ({} LT)'.format(
470 self.titles[n],
476 self.titles[n],
471 self.getDateTime(self.data.max_time).strftime(
477 self.getDateTime(self.data.max_time).strftime(
472 '%Y-%m-%d %H:%M:%S'),
478 '%Y-%m-%d %H:%M:%S'),
473 self.time_label),
479 self.time_label,
480 (self.getDateTime(self.data.max_time)-datetime.timedelta(hours=5)).strftime(
481 '%Y-%m-%d %H:%M:%S')),
474 size=8)
482 size=8)
475 else:
483 else:
476 #ax.set_title('{}'.format(self.titles[n]), size=8)
484 ax.set_title('{} \n{} {} ({} LT)'.format(
477 ax.set_title('{} {} {}'.format(
478 self.titles[n],
485 self.titles[n],
479 self.getDateTime(self.data.max_time).strftime(
486 self.getDateTime(self.data.max_time).strftime(
480 '%Y-%m-%d %H:%M:%S'),
487 '%Y-%m-%d %H:%M:%S'),
481 self.time_label),
488 self.time_label,
489 (self.getDateTime(self.data.max_time)-datetime.timedelta(hours=5)).strftime(
490 '%Y-%m-%d %H:%M:%S')),
482 size=8)
491 size=8)
483 if self.mode == 'PPI':
492 if self.mode == 'PPI':
484 ax.set_yticks(ax.get_yticks(), labels=ax.get_yticks(), color='white')
493 ax.set_yticks(ax.get_yticks(), labels=ax.get_yticks(), color='white')
@@ -580,6 +589,11 class Plot(Operation):
580 label
589 label
581 )
590 )
582 )
591 )
592 with cbook.get_sample_data(file_logo) as file:
593 IM_LOGO = image.imread(file)
594 IM_X = 94
595 IM_Y = 90
596 logo=fig.figimage(IM_LOGO,IM_X,IM_Y,zorder=3,alpha=0.7)
583 else:
597 else:
584 figname = os.path.join(
598 figname = os.path.join(
585 self.save,
599 self.save,
@@ -610,6 +624,7 class Plot(Operation):
610 if not os.path.isdir(os.path.dirname(figname)):
624 if not os.path.isdir(os.path.dirname(figname)):
611 os.makedirs(os.path.dirname(figname))
625 os.makedirs(os.path.dirname(figname))
612 fig.savefig(figname)
626 fig.savefig(figname)
627 logo.remove()
613
628
614 def send_to_server(self):
629 def send_to_server(self):
615 '''
630 '''
General Comments 0
You need to be logged in to leave comments. Login now