- 积分
- 4499
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2016-4-23
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
我用这个脚本绘图,结果所有点风矢量都堆积到x轴上,并没有按高度分布请问怎么样设置可以让风矢量随高度分布
@liuxiaoyue
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
begin
Longitude1 = 103.64
Latitude1 = 36.12
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Longitude2 = 103.67
Latitude2 = 36.58
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
tlevl=30
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
f1=addfile("/home/public2/data/18qinc/lanzhouandxinqu/wrfout_d03_2014-01-09_00:00:00","r")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
u11=wrf_user_getvar(f1,"ua",-1)
v11=wrf_user_getvar(f1,"va",-1)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
res0 = True
res0@returnInt = True ; False : return real values, True: return interger values
point = wrf_user_ll_to_ij(f1,Longitude1,Latitude1,res0) ; wrf_user_ll_to_ij(nc_file,lon,lat,opt)
x = point(0)
y = point(1)
print("X location is: " + x) ; print the value of X at the screen
print("Y location is: " + y) ; print the value of Y at the screen
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
u1=new((29),"float")
v1=new((29),"float")
u1(0:28) = dim_avg_n_Wrap(u11(tlevl::24,0:28,y,x),0)
v1(0:28) = dim_avg_n_Wrap(v11(tlevl::24,0:28,y,x),0)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
point1 = wrf_user_ll_to_ij(f1,Longitude2,Latitude2,res0) ; wrf_user_ll_to_ij(nc_file,lon,lat,opt)
x1 = point1(0)
y1 = point1(1)
print("X location is: " + x1) ; print the value of X at the screen
print("Y location is: " + y1) ; print the value of Y at the screen
u2=new((29),"float")
v2=new((29),"float")
u2(0:28) = dim_avg_n_Wrap(u11(tlevl::24,0:28,y1,x1),0)
v2(0:28) = dim_avg_n_Wrap(v11(tlevl::24,0:28,y1,x1),0)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
h1 = f1->HGT(tlevl,y,x)
g1=wrf_user_getvar(f1,"z",0)
i1=g1(:,y,x)
i1=i1-h1
z1= new((29),"float")
z1(0:28)=i1(0:28)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
h2 = f1->HGT(tlevl,y1,x1)
g2=wrf_user_getvar(f1,"z",0)
i2=g2(:,y1,x1)
i2=i2-h2
z2= new((29),"float")
z2(0)=0
z2(1:28)=i2(0:27)
wks = gsn_open_wks ("png","uv-vertical") ; chu tu wen jian ming
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
u=new((/29,2/),"float")
v=new((/29,2/),"float")
z=new((/29,2/),"float")
u(0:28,0)=u1(0:28)
u(0:28,1)=u2(0:28)
v(0:28,0)=v1(0:28)
v(0:28,1)=v2(0:28)
z(0:28,0)=z1(0:28)
z(0:28,1)=z2(0:28)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
uv_res = True
uv_res@trYMaxF = 1200
uv_res@trYMinF = 0
uv_res@tmYLTickStartF = 0
uv_res@tiYAxisString = "Height(m)"
uv_res@tmYLMode = "Explicit"
uv_res@tmYLLabels = z1
uv_res@tmYLTickEndF = 1200
uv_res@tmYLTickSpacingF = 200
uv_res@trXMaxF = 2
uv_res@trXMinF = -1
uv_res@tmXBMode = "Manual"
uv_res@tmXBTickStartF = -1
uv_res@tmXBTickEndF = 2
uv_res@tmXBTickSpacingF = 1
uv_res@vpWidthF = 0.40 ; width
uv_res@vpHeightF = 0.60 ; height
uv_res@vcRefAnnoOn = False ; turns off the ref vector
uv_res@vcRefLengthF = 0.040 ; set length of ref vector
uv_res@vcGlyphStyle = "WindBarb" ; turn on windbarbs
uv_res@vcMonoWindBarbColor = True ; to color the windbarbs with
windlayer = gsn_vector(wks,u,v,uv_res) ; respect to speed use False
uv_res@vcMapDirection = False |
-
|