u_int = int_pres(u, pdim=-3) # ndarray u_int2 = int_pres(u.values, plev*100, pdim=-3) p0=1e5 g = constants.g.values scale = g/p0 m = 7 k = 5 cint=2 plt.figure(figsize=(7,10)) plt.subplot(311) ap.contourf_latlon(u[m,k], clev=cint) plt.subplot(312) ap.contourf_latlon(scale*u_int[m], clev=cint) plt.subplot(313) ap.contourf_latlon(scale*u_int2[m], lat, lon, clev=cint) # ---------------------------------------------------------------------- # Integrate over subset # pmin = 400e2 # pmax = 600e2 # m, k = 3, 5 pmin, pmax = 600e2, 1000e2 m, k = 3, 2 scale = g/(pmax-pmin) cint=1
# ---------------------------------------------------------------------- # mask_oceans # DataArray input ps_land = mask_oceans(ps) # ndarray input ps_land2 = mask_oceans(ps, lat, lon) t = 0 cmap='jet' # pcolor plt.figure(figsize=(7,10)) plt.subplot(311) ap.pcolor_latlon(ps[t], cmap=cmap) plt.subplot(312) ap.pcolor_latlon(ps_land[t], cmap=cmap) plt.subplot(313) ap.pcolor_latlon(ps_land2[t], lat, lon, cmap=cmap) # contourf, contour ps_plot = ps[0]/100 cint = 100 plt.figure(figsize=(7,8)) plt.subplot(211) ap.contourf_latlon(ps_plot, clev=cint, cmap=cmap, symmetric=False) plt.subplot(212) ap.contour_latlon(ps_plot, clev=cint)
u_int = int_pres(u, pdim=-3) # ndarray u_int2 = int_pres(u.values, plev * 100, pdim=-3) p0 = 1e5 g = constants.g.values scale = g / p0 m = 7 k = 5 cint = 2 plt.figure(figsize=(7, 10)) plt.subplot(311) ap.contourf_latlon(u[m, k], clev=cint) plt.subplot(312) ap.contourf_latlon(scale * u_int[m], clev=cint) plt.subplot(313) ap.contourf_latlon(scale * u_int2[m], lat, lon, clev=cint) # ---------------------------------------------------------------------- # Integrate over subset # pmin = 400e2 # pmax = 600e2 # m, k = 3, 5 pmin, pmax = 600e2, 1000e2 m, k = 3, 2 scale = g / (pmax - pmin) cint = 1
# ---------------------------------------------------------------------- # mask_oceans # DataArray input ps_land = mask_oceans(ps) # ndarray input ps_land2 = mask_oceans(ps, lat, lon) t = 0 cmap = 'jet' # pcolor plt.figure(figsize=(7, 10)) plt.subplot(311) ap.pcolor_latlon(ps[t], cmap=cmap) plt.subplot(312) ap.pcolor_latlon(ps_land[t], cmap=cmap) plt.subplot(313) ap.pcolor_latlon(ps_land2[t], lat, lon, cmap=cmap) # contourf, contour ps_plot = ps[0] / 100 cint = 100 plt.figure(figsize=(7, 8)) plt.subplot(211) ap.contourf_latlon(ps_plot, clev=cint, cmap=cmap, symmetric=False) plt.subplot(212) ap.contour_latlon(ps_plot, clev=cint)