- 积分
- 56367
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-6-21
- 最后登录
- 1970-1-1

|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
绘制风向杆图的函数是barbs和barbsm(绘制在地图上),需要站点的经/纬度,风场U/V分量或者风速/风向。函数里的isuv参数默认是True,表明风场用的是U/V分量,如果isuv的值为False则表示风场用的是风向/风速数据。这里示例从MICAPS 1类数据中读出站点经/纬度和风速/风向数据并绘制站点风向杆图。
 - #Set data folders
- basedir = 'D:/MyProgram/Distribution/java/MeteoInfo/MeteoInfo'
- datadir = os.path.join(basedir, 'sample/MICAPS')
- mapdir = os.path.join(basedir, 'map')
- #Read shape files
- lworld = shaperead(os.path.join(mapdir, 'country1.shp'))
- lchina = shaperead(os.path.join(mapdir, 'bou2_4p.shp'))
- #Read station data
- f = addfile_micaps(os.path.join(datadir, '10101414.000'))
- lon = f['Longitude'][:]
- lat = f['Latitude'][:]
- ws = f['WindSpeed'][:]
- wd = f['WindDirection'][:]
- #Plot
- axesm(bgcolor=(204,255,255))
- geoshow(lworld, edgecolor='k', facecolor=(255,251,195))
- geoshow(lchina, edgecolor='k')
- layer = barbsm(lon, lat, wd, ws, color='b', isuv=False)
- yticks([20,30,40,50])
- title('Station barb plot example')
- xlim(72, 136)
- ylim(16, 55)
|
|