def plot_region(regname,ptype='nh',axis=None,latlim=None,limsdict=None): """ plot_region(regname,ptype='nh',axis=None,latlim=None,limsdict=None): Given a region name, plot it for reference. latlims is unused right now if passing limsdict (to override regname), set regname='other' """ if regname=='other': reglims=limsdict else: reglims = con.get_regionlims(regname) latlims = reglims['latlims'] lonlims = reglims['lonlims'] dummy = con.get_t63landmask() lat = con.get_t63lat() lon = con.get_t63lon() lons,lats = np.meshgrid(lon,lat) reglatsbool = np.logical_and(lat>latlims[0],lat<latlims[1]) reglonsbool = np.logical_and(lon>lonlims[0],lon<lonlims[1]) # mask everything but the region of interest regmask = np.logical_or( np.logical_or(lats<latlims[0],lats>latlims[1]), np.logical_or(lons<lonlims[0],lons>lonlims[1])) dummym = ma.masked_where(regmask,dummy) plt.figure() kemmap(dummym,lat,lon,ptype=ptype,axis=axis,latlim=latlim,suppcb=1, cmin=-11,cmax=2,cmap='blue2blue_w10',drawgrid=True)
def add_regionpolym(region, bm, limsdict=None,ax=None, fc='none', ec='black', lw=2, alpha=1): """ add region box in map coords to a basemap. if region=='other', use limsdict """ if region=='other': rlims=limsdict else: rlims=con.get_regionlims(region) lats,lons = corners_to_poly(rlims) add_polym(lats,lons,bm,ax=ax,fc=fc,ec=ec,lw=lw,alpha=alpha)