- 积分
- 76
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2019-4-29
- 最后登录
- 1970-1-1
|
发表于 2021-7-29 21:47:33
|
显示全部楼层
你好,我按照您的程序改了一下路径,为什么报错,能帮忙看看吗,谢谢!
f = addfile("D:/nc/20210621.nc")
gh= f['z'][:,::-1,"26","100"]
udata = f['u'][:,::-1,"26","100"]
vdata = f['v'][:,::-1,"26","100"]
rmdata=f['r'][:,::-1,"26","100"]
tmdata=f['t'][:,::-1,"26","100"]-273.15
Tmdata=f['time'][:]
wmdata=f['w'][:,::-1,"26","100"]
u=udata.T*2.5
v=vdata.T*2.5
r=rmdata.T
t=tmdata.T
w=wmdata.T
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)
colorbar(layer1,fontsize=16,bold="Ture")
layer2 = barbs(u,v,color='k',size=12)
levs = arange(-60,36,2)
bss2 = []
for i in range(len(levs)):#温度样式
bs2={}
bs2['value'] = levs[i]
bs2['color'] = 'r'
bs2['size'] = 2
if levs[i] < 0:
bs2['linestyle'] = '--'
bss2.append(bs2)
ls2 = plt.makesymbolspec('line',bss2)
layer3 = contour(t,symbolspec=ls2)
clabel(layer3)
#levw=arange(-10,10,0.1)
#layer4=contour(w,levw,color='k',size=2)
#clabel(layer4)
lev1 = tmdata.dimvalue(0)
lev1=lev1[::-1]
lev2 = meteo.pressure_to_height_std(lev1)
lev2 = lev2[:]/1000
tdata.setdimvalue(0, lev2)
xaxis(axistype='time',timetickformat='ddHH')
xticks(fontsize=15,bold=True)
xlabel('Time(UTC)',fontsize=15,bold="Ture")
ylim(480,1020)
levy=array([750,700,650,600,550,500,450,400,350,300,250,225,200,175,150,125,100])
yticks(t.dimvalue(0),levy,bold="Ture")
ylabel('Pressure (hPa)',fontsize=15,bold="Ture")
报错:
>>> run script...
File "<iostream>", line 2
gh= f['z'][:,::-1,"26","100"]
^
SyntaxError: mismatched input '' expecting EOF
|
|