Skip to content

Commit

Permalink
Adding stratosphere bias plot
Browse files Browse the repository at this point in the history
  • Loading branch information
CPKalb committed Nov 29, 2023
1 parent acbcdc5 commit 47b6426
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import xarray as xr # http://xarray.pydata.org/
import numpy as np
import cmocean
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.ticker as mticker

def plot_zonal_u_bias(lats,levels,bias,obar,outfile):

plt.figure(0)
plt.contourf(lats,levels,np.transpose(bias),cmap= cmocean.cm.balance,levels = np.arange(-12,13,2))
plt.colorbar(orientation='horizontal')
CS = plt.contour(lats,levels,np.transpose(obar),levels=[0,10,20,30,40,50,60,70,80,90,100],colors='black')
plt.clabel(CS, inline=True, fontsize=10)
plt.gca().invert_yaxis()
plt.gca().set_yscale('log')
plt.gca().yaxis.set_major_formatter(mticker.ScalarFormatter())
plt.xlabel('Latitude (degrees)')
plt.ylabel('Pressure (hPa)')
plt.suptitle('GFS 24h Forecast Zonal Mean Wind Bias (ME) 02/2018')
plt.title('Black Contours: ERA Climatology')

# Save plot
plt.savefig(outfile)

0 comments on commit 47b6426

Please sign in to comment.