爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 5362|回复: 0

ERA5数据meteoinfo的Y轴双坐标剖面图

[复制链接]

新浪微博达人勋

发表于 2021-1-29 10:27:31 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册 新浪微博登陆

x
f = addfile(r'F:/20210108.nc')
rdata = f['r'][:,::-1,'40.95','115.27']
r = rdata.T
#r = r [::-1,:]
lev1 = r.dimvalue(0)
lev1 = lev1[::-1]
lev2 = meteo.pressure_to_height_std(lev1)
lev2 = lev2[:]/1000
r.setdimvalue(0, lev2)

udata = f['u'][:,::-1,'40.95','115.27']
vdata = f['v'][:,::-1,'40.95','115.27']
u = udata.T
v = vdata.T
#u = u [::-1,:]
#v = v [::-1,:]
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)

tdata = f['t'][:,::-1,'40.95','115.27']-273.15
t = tdata.T
#t = t [::-1,:]
lev7 = t.dimvalue(0)
lev7 = lev7[::-1]
lev8 = meteo.pressure_to_height_std(lev7)
lev8 = lev8[:]/1000
t.setdimvalue(0, lev8)

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(-60,36,2)
bss2 = []
for i in range(len(levs2)):#温度样式
    bs2={}
    bs2['value'] = levs2
    bs2['color'] = 'r'
    bs2['size'] = 2
    if levs2 < 0:
        bs2['linestyle'] = '--'
    bss2.append(bs2)
ls2 = plt.makesymbolspec('line',bss2)
layer3 = contour(t,symbolspec=ls2)
clabel(layer3)
xaxis(axistype='normal')
time=array(["18","19","20","21","22","23","00","01","02","03","04","05","06","07"])
#xlim(1610244.0, 1610290.8)
xlim(1609984.8,1610031.6)
ylim(lev2.min(),5.6)
xticks(r.dimvalue(1),time)
levy=array([875, 850, 825, 800, 775, 750, 700, 650, 600, 550, 500])
yticks(r.dimvalue(0), levy)
xaxis(tickin=False,tickfontsize=17)
yaxis(tickin=False,tickfontsize=17)
xlabel('Time(h)',fontsize=18)
ylabel('Pressure(hPa)',fontsize=18)
colorbar(layer1,fontsize=16,orientation='horizontal',aspect=50)

ax2 = twinx(ax1)
ylim(lev2.min(),5.6)
yaxis(location='right', tickfontsize=18)
ylabel('Hight(km)', fontsize=18, bold=False)
antialias(True)

poumian.png
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表