#!/usr/bin/env python # Wenchang Yang (wenchang@princeton.edu) # Sun Nov 15 00:21:56 EST 2020 if __name__ == '__main__': from misc.timer import Timer tt = Timer(f'start {__file__}') import sys, os.path, os, glob import xarray as xr, numpy as np, pandas as pd #import matplotlib.pyplot as plt #more imports import xtc from geoplots import mapplot # if __name__ == '__main__': tt.check('end import') # #start from here ds = xr.open_dataset('amipHadISST_tigercpu_intelmpi_18_540PE_en01_yr1971to2018_mo1to12_rainPerc99.5_distThresh2.9_sizeThresh3.1_latLim30.wy.nc') da = ds.tc.density(genesis_on=True) da_mclim = da.groupby('time.month').mean('time') da_aclim = da_mclim.sum('month').assign_attrs(long_name='seed genesis density', units='# per 10$^\circ$x10$^\circ$ per year') if __name__ == '__main__': from wyconfig import * #my plot settings plt.figure() da_aclim.plot.contourf(levels=np.logspace(-1, 9, 11, base=2)) mapplot() plt.title('HiRAM AMIP 1971-2018, en01') tt.check(f'**Done**') plt.show()