- 积分
- 57108
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-6-21
- 最后登录
- 1970-1-1
|
发表于 2015-7-17 13:17:35
|
显示全部楼层
更新了软件(还没有打包发布),给PyStationData类增加了minloc和maxloc函数,并重载了__getitem__。下面是一个例子,不知道能否满足你的需求?
 - f = addfile_micaps('D:/Temp/micaps/13042408.000')
- pr = f.stationdata('Var1')
- axesm()
- mlayer = shaperead('D:/Temp/map/country1.shp')
- geoshow(mlayer)
- layer = scatterm(pr, s=4, edge=False)
- title('MICAPS 3')
- xlim(70, 140)
- ylim(15, 55)
- colorbar(layer, orientation='horizontal')
- minv, minidx = pr.minloc()
- maxv, maxidx = pr.maxloc()
- min_st, min_lon, min_lat = pr[minidx]
- max_st, max_lon, max_lat = pr[maxidx]
- print 'Min: %.2f, Stid: %s, Lon: %.2f, Lat: %.2f' %(minv, min_st, min_lon, min_lat)
- print 'Max: %.2f, Stid: %s, Lon: %.2f, Lat: %.2f' %(maxv, max_st, max_lon, max_lat)
|
|