- 积分
- 124
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2016-7-1
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2016-8-23 13:21:39
|
显示全部楼层
感谢老师回复,根据您帖子里的代码做了改动
- f = addfile_surfer('E:/Ymeantemp.nc')
- tdata = f['var'][:,:]
- un = shaperead('E:/TEMPERATURES/map/global.shp')
- i = 0
- for rpoly in un.getShapes():
-     name = un.getCellValue('NAME', i)
-     mdata = tdata.maskout(rpoly)
-     tave = mdata.ave()
-     tmin = mdata.min()
-     tmax = mdata.max()
-     print name + ', Ave: %.2f, Min: %.2f, Max: %.2f' %(tave, tmin, tmax)
-     i += 1
复制代码
运行后提示错误,老师能不能帮忙看一下哪里的问题。非常感谢!!
File "", line 6
    name = un.getCellValue('NAME', i)
^
SyntaxError: expected an indented block
这里是我使用的地图信息
COLUMN TYPE DESCRIPTION
Shape Polygon Country/area border as polygon(s)
FIPS String(2) FIPS 10-4 Country Code
ISO2 String(2) ISO 3166-1 Alpha-2 Country Code
ISO3 String(3) ISO 3166-1 Alpha-3 Country Code
UN Short Integer(3) ISO 3166-1 Numeric-3 Country Code
NAME String(50) Name of country/area
AREA Long Integer(7) Land area, FAO Statistics (2002)
POP2005 Double(10,0) Population, World Polulation Prospects (2005)
REGION Short Integer(3) Macro geographical (continental region), UN Statistics
SUBREGION Short Integer(3) Geogrpahical sub-region, UN Statistics
LON FLOAT (7,3) Longitude
LAT FLOAT (6,3) Latitude
|
|