- 积分
- 57421
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-6-21
- 最后登录
- 1970-1-1
|
发表于 2016-3-24 23:55:38
|
显示全部楼层
回帖奖励 +5 金钱
 - #Add file
- fn = 'D:/Temp/grads/wrfout_d02.ctl'
- f = addfile(fn)
- #Get a variable
- v = f['T2']
- #Get X/Y dimension value
- x = v.dimvalue(2)
- y = v.dimvalue(1)
- #Project X/Y to Lon/Lat
- toproj = projinfo()
- xx, yy = meshgrid(x, y)
- lon, lat = project(xx, yy, fromproj=f.proj, toproj=toproj)
- #Write lon/lat
- lon.savegrid(x, y, 'C:/Temp/test/lon.txt')
- lat.savegrid(x, y, 'C:/Temp/test/lat.txt')
- #Plot for test
- scatter(lon[::4,::4], lat[::4,::4], edge=False, size=3, color='b')
|
|