针对WRF_LES台风大涡模拟数据,提取风场U, V, W分量,计算出三维风速场,用volumeplot函数实现风速三维体可视化。
fn = r'D:\Temp\LaSW\airship\WRF_LES\wrfout_d05_2014-07-20_05_00_00'
f = addfile(fn)
u = f['U'][0]
v = f['V'][0]
w = f['W'][0]
u = meteo.wrf.destagger(u, -1)
v = meteo.wrf.destagger(v, -2)
w = meteo.wrf.destagger(w, -3)
speed = sqrt(u*u + v*v + w*w)
nz, ny, nx = u.shape
height = arange(nz)
y = u.dimvalue(1)
x = u.dimvalue(2)
print('Plot...')
figure(facecolor='k', newfig=False)
ax = axes3d(projection=f.proj, clip_plane=False, orthographic=False, axis=False)
volumeplot(x, y, height, speed, cmap='BlAqGrYeOrRe', ray_casting='specular',
brightness=1.5, vmin=10, vmax=50,
opacity_nodes=[10,20,30,35,40,50], opacity_levels=[0,0.05,0.1,0.2,0.8,1])
colorbar(aspect=30, tickcolor='w')
xlim(x[0], x[-1])
ylim(y[0], y[-1])