爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 3773|回复: 0

ncl在数据上叠加地形文件问题

[复制链接]
发表于 2015-5-3 17:44:13 | 显示全部楼层 |阅读模式
GrADS
系统平台:
问题截图:
问题概况: ncl学习还是不够系统,有些问题不知如何解决!想画这样的效果,但是海岸线会画两次!并且会出两张图
我看过提问的智慧: 看过
自己思考时长(天): 2

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

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

x
具体的脚本
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"

begin
  filename = "2001-2010.nc"
  a        = addfile(filename,"r")
mbl  = a->MBL(0,:,:)   ; read in example data [2D only here]
  copy_VarCoords(dstsfmbl,mbl)
  type = "ps"    ;  "pdf" , "ncgm"
  wks = gsn_open_wks(type, "china")               ; open a  file
  gsn_define_colormap(wks,"MPL_YlOrBr")  ; choose colormap
; Set some basic resources
  res = True
  res@cnFillOn             = True                  ; turn on color fill
  res@mpLandFillColor        = "white"
  res@gsnSpreadColors      = True                  ; use full range of colors
  res@gsnRightString        = "t/km~S~2~N~";
  res@gsnLeftString        ="mbl"
; =================================================;
  res@mpMinLatF              =  17
  res@mpMaxLatF              =  55
  res@mpMinLonF              =  72
  res@mpMaxLonF              =  136
; =================================================;
  res@pmTickMarkDisplayMode = "Always"              ;
res@cnLevelSelectionMode = "ExplicitLevels"   ; set explicit contour levels
res@cnLevels            = (/10,20,50,100,200,500,1000/)
plot = gsn_csm_contour_map_ce(wks,mbl,res)   ; Create contour plot

;>============================================================<
;                      add China map
;>------------------------------------------------------------<
;---Attach the shapefile polylines using files read off gadm.org/country.
  china_shp_name=/data/map/bou1_4l.shp"
  province_shp_name=/data/map/bou2_4p.shp"
  river1_shp_name="/data/map/hyd1_4l.shp"

  lnres                  = True
  lnres@gsLineColor      = "gray25"
  lnres@gsLineThicknessF = 0.5   

  chi_id = gsn_add_shapefile_polylines(wks,plot,china_shp_name,lnres)
  pro_id = gsn_add_shapefile_polylines(wks,plot,province_shp_name,lnres)
  ri1_id = gsn_add_shapefile_polylines(wks,plot,river1_shp_name,lnres)

  draw(plot)       ; This will draw the map and the shapefile outlines.
  frame(wks)       ; Advance the frame

end
先画了一张没有地形文件的图
a.png


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

本版积分规则

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

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

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