- 积分
- 3995
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2016-3-4
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
f=addfile("F:/dd.grib2")
#1 处理数据
rdata = f['Relative_humidity_isobaric'][:,-21::-1,'38','114']
r = rdata.T
lev1 = r.dimvalue(0)
lev1=lev1[::-1]
lev2 = meteo.pressure_to_height_std(lev1)
lev2 = lev2[:]/1000
r.setdimvalue(0, lev2)
udata = f['u-component_of_wind_isobaric'][:,-21::-1,'38','114']
vdata = f['v-component_of_wind_isobaric'][:,-21::-1,'38','114']
u = udata.T
v = vdata.T
lev3 = u.dimvalue(0)
lev3=lev3[::-1]
lev4 = meteo.pressure_to_height_std(lev3)
lev4 = lev4[:]/1000
u.setdimvalue(0, lev4)
lev5 = v.dimvalue(0)
lev5=lev5[::-1]
lev6 = meteo.pressure_to_height_std(lev5)
lev6 = lev6[:]/1000
v.setdimvalue(0, lev6)
wdata = f['Vertical_velocity_pressure_isobaric'][:,-21::-1,'38','114']#Vertical_velocity_pressure_isobaric/Vertical_velocity_geometric_isobaric
w = wdata.T
lev7 = w.dimvalue(0)
lev7=lev7[::-1]
lev8 = meteo.pressure_to_height_std(lev7)
lev8 = lev8[:]/1000
w.setdimvalue(0, lev8)
tdata = f['Temperature_isobaric'][:,-21::-1,'38','114']-273.15
t = tdata.T
lev9 = t.dimvalue(0)
lev9=lev9[::-1]
lev10 = meteo.pressure_to_height_std(lev9)
lev10 = lev10[:]/1000
t.setdimvalue(0, lev10)
#2 作图
ax1=axes()
levs1 = arange(60,100,10)
cols = [(255,255,255),(0,229,238),(0,238,0),(0,205,0),(0,160,0),(0,110,0)]
layer1 = contourf(r,levs1,colors=cols)
layer2 = barbs(u , v, color='k',size=12)
levs2 = arange(-70, 40, 2)
bss2 = []
for i in range(len(levs2)):
bs2={}
bs2['value'] = levs2[i]
bs2['color'] = 'r'
if levs2[i] < 0:
bs2['linestyle'] = '--'
bss2.append(bs2)
ls2 = plt.makesymbolspec('line',bss2)
layer3 = contour(t,symbolspec=ls2)
clabel(layer3)
levs3 = arange(-20, 20, 0.1)
bssw = []
for i in range(len(levs3)):
bsw2={}
bsw2['value'] = levs3[i]
bsw2['color'] = "b"
if levs3[i] < 0:
bsw2['linestyle'] = '--'
bssw.append(bsw2)
lsw2 = plt.makesymbolspec('line',bssw)
layer4 = contour(w,symbolspec=lsw2)
clabel(layer4)
xaxis(axistype='normal')
time=array(["0420","0502","0508","0514","0520","0602","0608","0614","0620","0702","0708","0714","0720"])
xlim(1578110.4, 1578304.8)
ylim(-61.90631724091924,-24.20740180475845)
date= miutil.nums2dates(t.dimvalue(1))
xticks(t.dimvalue(1),time)
levy=array([1000, 975, 950, 925, 900, 850, 800, 750, 700, 650, 600, 550, 500, 450, 400, 350, 300, 250, 200, 150, 100])
yticks(t.dimvalue(0),levy)
colorbar(layer1,fontsize=17,shrink=0.9,xshift=1,label="%", labelloc='top',aspect=35)
xlabel('Time(BJT)',fontsize=17)
ylabel('Pressure(hPa)',fontsize=17)
xaxis(tickin=False,tickfontsize=17)
yaxis(tickin=False,tickfontsize=17)
title(u'Time Series of RH(%),Wind(m/s),Temp,Vertical velocity',fontname=u'黑体', fontsize=20, color='k')
|
|