MeteoInfoLab脚本示例:天气现象符号

天气现象符号分布图实际就是散点图,可以用scatterm函数绘制,但之前需要创建天气符号图例,用weatherspec函数。如果只需要绘制某些天气现象(比如雾、霾),可以给出相应的天气符号序号列表(可以在网上查找)。

脚本程序:

#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'))
data = f.stationdata('WeatherNow')
#Plot
axesm(bgcolor=(204,255,255))
geoshow(lworld, edgecolor='k', facecolor=(255,251,195))
geoshow(lchina, edgecolor='k')
ls = weatherspec()
layer = scatterm(data, symbolspec=ls)
#colorbar(layer)
xlim(72, 136)
ylim(16, 55)

posted on 2015-10-11 15:13  yaqiang  阅读(1172)  评论(0编辑  收藏  举报

导航