- 积分
- 55947
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-6-21
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2015-11-3 00:06:50
|
显示全部楼层
根据你提供的格点设置,获取格点在Lambert投影下的坐标(米为单位),用下面的脚本:
- fromproj = projinfo(proj='longlat')
- toproj = projinfo(proj='lcc', lon_0=104.137, lat_0=35.946, lat_1=30.0, lat_2=60.0)
- lon = 104.583
- lat = 35.5731
- x, y = project(lon, lat, fromproj=fromproj, toproj=toproj)
然后用下面的脚本将Sinusoidal投影数据转为Lambert投影数据。
- f = addfile('D:/Temp/Hdf/MOD09A1.A2008217.h26v05.006.2015177090630.hdf')
- vname = 'sur_refl_b01'
- data = f[vname][:,:]
- #Set projection
- toproj = projinfo(proj='lcc', lon_0=104.137, lat_0=35.946, lat_1=30.0, lat_2=60.0)
- #Set x/y
- x = arange(-40586.90607311319, 39626.10751807479, 1000)
- y = arange(-40422.11861349553, 39427.31922978533, 1000)
- #Project
- data = data.project(x, y, toproj)
- #Write to a binary file
- outfn = 'D:/Temp/test/' + vname + '.bin'
- binwrite(outfn, data)
- #Plot
- axesm(projinfo=toproj, griddx=0.2, griddy=0.2)
- mlayer = shaperead('D:/Temp/map/country1.shp')
- geoshow(mlayer)
- levs = arange(0, 100, 5)
- layer = imshowm(x, y, data, 20, proj=toproj)
- title(vname)
- colorbar(layer)
- #axism()
|
|