##// 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 32 from matplotlib.patches import Polygon
33 33 from mpl_toolkits.axes_grid1 import make_axes_locatable
34 34 from matplotlib.ticker import FuncFormatter, LinearLocator, MultipleLocator
35 import matplotlib.cbook as cbook
36 import matplotlib.image as image
35 37
36 38 import cartopy.crs as ccrs
37 39
@@ -42,6 +44,10 from schainpy.model.proc.jroproc_base import ProcessingUnit, Operation, MPDecora
42 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 51 EARTH_RADIUS = 6.3710e3
46 52
47 53 register_cmap()
@@ -466,20 +472,23 class Plot(Operation):
466 472 if self.grid:
467 473 ax.grid(True)
468 474 if not self.polar:
469 ax.set_title('{} {} {}'.format(
475 ax.set_title('{} \n{} {} ({} LT)'.format(
470 476 self.titles[n],
471 477 self.getDateTime(self.data.max_time).strftime(
472 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 482 size=8)
475 483 else:
476 #ax.set_title('{}'.format(self.titles[n]), size=8)
477 ax.set_title('{} {} {}'.format(
484 ax.set_title('{} \n{} {} ({} LT)'.format(
478 485 self.titles[n],
479 486 self.getDateTime(self.data.max_time).strftime(
480 487 '%Y-%m-%d %H:%M:%S'),
481 self.time_label),
482 size=8)
488 self.time_label,
489 (self.getDateTime(self.data.max_time)-datetime.timedelta(hours=5)).strftime(
490 '%Y-%m-%d %H:%M:%S')),
491 size=8)
483 492 if self.mode == 'PPI':
484 493 ax.set_yticks(ax.get_yticks(), labels=ax.get_yticks(), color='white')
485 494 ax.yaxis.labelpad = 28
@@ -580,6 +589,11 class Plot(Operation):
580 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 597 else:
584 598 figname = os.path.join(
585 599 self.save,
@@ -610,6 +624,7 class Plot(Operation):
610 624 if not os.path.isdir(os.path.dirname(figname)):
611 625 os.makedirs(os.path.dirname(figname))
612 626 fig.savefig(figname)
627 logo.remove()
613 628
614 629 def send_to_server(self):
615 630 '''
General Comments 0
You need to be logged in to leave comments. Login now