- 积分
- 55975
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-6-21
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
示例了从一个台风文本文件中读取台风每个节点的经纬度信息并绘制台风路径图,示例数据文件可以从此贴下载:http://bbs.06climate.com/forum.p ... &extra=page%3D1 。
脚本程序:
- # Read typhoon data file
- fn = 'D:/Temp/ascii/198214track.dat'
- tf = open(fn)
- tf.readline()
- aline = tf.readline()
- id = aline.split()[1]
- tf.readline()
- lon = []
- lat = []
- ws = []
- for aline in tf:
- print aline
- datalist = aline.split()
- lat.append(float(datalist[1]))
- lon.append(float(datalist[2]))
- t = datalist[3]
- ws.append(int(datalist[4]))
- stat = datalist[6]
- if len(datalist) == 8:
- stat = stat + ' ' + datalist[7]
- # Plot
- axesm()
- lworld = shaperead('D:/Temp/map/country1.shp')
- geoshow(lworld, facecolor=[200,200,200])
- plotm(lon, lat, linewidth=2)
- layer = scatterm(lon, lat, ws)
- colorbar(layer, shrink=0.8)
- xlim(110, 140)
- ylim(15, 45)
- title('Typhoon pathway')
热带气旋的数据文件从此网站上下载:https://climatedataguide.ucar.ed ... one-best-track-data ,数据为netCDF格式,从中读取部分气旋路径的经纬度信息并绘图。
脚本程序:
- fn = 'D:/Temp/nc/Allstorms.ibtracs_wmo.v03r06.nc'
- f = addfile(fn)
- lons = f['lon_wmo'][:200,:]
- lats = f['lat_wmo'][:200,:]
- data = MIXYListData()
- for i in range(0, lons.dimlen(0)):
- data.addseries(lons[i,:], lats[i,:])
- # Plot
- axesm()
- mlayer = shaperead('D:/Temp/map/country1.shp')
- geoshow(mlayer)
- layer = plotm(data)
- #layer = scatterm(lons[:,0], lats[:,0], facecolor='b', size=2)
- title('IBTrACS')
- xlim(-180, 180)
- ylim(-90, 90)
|
|