爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 6498|回复: 5

[作图] 风场图 箭头很奇怪

[复制链接]
发表于 2017-9-13 10:47:48 | 显示全部楼层 |阅读模式

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

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

x
本帖最后由 xiaogao 于 2017-9-13 11:03 编辑

这是我的脚本,提取wrfout10米U、V风速,插值到离散点,最后画图。但是图上的线条和箭头都很奇怪,不知道哪里有问题,求各位大神解答。



;---Open WRF output file
  files =  systemfunc ("ls ../D1/wrfout_d01*")
    a   = addfile(files+".nc","r")
;---Find the total number of time
  number = dimsizes(a->XLAT(:,0,0))
;---convet UTC time to BJ time
  Times = wrf_user_getvar(a,"Times",-1)  ; get all times in the file
  TimeUTC = wrf_times_c(Times,1)
  TimeBJT = TimeUTC + 8
  copy_VarAtts(TimeUTC, TimeBJT)
  times = cd_calendar(TimeBJT,-3)
;---Read several WRF variables
  nl = 1
  do ii = 6, number-1,nl
  it  = ii
  u10 = a->U10(it,:,:)      
  v10 = a->V10(it,:,:)
  u10@units       = ""
  v10@units       = ""
  v10@description =""
u10@description =""
lat2d = a->XLAT(0,:,:)
lon2d = a->XLONG(0,:,:)
lon2d@description = ""
lat2d@description = ""
  lat1d = lat2d(:,122)
  lon1d = lon2d(197,:)
  u10@lat2d = lat2d
  u10@lon2d = lon2d
  u10= rcm2rgrid_Wrap(lat2d,lon2d,u10,lat1d,lon1d,0);插值到点
  v10@lat2d = lat2d
  v10@lon2d = lon2d
  v10= rcm2rgrid_Wrap(lat2d,lon2d,v10,lat1d,lon1d,0);插值到点
;---name the result
  name2 = times(it)
  outname = "GFS"+name2
  outname1 = outname
  wks_type = "png"
  wks_type@wkBackgroundOpacityF = 0.0
  wks_type@wkWidth  = 5000
  wks_type@wkHeight = 5000
  filename = times(0)
  outputPath="./WindMap/GFS_D1"
  wks = gsn_open_wks(wks_type,outputPath+"/"+outname1)
;---Set common resources for all plots
  res                = True
  res@gsnFrame       = False
  res@gsnDraw        = False
  res@gsnLeftString  = ""
  res@gsnRightString = ""
;---Necessary for contours to be overlaid correctly on WRF projection
  res@tfDoNDCOverlay = True
;---Wind vector plot
  vec_res                       = res
  vec_res@vcGlyphStyle          = "CurlyVector"
  vec_res@vcMinDistanceF        = 0.025
  vec_res@vcRefLengthF          = 0.04
  vec_res@vcLineArrowThicknessF = 3.0
  vec_res@vcRefMagnitudeF       = 5.0
   vec_res@vcRefAnnoOn           = False
  vec_res@vcVectorDrawOrder     = "PreDraw"
  vec_res@NoHeaderFooter = True
  vector = wrf_vector(a,wks,u10,v10,vec_res);风场作图
;---Map plot
  map_res                      = res
  map_res@gsnMaximize          = True
  map_res@gsnBoxMargin         = 0.0
  map_res@mpFillOn                    = False
  map_res@mpOutlineOn                 = False
  map_res@PerimOn                      =False
  map_res@tmXBOn             = False
  map_res@tmYLOn             = False
  map_res@tmXTOn             = False
  map_res@tmYROn             = False
  map_res@tmXBBorderOn       = False
  map_res@tmXTBorderOn       = False;
  map_res@tmYLBorderOn       = False
  map_res@tmYRBorderOn       = False
  map_res@mpLimitMode = "LatLon"
  map_res@mpMinLatF = min(lat1d)
  map_res@mpMaxLatF = max(lat1d)
  map_res@mpMinLonF = min(lon1d)
  map_res@mpMaxLonF = max(lon1d)
    map = gsn_csm_map(wks,map_res)
;---Overlay plots on map and draw.
  overlay(map,vector)
  draw(map)
frame(wks)
end do
end

1505271224(1).png
密码修改失败请联系微信:mofangbao
发表于 2017-9-13 15:33:25 | 显示全部楼层

回帖奖励 +8 金钱

不太懂哦
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

发表于 2017-9-13 17:48:15 | 显示全部楼层
你画的流线图啊,没问题啊,难道你不要这种。
密码修改失败请联系微信:mofangbao
发表于 2017-9-14 10:11:39 | 显示全部楼层
流场,没问题吧
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2017-9-15 09:10:11 | 显示全部楼层
andrewsoong 发表于 2017-9-13 17:48
你画的流线图啊,没问题啊,难道你不要这种。

C:\Users\Administrator\Desktop\1505438387(1).png谢谢版主回复,就是线条像小蝌蚪,我看官网的图没像我这样的,像这个就比较奇怪。
密码修改失败请联系微信:mofangbao
发表于 2017-9-15 18:38:01 | 显示全部楼层
vec_res@vcGlyphStyle          = "CurlyVector"换成 vec_res@vcGlyphStyle          = "WindBarb"
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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