- 积分
- 55946
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-6-21
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 MeteoInfo 于 2016-7-22 16:35 编辑
尝试绘制T-LnP图,从micaps第5类数据中读取了某个站的探空数据(不同高度的温度、露点、风向、风速)。
目前绘制的图形,温度、露点、风向杆廓线、干绝热线:
脚本程序:
- #Read data from MICAPS 5 data file
- fn = 'D:/Temp/micaps/16051108.000'
- f = open(fn)
- for i in range(2):
- f.readline()
- line = f.readline().strip()
- n = int(line.split()[4]) / 6
- pres = [] #Pressure
- height = [] #Height
- temp = [] #Temperature
- temp_d = [] #Dew point
- wdir = [] #Wind direction
- wspeed = [] #Wind speed
- for i in range(n):
- line = f.readline().strip()
- data = line.split()
- for j in range(len(data)):
- if data[j] == '9999':
- data[j] = nan
- else:
- data[j] = float(data[j])
- pres.append(data[0])
- height.append(data[1])
- temp.append(data[2])
- temp_d.append(data[3])
- wdir.append(data[4])
- wspeed.append(data[5])
- pres = array(pres)
- y = log(1000./pres)
- #Plot
- #Plot dry lapse lines
- for t0 in range(-90, 200, 10):
- t = meteo.dry_lapse(pres, t0 + 273.15) - 273.15
- plot(t, y, color=[255,204,0])
- #Plot temperature line
- line1 = plot(temp, y, 'r', linewidth=2, label='Temperature')
- #Plot dew point line
- line2 = plot(temp_d, y, 'g', linewidth=2, label='Dew Point')
- #Plot wind barbs
- x = zeros(len(y))
- x = x + 10
- barbs(x, y, wdir, wspeed, isuv=False, colors='b')
- yticks(y[1:], pres[1:].astype('int'))
- ylabel('Pressure (hPa)')
- xlabel(r'$\rm{Temperature} \ (^{\circ} \ C)$')
- legend([line1, line2])
- grid()
- xlim(-90, 20)
- ylim(y[1], y[len(y)-1])
- title('T-LnP figure example')
|
|