- 积分
- 2005
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2016-4-7
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
# The standard interface requires that latitude and longitude be the leading
# dimensions of the input wind components, and that wind components must be
# either 2D or 3D arrays. The data read in is 3D and has latitude and
# longitude as the last dimensions. The bundled tools can make the process of
# re-shaping the data a lot easier to manage.
uwnd, uwnd_info = prep_data(U_data[:,::-1,:], 'tyx')
vwnd, vwnd_info = prep_data(V_data[:,::-1,:], 'tyx')
u200wnd, uwnd200_info = prep_data(U200_data[:,::-1,:], 'tyx')
v200wnd, vwnd200_info = prep_data(V200_data[:,::-1,:], 'tyx')
# It is also required that the latitude dimension is north-to-south. Again the
# bundled tools make this easy.
lat_ns=lats[::-1]
lats, uwnd, vwnd = order_latdim(lat_ns[8:45], uwnd, vwnd)
lats200, u200wnd, v200wnd = order_latdim(lat_ns[:45], u200wnd, v200wnd)
# Create a VectorWind instance to handle the computations.
w = VectorWind(uwnd, vwnd)
w200 = VectorWind(u200wnd, v200wnd)
# Compute components of rossby wave source: absolute vorticity, divergence,
# irrotational (divergent) wind components, gradients of absolute vorticity.
# eta = w.absolutevorticity()
# div = w.divergence()
uchi, vchi = w.irrotationalcomponent()
u200chi, v200chi = w200.irrotationalcomponent()
# Compute the streamfunction and velocity potential. Also use the bundled
# tools to re-shape the outputs to the 4D shape of the wind components as they
# were read off files.#画图只使用vp
sf, vp = w.sfvp()
sf = recover_data(sf, uwnd_info)
vp = recover_data(vp, uwnd_info)
uchi = recover_data(uchi,uwnd_info)
vchi = recover_data(vchi,vwnd_info)
sf200, vp200 = w200.sfvp()
sf200 = recover_data(sf200, uwnd200_info)
vp200 = recover_data(vp200, uwnd200_info)
u200chi = recover_data(u200chi,uwnd200_info)
v200chi = recover_data(v200chi,vwnd200_info)
#转换纬度为从南到北
vp=vp[:,::-1,:]
uchi=uchi[:,::-1,:]
vchi=vchi[:,::-1,:]
vp200=vp200[:,::-1,:]
u200chi=u200chi[:,::-1,:]
v200chi=v200chi[:,::-1,:]
uchi,lons_c = add_cyclic_point(uchi, lons[20:97])
vchi,lons_c = add_cyclic_point(vchi, lons[20:97])
vp,lons_c = add_cyclic_point(vp, lons[20:97])
u200chi,lons_c200 = add_cyclic_point(u200chi, lons[:97])
v200chi,lons_c200 = add_cyclic_point(v200chi, lons[:97])
vp200,lons_c200 = add_cyclic_point(vp200, lons[:97])
|
-
|