- 积分
- 55950
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-6-21
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 MeteoInfo 于 2021-10-29 11:14 编辑
示例读取HYSPLIT模式输出的气团轨迹数据文件,生成轨迹图层,并显示轨迹各节点的气压图。
脚本程序:
- from org.meteoinfo.geometry.legend import PointStyle
- fn = os.path.join(migl.get_sample_folder(), 'HYSPLIT', 'tdump')
- f = addfile_hytraj(fn)
- lon = f['lon'][:,:]
- lat = f['lat'][:,:]
- #Plot
- figure(figsize=[526, 489], newfig=False)
- axesm(position=[0.12, 0.3, 0.85, 0.7])
- geoshow('country', edgecolor=(0,0,255), facecolor=(230,230,230))
- cols = makecolors(len(lon))
- levs = arange(0, 101, 5)
- tlayer = plot(lon, lat, levels=levs, isadd=False)
- ls = tlayer.update_legend('unique', 'ID')
- ii = 0
- for lb in ls.getLegendBreaks():
- lb.setSize(2)
- lb.setDrawSymbol(True)
- lb.setSymbolInterval(6)
- if ii == len(PointStyle.values()):
- ii = 0
- lb.setSymbolStyle(PointStyle.values()[ii])
- ii += 1
- geoshow(tlayer)
- scatter(lon[:,0], lat[:,0], size=6, color='r', marker='S')
- xlim(-92, -55)
- ylim(34, 54)
- yticks(arange(35, 54, 5))
- title('MeteoInfoLab script demo - Trajectory')
- axes(outerposition=[0, 0, 1, 0.3], yreverse=True, xaxistype='time')
- tt = f['time'][:,:]
- data = f['PRESSURE'][:,:]
- plot(tt, data, legend=tlayer.legend())
- xlabel('Time')
- ylabel('hPa')
|
评分
-
查看全部评分
|