爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 7879|回复: 5

wrf_vector与gsn_csm_vector

[复制链接]
回帖奖励 10 金钱 回复本帖可获得 2 金钱奖励! 每人限 2 次(中奖概率 50%)
发表于 2014-5-10 19:55:07 | 显示全部楼层 |阅读模式
NCL
系统平台: linux
问题截图: -
问题概况: contour_hgt与vector叠加出图时,图像可以正常显示;
后来想去掉contour_hgt,于是注释掉相关的语句【;contour_hgt = wrf_contour(in,wks,P(0,13,:,:),rest)
;over_id = wrf_map_overlays(in, wks,(/contour_hgt,vector/),True,True)】,保留vector = wrf_vector(in,wks,ua(0,13,:,:),va(0,13,:,:),res);脚本可以正常运行,但输出的ps只有2kb,打开是空白
后来用gsn_csm_vector替代,则可以正常出图
我看过提问的智慧: 看过
自己思考时长(天): 1

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

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

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/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRF_contributed.ncl"

begin

in  = addfile("/home/zssapr/WRF3.5.1/20110710/WRFV3/test/em_real/wrfout_d01_2011-07-05_00:00:00","r")
U =in->U
  ua = wrf_user_unstagger(U,U@stagger)
  V = in->V
  va = wrf_user_unstagger(V,V@stagger)
wks  = gsn_open_wks("ps","500vector")            ; open a workstation
res                 = True
  res@vcRefMagnitudeF = 5.                    ; make vectors larger
  res@vcRefLengthF    = 0.050                 ; reference vector length
  res@vcGlyphStyle    = "CurlyVector"         ; turn on curly vectors
  res@vcMinDistanceF  = 0.012                 ; thin the vectors
  res@gsnLeftString   = "Divergent Wind"
map = wrf_map(wks,in,True)
;vector = wrf_vector(in,wks,ua(0,13,:,:),va(0,13,:,:),res)
plot = gsn_csm_vector(wks,ua(40,13,:,:),va(40,13,:,:),res)
;rest = True
;rest@cnFillOn = False
;contour_hgt = wrf_contour(in,wks,P(0,13,:,:),rest)
;over_id = wrf_map_overlays(in, wks,(/contour_hgt,vector/),True,True)
end

密码修改失败请联系微信:mofangbao
发表于 2014-5-11 10:57:33 | 显示全部楼层
wrf_vector的description部分第一句“This function creates a vector plot (but does not draw it). To draw the plot, see the example below. ”
有些绘图函数调用时自动绘制,有些需要用draw触发,或者声明自动绘制(gsnDraw = True)。一般在decription部分都有说明,lz在不清楚时可以看看。
密码修改失败请联系微信:mofangbao
回复 支持 1 反对 0

使用道具 举报

发表于 2014-5-10 22:08:54 | 显示全部楼层
应该是因为你把over_id = wrf_map_overlays(in, wks,(/contour_hgt,vector/),True,True)注释掉的原因。你试试语句over_id = wrf_map_overlays(in, wks,(/vector/),True,True)
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2014-5-10 23:24:52 | 显示全部楼层
flying鹰 发表于 2014-5-10 22:08
应该是因为你把over_id = wrf_map_overlays(in, wks,(/contour_hgt,vector/),True,True)注释掉的原因。你试 ...

是的,谢谢你,但是官网脚本里vector = wrf_vector(in,wks,ua,va,res);http://www.ncl.ucar.edu/Document ... rw/wrf_vector.shtml,直接就可以显示的啊,我这里为什么不可以呢。。?
密码修改失败请联系微信:mofangbao
发表于 2014-5-11 07:50:29 | 显示全部楼层
原因应该是
res = True
  res@gsnDraw  = True   
  res@gsnFrame = True   
你试试
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2014-5-11 11:56:32 | 显示全部楼层
longlivehj 发表于 2014-5-11 10:57
wrf_vector的description部分第一句“This function creates a vector plot (but does not draw it). To dr ...

谢谢!!
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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