# Set up plot crs (mapcrs) and the data crs, will need to
-# transform all variables
-mapcrs = ccrs.LambertConformal(central_longitude=-100,
- central_latitude=35,
- standard_parallels=(30, 60))
-datacrs = ccrs.PlateCarree()
-
-# Set some common contour interval levels
-clevs_700_tmpc = np.arange(-40, 41, 2)
-clevs_700_hght = np.arange(0, 8000, 30)
-clevs_300_hght = np.arange(0, 10000, 120)
-
-# Create slice to reduce number of wind barbs at plot time
-wind_slice = (slice(None, None, 10), slice(None, None, 10))
-
-# Start figure
-fig = plt.figure(1, figsize=(22, 15))
-
-# Use gridspec to help size elements of plot; small top plot
-# and big bottom plot
-gs = gridspec.GridSpec(nrows=2, ncols=2, height_ratios=[1, 1],
- hspace=0.03, wspace=0.03)
-
-
-# Upper-left panel (700-hPa TMPC)
-ax1 = plt.subplot(gs[0, 0], projection=mapcrs)
-ax1.set_extent([-130, -72, 25, 49], ccrs.PlateCarree())
-ax1.add_feature(cfeature.COASTLINE.with_scale('50m'))
-ax1.add_feature(cfeature.STATES.with_scale('50m'))
-
-cf = ax1.contourf(lons, lats, tmpc_700, clevs_700_tmpc,
- cmap=plt.cm.coolwarm, transform=datacrs)
-cb = plt.colorbar(cf, orientation='horizontal', pad=0, aspect=50)
-cb.set_label(r'$^{\circ}$C')
-
-csf = ax1.contour(lons, lats, tmpc_700, clevs_700_tmpc, colors='grey',
- linestyles='dashed', transform=datacrs)
-plt.clabel(csf, fmt='%d')
-
-cs = ax1.contour(lons, lats, hght_700, clevs_700_hght, colors='black',
- transform=datacrs)
-plt.clabel(cs, fmt='%d')
-
-ax1.barbs(lons[wind_slice].values, lats[wind_slice].values,
- uwnd_700.metpy.convert_units('kt')[wind_slice].values,
- vwnd_700[wind_slice].metpy.convert_units('kt').values,
- pivot='middle', color='black', transform=datacrs)
-
-plt.title('700-hPa NARR HGHT (m), TMPC, and Wind (kt)', loc='left')
-plt.title(f'Valid: {vtime}', loc='right')
-
-
-# Lower-left panel (300-hPa TMPC)
-ax2 = plt.subplot(gs[1, 0], projection=mapcrs)
-ax2.set_extent([-130, -72, 25, 49], ccrs.PlateCarree())
-ax2.add_feature(cfeature.COASTLINE.with_scale('50m'))
-ax2.add_feature(cfeature.STATES.with_scale('50m'))
-
-cf = ax2.contourf(lons, lats, tmpc_300, range(-60, -24, 2),
- cmap=plt.cm.BuPu_r, transform=datacrs)
-cb = plt.colorbar(cf, orientation='horizontal', pad=0, aspect=50)
-cb.set_label(r'$^{\circ}$C')
-
-csf = ax2.contour(lons, lats, tmpc_300, range(-60, 0, 2),
- colors='grey', linestyles='dashed', transform=datacrs)
-plt.clabel(csf, fmt='%d')
-
-cs = ax2.contour(lons, lats, hght_300, clevs_300_hght, colors='black',
- transform=datacrs)
-plt.clabel(cs, fmt='%d')
-
-ax2.barbs(lons[wind_slice].values, lats[wind_slice].values,
- uwnd_300.metpy.convert_units('kt')[wind_slice].values,
- vwnd_300[wind_slice].metpy.convert_units('kt').values,
- pivot='middle', color='black', transform=datacrs)
-
-plt.title('300-hPa NARR HGHT (m), TMPC, and Wind (kt)', loc='left')
-plt.title(f'Valid: {vtime}', loc='right')
-
-
-# Upper-right panel (700-hPa TMPC Adv)
-ax3 = plt.subplot(gs[0, 1], projection=mapcrs)
-ax3.set_extent([-130, -72, 25, 49], ccrs.PlateCarree())
-ax3.add_feature(cfeature.COASTLINE.with_scale('50m'))
-ax3.add_feature(cfeature.STATES.with_scale('50m'))
-
-cf = ax3.contourf(lons, lats, tadv_700*3600, range(-8, 9, 1),
- cmap=plt.cm.coolwarm, transform=datacrs)
-cb = plt.colorbar(cf, orientation='horizontal', pad=0, aspect=50)
-cb.set_label(r'TMPC ADV ($^{\circ}$C h$^{-1}$)')
-
-csf = ax3.contour(lons, lats, tmpc_700, clevs_700_tmpc, colors='grey',
- linestyles='dashed', transform=datacrs)
-plt.clabel(csf, fmt='%d')
-
-cs = ax3.contour(lons, lats, hght_700, clevs_700_hght, colors='black',
- transform=datacrs)
-plt.clabel(cs, fmt='%d')
-
-ax3.barbs(lons[wind_slice].values, lats[wind_slice].values,
- uwnd_700.metpy.convert_units('kt')[wind_slice].values,
- vwnd_700[wind_slice].metpy.convert_units('kt').values,
- pivot='middle', color='black', transform=datacrs)
-
-plt.title('700-hPa NARR HGHT (m), TMP ADV (C/h), and Wind (kt)', loc='left')
-plt.title(f'Valid: {vtime}', loc='right')
-
-
-# Lower-right panel (diff TMPC)
-ax4 = plt.subplot(gs[1, 1], projection=mapcrs)
-ax4.set_extent([-130, -72, 25, 49], ccrs.PlateCarree())
-ax4.add_feature(cfeature.COASTLINE.with_scale('50m'))
-ax4.add_feature(cfeature.STATES.with_scale('50m'))
-
-cf = ax4.contourf(lons, lats, diff_tadv*1e9, clevs_700_tmpc,
- cmap=plt.cm.coolwarm, extend='both', transform=datacrs)
-cb = plt.colorbar(cf, orientation='horizontal', pad=0, aspect=50,
- extendrect=True)
-cb.set_label(r'dTMPC ($10^9$ $^{\circ}$C s$^{-1}$ Pa$^{-1}$)')
-
-csf = ax4.contour(lons, lats, tmpc_700, clevs_700_tmpc, colors='grey',
- linestyles='dashed', transform=datacrs)
-plt.clabel(csf, fmt='%d')
-
-cs = ax4.contour(lons, lats, hght_700, clevs_700_hght, colors='black',
- transform=datacrs)
-plt.clabel(cs, fmt='%d')
-
-ax4.barbs(lons[wind_slice].values, lats[wind_slice].values,
- uwnd_700.metpy.convert_units('kt')[wind_slice].values,
- vwnd_700[wind_slice].metpy.convert_units('kt').values,
- pivot='middle', color='black', transform=datacrs)
-
-plt.title('700-hPa NARR HGHT (m), Diff. TMP ADV (C/s/Pa), and Wind (kt)', loc='left')
-plt.title(f'Valid: {vtime}', loc='right')
-