- 积分
- 104
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2015-4-16
- 最后登录
- 1970-1-1
|
NCL
系统平台: |
|
问题截图: |
|
问题概况: |
对wrf_map_overlays绘制的填色风场图再采用gsn_add_shapefile_polylines命令叠加市界,生成两张图,市界未叠加在填色图上,查询比对过ncl官网例子,未找到出现此问题的原因。 |
我看过提问的智慧: |
看过 |
自己思考时长(天): |
3 |
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
附画图程序: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/wrf/WRFUserARW.ncl"
begin
f = addfile("./wrfout_d03_2015-05-21_00:00:00","r")
;print(getfilevarnames(f)) ;print(f)
type = "x11"
; type = "pdf"
; type = "ps"
; type = "ncgm"
; type = "png"
wks = gsn_open_wks(type,"O3_mod_all") ; "x11"
gsn_define_colormap(wks,"sunshine_9lev")
;Set some basic resources
res = True
res@gsnMaximize =True
res@gsnDraw = False
res@gsnFrame = False
res@InitTime = False
res@Footer = False
res@tiMainOn = False
;Set for the map
pltres = True
pltres@FramePlot = True
mpres = True
mpres@mpMinLatF = 30.45
mpres@mpMaxLatF = 35.20
mpres@mpMinLonF = 116.18
mpres@mpMaxLonF = 121.57
mpres@mpDataSetName = "/public/home/Mia/NCL-Chinamap-master/database/Earth..4"
mpres@mpDataBaseVersion = "MediumRes"
mpres@mpAreaMaskingOn = True
mpres@mpOutlineSpecifiers = (/"jiangsu"/);
mpres@mpFillAreaSpecifiers = (/"jiangsu"/)
mpres@mpGeophysicalLineThicknessF = 1
mpres@mpOutlineBoundarySets = "NoBoundaries"
mpres@mpNationalLineColor = "black"
mpres@mpProvincialLineColor = "black"
mpres@mpGeophysicalLineColor = "black"
mpres@mpNationalLineThicknessF = 2
mpres@mpProvincialLineThicknessF = 1
mpres@mpGridAndLimbOn = False ; Turn off lat/lon lines
mpres@mpProjection = "LambertConformal" ; choose projection
; mpres@mpLambertParallel1F = 33 ; first parallel
; mpres@mpLambertParallel2F = 45 ; second parallel
; mpres@mpLambertMeridianF = -98 ; meridian
mpres@mpLimitMode = "Corners" ; corner method of zoom
; mpres@mpLeftCornerLatF = 30 ; left corner
; mpres@mpLeftCornerLonF = 118 ; left corner
; mpres@mpRightCornerLatF = 35 ; right corner
; mpres@mpRightCornerLonF = 120 ; right corner
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
times = wrf_user_getvar(f,"times",-1) ;get all times in the file
ntimes = dimsizes(times) ;number of times in the file
;;;;;;;;;;;;;;;;
do it = 30,ntimes-1,24 ;Time Loop
print("working on time: " + times(it))
res@TimeLabel = times(it) ;set Valis time to use on plots
;;;;;;;;;;;;;;;;
;First get the variables we will need
u10 = wrf_user_getvar(f,"U10",it)
u10@units = "m s~S~-1~N~"
v10 = wrf_user_getvar(f,"V10",it)
v10@units = "m s~S~-1~N~"
o3 = f->o3(it,0,:,:)
O3 = o3*1000*48/22.4 ;Turn ppbm to ug/m3
O3@description = "O~B~3~N~ Concentration"
O3@units = "~F33~m~F0~g m~S~-3~N~"
;;;;;;;;;;;;;;;;
;plotting options for O3
opts = res
opts@cnFillOn = True ; Turn on color fill
opts@ContourParameters = (/ 160., 300., 20./)
contour_O3 = wrf_contour(f,wks,O3,opts)
delete(opts)
;plotting options for Wind Vectors
opts = res
opts@vcFillArrowEdgeColor = "black"
opts@vcFillArrowFillColor = "black"
opts@vcMinDistanceF = 0.08
opts@vcMinMagnitudeF = 2
opts@vcGlyphStyle = "FillArrow"
;set FillArrow
opts@vcFillArrowEdgeThicknessF = 0.1
opts@vcFillArrowHeadInteriorXF = 0.25
opts@vcFillArrowHeadXF = 0.6
opts@vcFillArrowHeadYF = 0.2
opts@vcFillArrowWidthF = 0.1
;set Ref
opts@vcRefAnnoOn =True
opts@vcRefAnnoBackgroundColor = "white"
opts@vcRefAnnoFontHeightF = 0.015
opts@vcRefAnnoOrthogonalPosF = -0.12
opts@vcRefAnnoParallelPosF = 0.95
opts@vcRefAnnoPerimOn = True
opts@vcRefAnnoSide = "Right"
opts@vcRefAnnoString1On = False
opts@vcRefAnnoString2On = True
opts@vcRefAnnoString2 = "10m/s"
opts@vcRefMagnitudeF = 10
opts@vcRefLengthF = 0.045
opts@FieldTitle = "Wind" ;overwrite Field Title
opts@NumVectors = 25 ;density of wind barbs
vector = wrf_vector(f,wks,u10,v10,opts)
delete(opts)
;;;;;;;;;;;;;;;;;;Make Plots;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
rawplot = wrf_map_overlays(f,wks,(/contour_O3,vector/),pltres,mpres);
;;;;;;;;;;;;;;;;;;;;;;add polylines;;;;;;;;;;;;;;;;;;;;;;
shpdir = "/public/home/Mia/NCL-Chinamap-master/cnmap/"
plres = True ; resources for polylines
plres@gsEdgesOn = True ; draw border around polygons
plres@gsEdgeColor = "black"
plres@gsLineThicknessF =1.5
; getvalues rawplot
; "mpMinLatF" : plres@minlat
; "mpMaxLatF" : plres@maxlat
; "mpMinLonF" : plres@minlon
; "mpMaxLonF" : plres@minlon
; end getvalues
plotshp = gsn_add_shapefile_polylines(wks,rawplot,shpdir+"jiangsu.shp",plres)
draw(rawplot)
frame(wks)
end do ;End of time loop
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
end
|
评分
-
查看全部评分
|