#!/usr/bin/env python # Wenchang Yang (wenchang@princeton.edu) # Thu Apr 1 23:51:05 EDT 2021 if __name__ == '__main__': from misc.timer import Timer tt = Timer(f'start {__file__}') import sys, os.path, os, glob, datetime import xarray as xr, numpy as np, pandas as pd, matplotlib.pyplot as plt #more imports from ERA5.fig_map_omega500 import wyplot as wyplot_era5 from amipHadISST.fig_map_omega500 import wyplot as wyplot_hiram from AM2p5.fig_map_omega500 import wyplot as wyplot_am2p5 from AM2p5C360.fig_map_omega500 import wyplot as wyplot_am2p5c360 # if __name__ == '__main__': tt.check('end import') # #start from here if __name__ == '__main__': from wyconfig import * #my plot settings fig, axes = plt.subplots(2,2, figsize=(8,4)) vmax, center, levels, extend, cmap = 0.1, 0, 11, 'both', 'RdBu_r' ax = axes[0,0] plt.sca(ax) wyplot_era5(ax=ax, vmax=vmax, center=center, levels=levels, extend=extend, cmap=cmap) ax.set_xlabel(''); ax.set_ylabel(''); ax.set_title('Obs') ax.set_title('a', loc='left', fontweight='bold', ha='right', va='bottom') ax = axes[1,0] plt.sca(ax) wyplot_hiram(ax=ax, vmax=vmax, center=center, levels=levels, extend=extend, cmap=cmap) ax.set_xlabel(''); ax.set_ylabel(''); ax.set_title('HiRAM') ax.set_title('b', loc='left', fontweight='bold', ha='right', va='bottom') ax = axes[0,1] plt.sca(ax) wyplot_am2p5(ax=ax, vmax=vmax, center=center, levels=levels, extend=extend, cmap=cmap) ax.set_xlabel(''); ax.set_ylabel(''); ax.set_title('AM2.5') ax.set_title('c', loc='left', fontweight='bold', ha='right', va='bottom') ax = axes[1,1] plt.sca(ax) wyplot_am2p5c360(ax=ax, vmax=vmax, center=center, levels=levels, extend=extend, cmap=cmap) ax.set_xlabel(''); ax.set_ylabel(''); ax.set_title('AM2.5C360') ax.set_title('d', loc='left', fontweight='bold', ha='right', va='bottom') fig.suptitle('Oct $\omega_{500}$ climatology (1981-2018)') #savefig if len(sys.argv) > 1 and sys.argv[1] == 'savefig': figname = __file__.replace('.py', f'.png') wysavefig(figname) tt.check(f'**Done**') plt.show()