爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 6028|回复: 2

ncl画wrf结果叠加站点图

[复制链接]
发表于 2018-5-2 15:14:40 | 显示全部楼层 |阅读模式

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

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

x
每次都画成两幅图,后来看了气象家园的帖子,好多人说加gsnDraw,还有PreDraw,PostDraw巴拉巴拉的都不管用,后来还是在官网上找到了解决方法,利用一个
pltres@PanelPlot              = True 就可以解决了的。基本上就是ncl的一个例子改的,我也不想赚金币,有类似问题的同学照猫画虎就行了。

begin
  a = addfile("wrfout.nc","r")
  HGT  = wrf_user_getvar(a,"HGT",0)   

  HGT@description = "Terrain height"
  HGT@units       = "m"

wks = gsn_open_wks("png","wrfplot")

  res                   = True
  res@Footer = False  ;去掉wrfout啰哩八嗦的脚标
  res@InitTime = False
  res@cnFillOn          = True
  gsn_define_colormap(wks,"precip3_16lev")
  res@cnLabelBarEndStyle = "IncludeMinMaxLabels"  ;标出最大值
  res@ContourParameters = (/ 0.,2000., 250./)

  contour = wrf_contour(a,wks,HGT,res)

  mapres = True
  pltres = True
  pltres@PanelPlot              = True     ; 现在不画,一会儿再画
   mapres@mpDataBaseVersion="MediumRes"
     mapres@mpDataSetName="Earth..4"
     mapres@mpGeophysicalLineColor = "Black"
     mapres@mpNationalLineColor    = "Black"
     mapres@mpGridLineColor        = "Black"
     mapres@mpLimbLineColor        = "Black"
     mapres@mpPerimLineColor       = "Black"
     mapres@mpUSStateLineThicknessF     = 2
     mapres@mpNationalLineThicknessF    = 2
     mapres@mpUSStateLineColor="Black"
     mapres@mpOutlineSpecifiers="China:states"
  plot = wrf_map_overlays(a,wks,contour,pltres,mapres)

;---加站点
  lats  = (/   48.51,       58.27,      39.43/)
  lons  = (/  128.33,      100.25,     122.90/)
  tstrs = (/"A","B", "C"/)               ;站点名
  mkres = True
txres = True
  mkres@gsMarkerIndex = 16 ; 画点
  txres@txFontHeightF = 0.015
  txres@txJust        = "CenterLeft"

  mkid = gsn_add_polymarker(wks,plot,lons,lats,mkres)
  txid = gsn_add_text(wks,plot,"   " + tstrs,lons,lats,txres)

  draw(plot)
  frame(wks)

end
密码修改失败请联系微信:mofangbao
发表于 2018-5-2 16:54:26 | 显示全部楼层
非常赞,顶一个
密码修改失败请联系微信:mofangbao
发表于 2019-5-15 17:59:05 | 显示全部楼层
救救孩子吧  啥都不会
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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