- 积分
- 6650
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2018-4-2
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
如图,地图边框正常显示,但是图变得特别小。
脚本如下:
; -----------------------------------------------------------------------------------
; this file is used to draw the wind field for vertical vorticity and horizontal wind
;------------------------------------------------------------------------------------
begin
f1 = addfile("./wrfout_d05_2016-06-23_07_02_00.nc", "r")
wks = gsn_open_wks("png", "/share/home/mxue/whuang/whuang/yancheng/0702_vor_try")
; So get the XY points of these points
lats = (/ 34.096, 34.113 /)
lons = (/ 118.575, 118.605/)
loc = wrf_user_ll_to_ij(f1, lons, lats, True)
; loc(0,;) is west-east (x) ; loc(1,:) is south-north (y)
; subtract one since we want to use it as an index in NCL
; subtract five since the projection is lambert, we need fiil the domain
x_start = loc(0,0) - 1 - 5
x_end = loc(0,1) - 1 + 5
y_start = loc(1,0) - 1 - 5
y_end = loc(1,1) - 1 + 5
;--------------------------------
;----read the data
;--------------------------------
;--vertical vorticity
lon2d = f1->XLONG(0, y_start:y_end, x_start:x_end)
lat2d = f1->XLAT(0, y_start:y_end, x_start:x_end)
avo = wrf_user_getvar(f1, "avo", 0)
avo_zoom = avo(0, y_start:y_end, x_start:x_end)
delete(avo)
avo_zoom@lat2d = lat2d
avo_zoom@lon2d = lon2d
avo_zoom_expand = avo_zoom*10^(-5)
copy_VarMeta(avo_zoom, avo_zoom_expand)
avo_zoom_expand@units = "s -1"
;--u and v
u = wrf_user_getvar(f1, "ua", 0)
v = wrf_user_getvar(f1, "va", 0)
u_zoom = u(0, y_start:y_end, x_start:x_end)
delete(u)
u_zoom@lat2d = lat2d
u_zoom@lon2d = lon2d
v_zoom = v(0, y_start:y_end, x_start:x_end)
delete(v)
v_zoom@lat2d = lat2d
v_zoom@lon2d = lon2d
;print(any(ismissing(v_zoom)))
;print(any(ismissing(u_zoom)))
;---------------------------------
;-----begin to draw
;---------------------------------
mpres = True
;mpres@mpShapeMode = "FreeAspect"
mpres@gsnFrame = False
mpres@gsnDraw = False
mpres@mpMinLatF = lats(0)
mpres@mpMaxLatF = lats(1)
mpres@mpMinLonF = lons(0)
mpres@mpMaxLonF = lons(1)
mpres@mpFillOn = False
mpres = wrf_map_resources(f1,mpres) ; Set the map resources needed for native projection
mpres@tfDoNDCOverlay = True ; Tell NCL you are doing a native plot
;mpres@gsnMinorLonSpacing = 10
map = gsn_csm_map(wks, mpres)
res = True
;res@vpHeightF = 0.6
;res@vpWidthF = 0.6
res@gsnDraw = False
res@gsnFrame = False
res@cnFillOn = True
res@lbLabelBarOn = True
;res@mpFillDrawOrder = "Predraw"
res@cnFillPalette = "WhiteBlueGreenYellowRed"
;res@pmTickMarkDisplayMode = "Always"
res@cnFillDrawOrder = "PostDraw"
contour = gsn_csm_contour(wks, avo_zoom_expand, res)
overlay(map, contour)
draw(map)
frame(wks)
end
一开始使用的是直接用gsn_csm_contour_map绘制(除此以外都是设置一样的),图形就能正常绘制。
这里展示的是先画地图,再画contour,将两者overlay,就出现上述错误。
之所以要换成这种方式绘图,是因为我想contour和vector(CurlyVector)叠加在一起,使用的是gsn_csm_contour_map+gsn_csm_vector,
但是绘制不出CurlyVector,而FillArrow就能绘制,所以按照官网的例子想要绘制出两者叠加在一起的图,官网使用的就是gsn_csm_map+
gsn_csm_contour+gsn_csm_vector。
我和官网的例子反复对照了也没有发现什么错误,希望有哪位大神能帮忙解决。
|
-
|