| 
 
	积分57665贡献 精华在线时间 小时注册时间2011-6-21最后登录1970-1-1 
 | 
 
| 
WRF等模式的输出数据垂直方向是Sigma坐标,可以用meteolib包里的log_interpolate_1d函数将数据转为等压面垂直坐标。
x
登录后查看更多精彩内容~您需要 登录 才可以下载或查看,没有帐号?立即注册 
  
 
  f = addfile('D:/Temp/nc/wrf_example.nc')
lat = f['lat'][:,0]
lon = f['lon'][0,:]
temperature = f['temperature'][:,:,:,:]
pres = f['pressure'][:,:,:,:]
hgt = f['height'][:,:,:,:]
#Projection
proj = projinfo(proj='lcc', lon_0=-100, lat_0=45, lat_1=33, lat_2=45)
# Set the forecast hour
FH = 1
#Interpolate to a z level
p = [70000., 80000.]
height, temp = meteo.log_interpolate_1d(p, pres, hgt, temperature, axis=1)
#Plot
axesm(projinfo=proj, griddx=5, griddy=5)
geoshow('D:/Temp/map/states.shp', edgecolor='b')
geoshow('country', edgecolor=(0,0,255))
levs = arange(-20, 20, 1)
cols = makecolors(len(levs)+1, 'MPL_RdBu', reverse=True)
layer = contourfm(lon, lat, temp[FH,0,:,:], levs, colors=cols, proj=f.proj)
colorbar(layer, label='Celsius')
cs = contourm(lon, lat, height[FH,0,:,:], arange(2880,4000,60), colors='k', proj=f.proj)
clabel(cs, fontsize=10, drawshadow=False)
t = f.gettime(FH)
title('WRF-ARW Forecast VALID: %s UTC' % t.strftime('%Y-%m-%d %H:00') + \
    '\n700 hPa Heights (m) and Temperature (C)')
 
   | 
 |