- 积分
- 55950
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-6-21
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2016-8-22 15:35:19
|
显示全部楼层
应该是等值线填色算法的bug,将contourfm改为imshowm,
- print 'Open data files...'
- f = addfile('D:/Temp/grib/fnl_20160702_00_00.grib2')
- print 'Read data array...'
- v_rhum = f['Relative_humidity_isobaric']
- levels = v_rhum.dimvalue(1)
- tidx = 0 # July 2, 2016
- t = f.gettime(tidx)
- uwnd = f['u-component_of_wind_isobaric'][tidx,:,:,:]
- vwnd = f['v-component_of_wind_isobaric'][tidx,:,:,:]
- # Calculate
- print 'Calculate...'
- zn = uwnd.dimlen(0)
- yn = uwnd.dimlen(1)
- xn = uwnd.dimlen(2)
- q = zeros((zn,yn,xn))
- q = DimArray(q, uwnd.dims, uwnd.fill_value, uwnd.proj)
- zidx = 0
- for prs in uwnd.dimvalue(0):
- prs = prs * 0.001
- air = f['Temperature_isobaric'][tidx,zidx,::-1,:]
- rhum = f['Relative_humidity_isobaric'][tidx,zidx,::-1,:]
- g = 9.8
- es = 6.112*exp(17.67*(air-273.16)/(air-29.65))
- qs = 0.62197*es/(prs-0.378*es)
- qq = qs*rhum/100
- q[zidx,:,:] = qq
- zidx += 1
- qu = q*uwnd/g
- qv = q*vwnd/g
- qhdivg = hdivg(qu, qv)
- vqhdivg = trapz(qhdivg, levels)
- #Plot
- print 'Plot...'
- axesm()
- mlayer = shaperead('D:/Temp/map/country1.shp')
- geoshow(mlayer, edgecolor='black')
- layer = imshowm(vqhdivg, 20)
- title('Vertical Integrated Water Vapor Flux Divergency (' + t.strftime('%Y-%m-%d') + ')')
- colorbar(layer)
- xlim(0, 360)
- ylim(-90, 90)
|
|