- 积分
- 55948
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-6-21
- 最后登录
- 1970-1-1
|
发表于 2018-1-23 23:43:09
|
显示全部楼层
可以用 interp2d 函数来实现(缺省是双线性插值),脚本示例程序:
- f = addfile('D:/Temp/GrADS/model.ctl')
- vname = 'PS'
- psv = f[vname]
- ps = psv[0,'10:60','60:140']
- #Plot
- subplot(1,2,1)
- axesm(newaxes=False)
- geoshow('country', edgecolor=(0,0,255))
- layer = imshowm(ps, 20)
- #scatterm(ps)
- title('Pressure - low resolution')
- colorbar(layer, orientation='horizontal', extendrect=False, shrink=0.8, aspect=12)
- subplot(1,2,2)
- axesm(newaxes=False)
- geoshow('country', edgecolor=(0,0,255))
- x = linspace(60., 140., 34)
- y = linspace(10., 62., 28)
- xx, yy = meshgrid(x, y)
- ps1 = interp2d(ps, xx, yy)
- layer = imshowm(x, y, ps1, 20)
- #scatterm(x, y, ps1)
- title('Pressure - high resolution')
- colorbar(layer, orientation='horizontal', extendrect=False, shrink=0.8, aspect=12)
|
|