#!/usr/bin/env python # Wenchang Yang (wenchang@princeton.edu) # Fri Sep 15 09:51:11 EDT 2023 if __name__ == '__main__': import sys,os from misc.timer import Timer tt = Timer(f'[{os.getcwd()}] start ' + ' '.join(sys.argv)) import sys, os.path, os, glob, datetime import xarray as xr, numpy as np, pandas as pd, matplotlib.pyplot as plt #more imports wython = '/tigress/wenchang/wython' if wython not in sys.path: sys.path.append(wython); print('added to python path:', wython) #from misc import get_kws_from_argv from tc_monitor_AM2p5_amipLMR2019SST0850ic_tigercpu_intelmpi_18_540PE import ds_counts_yearly as ds_am2p5 from tc_monitor_HIRAM_amipLMR2019SST0850ic_tigercpu_intelmpi_18_540PE import ds_counts_yearly as ds_hiram # if __name__ == '__main__': tt.check('end import') # #start from here if __name__ == '__main__': from wyconfig import * #my plot settings lowpass = lambda da: da#.rolling(year=9, min_periods=1).mean() basin = """ global WP NA """.split()[-1] fig,ax = plt.subplots() ds = ds_am2p5 label = 'AM2.5' ds[basin].pipe(lowpass).plot(label=label, ax=ax) ds = ds_hiram label = 'HiRAM' ds[basin].pipe(lowpass).plot(label=label, ax=ax) ax.legend() ax.set_title(f'{basin} TC #') #savefig if 'savefig' in sys.argv or 's' in sys.argv: figname = __file__.replace('.py', f'.png') if 'overwritefig' in sys.argv or 'o' in sys.argv: wysavefig(figname, overwritefig=True) else: wysavefig(figname) tt.check(f'**Done**') print() if 'notshowfig' in sys.argv or 'n' in sys.argv: pass else: if 'plt' in globals(): plt.show()