- 积分
- 3379
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2012-5-21
- 最后登录
- 1970-1-1
|
NCL
系统平台: |
|
问题截图: |
- |
问题概况: |
res_@vcGlyphStyle选择"CurlyVector"时不出图,选择其他几种类型的矢量都可以出图 |
我看过提问的智慧: |
看过 |
自己思考时长(天): |
1 |
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 两米阳光 于 2014-7-2 10:39 编辑
大家好~向大家请教一个ncl画图的问题:我想画风场等值线填充图,然后再叠加矢量类型为CurlyVector的风矢量。我也看过官网上相关的例子,按照上面的来写的脚本,但是不知道为什么矢量显示不出来,如果把 res_@vcGlyphStyle="CurlyVector"改为 res_@vcGlyphStyle="LineArrow"亦或其他矢量形式,都能出图,不知道为什么下面是我的脚本,恳请大家帮忙看一下,先谢过了
;***********************************************
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
l
begin
f=addfile("wind08945.nc","r")
lat=f->wvc_lat
lon=f->wvc_lon
lat@units="degrees_north"
lon@units="degrees_east"
spd=(f->wind_speed_selection(:,:))*0.01
spd@_FillValue=-1e+20
spd = where(lon.eq.0.and.lat.eq.0, spd@_FillValue, spd)
spd@lon2d=lon
spd@lat2d=lat
spd@units="m/s"
dir=(f->wind_dir_selection(:,:))*0.1
dir@_FillValue=-1e+20
dir=dir+180
dir = where(dir.gt.360, dir-360, dir)
dir = where(lon.eq.0.and.lat.eq.0, dir@_FillValue, dir)
dir@lon2d=lon
dir@lat2d=lat
dir@units="deg"
rad=4.0*atan(1.0)/180
u=-spd*sin(rad*dir)
v=-spd*cos(rad*dir)
u@lat2d=lat
u@lon2d=lon
v@lat2d=lat
v@lon2d=lon
u@units="m/s"
v@units="m/s"
wks=gsn_open_wks("png","wind_arrow")
gsn_define_colormap(wks,"BlAqGrYeOrReVi200")
res_=True
res_@vcRefMagnitudeF=10.0
res_@vcRefLengthF=0.03
res_@vcMinDistanceF=0.019
res_@vcGlyphStyle="CurlyVector"
res_@gsnDraw=False
res_@gsnFrame=False
res_@gsnSpreadColors = True ; use full colormap
res_@lbBoxLinesOn=False
res_@lbLabelBarOn = False
res_@gsnRightString=""
res=True
res@cnFillOn=True
res@cnLinesOn=False
res@cnLineLabelsOn=False
res@cnInfoLabelOn=False
res@gsnDraw=False
res@gsnFrame=False
;res@cnMinLevelValF = 2 ; set min contour level
;res@cnMaxLevelValF = 24 ; set max contour level
res@cnLevelSpacingF = 2 ; set contour spacing
res@lbBoxLinesOn=False
res@mpMinLatF=-20
res@mpMaxLatF=60
res@mpMinLonF=60
res@mpMaxLonF=190
res@mpCenterLonF=130.0
plot=gsn_csm_contour_map(wks,spd(:,:),res)
plot_=gsn_csm_vector(wks,u,v,res_)
overlay(plot,plot_)
draw(plot)
frame(wks)
end
|
|