爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 6773|回复: 0

[作图] 让风矢量随高度分布

[复制链接]
回帖奖励 10 金钱 回复本帖可获得 1 金钱奖励! 每人限 1 次
发表于 2019-4-10 17:19:23 | 显示全部楼层 |阅读模式

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

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

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
uv-vertical.000002.png
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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