爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 29094|回复: 24

NCL画图底图设置

[复制链接]

新浪微博达人勋

发表于 2013-7-8 13:28:33 | 显示全部楼层 |阅读模式

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

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

x
请教下

想用NCL画区域图 30-50N  100-125E的区域的图


用NCL画mdbz的时候设置了绘图区域后
   res@mpMinLatF   = 10
  res@mpMaxLatF   = 30               
   res@mpMinLonF   = 130
;  res@mpMaxLonF   = 150   
图形与经纬度不符了   感觉就地图变量  变量没有变    怎么破啊???

正常应该这样的
file:///E:\Photoshop_CS2_官方简体中文原版\Tencent\QQ\Users\657510711\Image\DES$)D0ER}KCDK7FPAM1_YL.jpg file:///E:\Photoshop_CS2_官方简体中文原版\Tencent\QQ\Users\657510711\Image\DES$)D0ER}KCDK7FPAM1_YL.jpg QQ截图20130708132355.png
结果设置了绘图区域后变这样了[img]file:///E:\Photoshop_CS2_官方简体中文原版\Tencent\QQ\Users\657510711\Image\8ES7B3O[$MM$WI4QG{HKYYK.jpg[/img]

QQ截图20130708132337.png


付脚本如下:

;   Example script to produce dbz plots for a WRF real-data run,
;   with the ARW coordinate dynamics option.
;   November 2008

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"

begin
;
; The WRF ARW input file.  
; This needs to have a ".nc" appended, so just do it.

  a = addfile("./wrfout_d01_2012-07-20_12:00:00.ctl.nc","r")
; We generate plots, but what kind do we prefer?
; type = "x11"
type = "pdf"
; type = "ps"
; type = "ncgm"
  wks = gsn_open_wks(type,"mdbz")
  gsn_define_colormap(wks,"WhViBlGrYeOrReWh")
;  gsn_define_colormap(wks,"Rainbow")
; Set some basic resources
  res = True
  res@MainTitle                   = "REAL-TIME WRF"
  res@mpDataBaseVersion="MediumRes"
  res@mpDataSetName="Earth..4"
  res@mpOutlineSpecifiers=(/"China","Fujian","Guandong","Jiangxi","Zhejiang"/)
  res@mpUSStateLineThicknessF     = 2
  res@mpUSStateLineColor="Black"
  res@mpOceanFillColor       = 1            ; array index in color map
  res@mpLandFillColor        = 17          ; for land, ocean, and inland h20
  res@mpInlandWaterFillColor = 9
  res@mpOutlineOn            = True        ; turn on map outlines
; res@mpGeophysicalLineColor = "Gray21"    ; map outline color
  res@mpLimitMode = "LatLon"        ; select subregion
   res@mpMinLatF   = 30
  res@mpMaxLatF   = 50               
   res@mpMinLonF   = 100
   res@mpMaxLonF   = 125
  pltres = res
  mpres = res

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; Which times and how many time steps are in the data set?
  times  = wrf_user_list_times(a)  ; get times in the file
  ntimes = dimsizes(times)         ; number of times in the file

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

  do it = 47,ntimes-1               ; TIME LOOP

     print("Working on time: " + times(it) )
     res@TimeLabel = times(it)   ; Set Valid time to use on plots

; First get the variables we will need        
; Both dbz and mdbz will be calculated using intercept parameters
; for rain, snow, and graupel, which are consistent with
; Thompson, Rasmussen, and Manning (2004, Monthly Weather Review,
; Vol. 132, No. 2, pp. 519-542.)
;        First "1" in wrf_user_getvar
; Frozen particles that are at a temperature above freezing will be
; assumed to scatter as a liquid particle.
;        Second "1" in wrf_user_getvar

     mdbz = wrf_user_getvar(a,(/"mdbz","1","1"/),it)
     dbz = wrf_user_getvar(a,(/"dbz","1","1"/),it)

     opts = res                        
     opts@cnFillOn = True  
     opts@ContourParameters = (/ 5., 75., 5./)
;  contour = wrf_contour(a,wks,dbz(15,:,:),opts)    ; plot only lowest level
;    plot = wrf_map_overlays(a,wks,(/contour/),pltres,mpres)

    contour = wrf_contour(a,wks,mdbz,opts)
     plot = wrf_map_overlays(a,wks,(/contour/),pltres,mpres)


   end do        ; END OF TIME LOOP

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
end





mdbz.ncl

3.02 KB, 下载次数: 18, 下载积分: 金钱 -5

密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2013-7-8 14:04:05 | 显示全部楼层
你画图属性弄错了吧?  plot = wrf_map_overlays(a,wks,(/contour/),pltres,mpres),里面的mpres没有给地图属性,你之前定义的是res,我觉得应该改为plot = wrf_map_overlays(a,wks,(/contour/),opts,res),
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2013-7-8 14:25:57 | 显示全部楼层

pltres = res
mpres = res

先前已经给定义了
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2013-7-8 15:58:11 | 显示全部楼层
先吧这几行注释掉
res@mpMinLatF   = 10
  res@mpMaxLatF   = 30               
   res@mpMinLonF   = 130
;  res@mpMaxLonF   = 150   
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2013-7-8 16:40:59 | 显示全部楼层
freekiller 发表于 2013-7-8 15:58
先吧这几行注释掉
res@mpMinLatF   = 10
  res@mpMaxLatF   = 30               

然后画出来的就是默认的模拟区预 就是正常的那个图  
想画其中一部分 如 30-50N 105-125E区域
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2013-7-8 18:58:18 | 显示全部楼层
你的两张图没有显示。
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2013-7-8 21:13:42 | 显示全部楼层
参见:http://www.mmm.ucar.edu/wrf/OnLi ... les/SPECIAL/olr.htm  
折腾了一天,终于。。。。
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2013-7-13 21:39:23 | 显示全部楼层
hhhhhhhhhhhhhh
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2013-7-14 21:57:17 | 显示全部楼层
直接在官网里面查找呀?你的投影不太对,官网上资源很有帮助的。
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2014-4-7 16:04:25 | 显示全部楼层
了了了云 发表于 2013-7-8 21:13
参见:http://www.mmm.ucar.edu/wrf/OnLineTutorial/Graphics/NCL/Examples/SPECIAL/olr.htm  
折腾了一天 ...

我想画指定的区域,怎么设置后还是显示默认的模拟区域啊
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

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

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

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