爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 8209|回复: 8

[作图] ncl 处理wrf数据白色网格线怎么取消

[复制链接]
发表于 2015-10-22 22:53:55 | 显示全部楼层 |阅读模式

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

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

x
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
begin
; Make a list of all files we are interested in
  DATADir = "/home/student/haokun/ncl/data/wrf2002/"
  FILES = systemfunc (" ls -1 " + DATADir + "wrfout* ")
  numFILES = dimsizes(FILES)
  print("numFILES = " + numFILES)
  print(FILES)
  print (" ")
  type = "pdf"
  wks = gsn_open_wks(type,"plt_Surface_multi_files")
; Set some basic resources
  res = True
  res@MainTitle                   = "REAL-TIME WRF"
  res@Footer = False
  pltres = True
  mpres = True

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  a = addfiles(FILES+".nc","r")
  times = wrf_user_getvar(a,"times",-1)  ; get all times in the file
  ntimes = dimsizes(times)         ; number of times in the file
  slp = wrf_user_getvar(a,"slp",-1)    ; slp
    wrf_smooth_2d( slp, 3 )            ; smooth slp
  slpAvg=dim_avg_n(slp,0)
  tc = wrf_user_getvar(a,"tc",-1)      ; 3D tc
  u  = wrf_user_getvar(a,"ua",-1)      ; 3D U at mass points
  v  = wrf_user_getvar(a,"va",-1)      ; 3D V at mass points
  td2 =  wrf_user_getvar(a,"td2",-1)   ; Td2 in C
  tc2 = wrf_user_getvar(a,"T2",-1)     ; T2 in Kelvin
     tf2 = tc2-273.16                  ; T2 in C
  u10 = wrf_user_getvar(a,"U10",-1)    ; u at 10 m, mass point
  v10 = wrf_user_getvar(a,"V10",-1)    ; v at 10 m, mass point
  u10Avg=dim_avg_n(u10,0)
  v10Avg=dim_avg_n(v10,0)
; tf2 = 1.8*tc2+32.                    ; Turn temperature into Fahrenheit
  tf2Avg=dim_avg_n(tf2,0)
    tf2@description = "Surface Temperature"
    tf2@units = "F"
  u10 = u10*1.94386                    ; Turn wind into knots
  v10 = v10*1.94386
    u10@units = "kts"
    v10@units = "kts"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;  
    ; Plotting options for T
      opts = res
      opts@FieldTitle = "T"       ; overwrite Field Title
      opts@cnFillOn = True
      opts@ContourParameters = (/ -20., 30., 2./)
      opts@gsnSpreadColorEnd = -3  ; End third from the last color in color map
      contour_tc = wrf_contour(a[:],wks,tf2Avg,opts)
      delete(opts)

    ; Plotting options for SLP
      opts = res
     opts@FieldTitle = "Slp"       ; overwrite Field Title
      opts@cnLineColor = "Blue"
      opts@cnHighLabelsOn = True
      opts@cnLowLabelsOn = True
      opts@ContourParameters = (/ 900., 1100., 4. /)
      opts@cnLineLabelBackgroundColor = -1
      opts@gsnContourLineThicknessesScale = 2.0
      contour_psl = wrf_contour(a[:],wks,slpAvg,opts)
      delete(opts)
    ; Plotting options for Wind Vectors
      opts = res
      opts@FieldTitle = "Wind"       ; overwrite Field Title
      opts@NumVectors = 47           ; density of wind barbs
      vector = wrf_vector(a[:],wks,u10Avg,v10Avg,opts)
      delete(opts)

    ; MAKE PLOTS
      plot = wrf_map_overlays(a[:],wks,(/contour_tc,contour_psl,vector/),pltres,mpres)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
end
刚开始学习ncl画图,仿照官网的例子画了一个图,但是画出的图有白色的网格线,看起来很不舒服,亲吻该怎么取消掉?
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2015-10-22 22:56:05 | 显示全部楼层
这是图片,第一次发帖求助,不知道怎么直接插图片。。。

plt_Surface_multi_files.pdf

279.41 KB, 下载次数: 26, 下载积分: 金钱 -5

密码修改失败请联系微信:mofangbao
发表于 2015-10-23 10:33:18 | 显示全部楼层
辛苦楼主了,谢谢楼主了
密码修改失败请联系微信:mofangbao
发表于 2015-10-23 10:46:27 | 显示全部楼层
还要花金币下载图,天。还是尝试插图吧
密码修改失败请联系微信:mofangbao
发表于 2016-8-21 10:02:54 | 显示全部楼层
请问LZ,这个问题您解决没?求方法
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2016-8-28 11:02:04 | 显示全部楼层
Eudora99 发表于 2016-8-21 10:02
请问LZ,这个问题您解决没?求方法

解决了,这样设置就好了,res@mpGridAndLimbOn                = False
密码修改失败请联系微信:mofangbao
发表于 2016-8-28 12:18:12 | 显示全部楼层
天王狼 发表于 2016-8-28 11:02
解决了,这样设置就好了,res@mpGridAndLimbOn                = False

谢谢
密码修改失败请联系微信:mofangbao
发表于 2018-2-2 13:04:39 | 显示全部楼层
这个应该很容易的!
密码修改失败请联系微信:mofangbao
发表于 2018-2-24 09:03:26 | 显示全部楼层
感谢你的分享,对我有很大帮助
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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