This data was created following the methods described in Gensini et al. (2020). If using this data, please cite:
import xarray as xr
import matplotlib.pyplot as plt
import cartopy
%matplotlib inline
df = xr.open_dataset('pper_tor_1979_2018.nc') #point to the file on your local system
df
#Hatching data
sig_df =xr.open_dataset('pper_sig_tor_1979_2018.nc') #point to the file on your local system
date_sel = '2011-04-27'
selection=df.sel(time=date_sel)
sig_selection=sig_df.sel(time=date_sel)
fig=plt.figure(figsize=(9,6))
plt.style.use('dark_background')
ax = plt.axes(projection = cartopy.crs.LambertConformal())
ax.add_feature(cartopy.feature.LAND,facecolor='grey')
ax.add_feature(cartopy.feature.OCEAN, alpha = 0.5)
ax.add_feature(cartopy.feature.COASTLINE,linewidth=0.5)
ax.add_feature(cartopy.feature.LAKES, alpha = 0.5)
ax.add_feature(cartopy.feature.STATES,linewidth=0.5)
plt.contourf(selection.lon.values, selection.lat.values, selection.p_perfect_tor.values[0,:,:],
levels=[0,2], colors=['#FFFFFF'],
transform=cartopy.crs.PlateCarree(), alpha=0.)
try:
c = plt.contourf(selection.lon.values, selection.lat.values, selection.p_perfect_tor.values[0,:,:],
levels=[2,5,10,15,30,45,60,100], colors=['#008b00','#8b4726','#ffc800', '#ff0000', '#ff00ff', '#912cee', '#104e8b'],
transform=cartopy.crs.PlateCarree())
plt.annotate('PPER Max\n'+str(selection.p_perfect_tor.values[0,:,:].max().round(1))+'%', xy=(0.88, 0.3), xycoords="figure fraction",
va="center", ha="center", color='white',fontsize=12,
bbox=dict(boxstyle="round", fc="k"))
except:
plt.annotate("No Reports", xy=(0.5, 0.5), xycoords="figure fraction",
va="center", ha="center", color='white',
bbox=dict(boxstyle="round", fc="k"))
try:
plt.contourf(sig_selection.lon.values, sig_selection.lat.values, sig_selection.p_perfect_sig_tor.values[0,:,:],
levels=[10,100], colors='none', hatches=['////'],
transform=cartopy.crs.PlateCarree())
plt.contour(sig_selection.lon.values, sig_selection.lat.values, sig_selection.p_perfect_sig_tor.values[0,:,:],
levels=[10,100], colors=['k'],
transform=cartopy.crs.PlateCarree())
except:
pass
ax.set_extent([-121, -71, 23, 50])
plt.title('24 Hour Practically Perfect Hindcast starting 1200 UTC ' + date_sel)
plt.colorbar(c,orientation="horizontal", pad=0.01, aspect=50,fraction=.1)
plt.savefig('pper_image.png',bbox_inches='tight',dpi=200)