- 积分
- 1901
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2015-1-6
- 最后登录
- 1970-1-1
|

楼主 |
发表于 2016-4-21 09:30:58
|
显示全部楼层
本帖最后由 xuebiz 于 2016-4-21 09:32 编辑
说多了都是泪啊,读书少。
今天跟overlay好好交流下~~
官网NCL_Tutorial_V1.1第60页也有类似的例子:
--------------------------------------------------------------------
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
begin
f = addfile("$NCL/data/ECHAM5_OM_A1B_2001_0101-1001_2D.nc","r")
u = f->u10(0,:,:) ;-- first time step
v = f->v10(0,:,:) ;-- first time step
t = f->tsurf(0,:,:) ;-- first time step
;-- define the workstation (graphic will be written to a file)
wks = gsn_open_wks("png","vectors_overlay")
;-- set plot resources
cnres = True
cnres@gsnDraw = False ; don't draw
cnres@gsnFrame = False ; don't advance frame
cnres@cnFillOn = True ; turn on color
cnres@cnLinesOn = False ; no contour lines
cnres@mpFillOn = False ; no map fill
cnres@gsnLeftString = "surface temperature" ; change left string
cnres@gsnRightString = t@units ; assign right string
cnres@tiMainString = "DKRZ NCL Workshop: vectors overlay on map"
vcres = True ; vector only resources
vcres@gsnDraw = False ; don't draw
vcres@gsnFrame = False ; don't advance frame
vcres@vcGlyphStyle = "CurlyVector" ; curly vectors
vcres@vcRefMagnitudeF = 20 ; define vector ref mag
vcres@vcRefLengthF = 0.045 ; define length of vec ref
vcres@vcRefAnnoOrthogonalPosF = -.535 ; move ref vector into plot
vcres@gsnRightString = "" ; turn off right string
vcres@gsnLeftString = "" ; turn off left string
vcres@tiXAxisString = "" ; turn off axis label
cplot = gsn_csm_contour_map_ce(wks,t,cnres) ; contours over a map
vplot = gsn_csm_vector(wks,u,v,vcres) ; vectors only
overlay(cplot,vplot)
draw(cplot) ; cplot now contains both itself, and vplot
frame(wks)
end |
|