Hi guys I’m working on CMIP6 data and trying to visualize the data using basemap, but the data for some of the ensemble models does not look right
Here is the screenshot:
This is the data i used to plot the image above
def plot_field(m, X, lats, lons, step=0.5, cmap=plt.get_cmap(‘jet’),
ax=False, grid=False, title=None):
lons, lats = np.meshgrid(lons, lats)
if not ax:
f, ax = plt.subplots(figsize=(8, (X.shape[0] / float(X.shape[1])) * 8))
m.ax = ax
Xmin = np.nanmin(X)
Xmax = np.nanmax(X)
im = m.contourf(lons, lats, X, np.arange(Xmin, Xmax+step, step), \
latlon=True, cmap=cmap, extend='both', ax=ax)
im = m.imshow(X, ax=ax)
m.drawcoastlines()
if grid:
m.drawmeridians(np.arange(0, 360, 30), labels=[0,0,0,1])
m.drawparallels(np.arange(-80, 80, 20), labels=[1,0,0,0])
m.colorbar(im)
if title:
ax.set_title(title)