'How to plot models bias/difference in Python?
#read data
dset = xr.open_dataset('/badc/cmip6/data/CMIP6/ScenarioMIP/BCC/BCC-CSM2-MR/ssp370/r1i1p1f1/Amon/tas/gn/v20190314/tas_Amon_BCC-CSM2-MR_ssp370_r1i1p1f1_gn_201501-210012.nc', parallel=True)
#define timescale
time = dset.time
clim_ta = clim_set_t['tas'].groupby('time.month').mean('time', keep_attrs=True)
clim_ta_c = (clim_ta - 273.15)
# define areas
lat = dset.lat
lon = dset.lon
lon_range = lon[(lon>60) & (lon<150)]
lat_range = lat[(lat>10) & (lat<60)]
#plot
clim_ta_c.sel(lon=lon_range, lat=lat_range, month = 1).plot.contourf(ax=ax,
levels=np.arange(-30, 30 + 1, 1),
transform=ccrs.PlateCarree(),
cmap='Spectral_r',
cbar_kwargs={'orientation': 'vertical', #colorbar
'label': 'temperature (℃)',
'ticks': np.arange(-30, 30 + 5, 5),
'pad': 0.05,
'shrink': 0.8})
model = dset.attrs['source_id']
title = f'{model} near-surface temperature climatology 2015-2100 (1)'
plt.title(title, fontsize = 13)
The code above is the main part to plot climatology. I have plotted the BCC model in ssp126 scenario BCC in ssp126 and All models ensemble mean ensemble mean near-surface temperature climatology for January. I want to plot the model bias/difference ( bcc in ssp126 substract ensemble mean) monthly model bias but don't know how. Any help will be appreciated.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
