码迷,mamicode.com
首页 > 其他好文 > 详细

MeteoInfoLab脚本示例:计算垂直螺旋度

时间:2015-10-10 10:30:52      阅读:211      评论:0      收藏:0      [点我收藏+]

标签:

尝试编写MeteoInfoLab脚本计算垂直螺旋度,结果未经验证。

 

脚本程序:

print ‘Open data files...‘
f_uwnd = addfile(‘D:/Temp/nc/uwnd.2011.nc‘)
f_vwnd = addfile(‘D:/Temp/nc/vwnd.2011.nc‘)
f_omega = addfile(‘D:/Temp/nc/omega.2011.nc‘)

print ‘Calculate vertical helicity...‘
tidx = 173    # Jun 23, 2011
t = f_uwnd.gettime(tidx)
level = [1000, 100]
lat = [15,55]
lon = [70,135]
uwnd = f_uwnd[‘uwnd‘][tidx,level,lat,lon][:,::-1,:]
vwnd = f_vwnd[‘vwnd‘][tidx,level,lat,lon][:,::-1,:]
omega = f_omega[‘omega‘][tidx,level,lat,lon][:,::-1,:]
wd = hcurl(uwnd, vwnd)
lx = -(wd*omega*10.)/12.64*1e6
lx1 = lx[:,[40],:]
lev1 = lx1.dimvalue(0)
#lev2 = 1000 - lev1
lev2 = p2h(lev1)
levels = []
for i in range(0, len(lev1)):
    levels.append(‘%i‘ % lev1[i])
lx1.setdimvalue(0, lev2)

print ‘Plot...‘
layer = contourf(lx1, 20)
title(‘Vertical helicity (‘ + t.strftime(‘%Y-%m-%d‘) + ‘)‘)
yticks(lev2, levels)
xlabel(‘Longitude‘)
ylabel(‘Pressure (hPa)‘)
colorbar(layer)

技术分享

MeteoInfoLab脚本示例:计算垂直螺旋度

标签:

原文地址:http://www.cnblogs.com/yaqiang/p/4865732.html

踩
(0)
赞
(0)
   
举报
评论 一句话评论(0)
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!