- 积分
- 1965
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2014-4-13
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
最近总有人问我站点图怎么画,问多了有点烦。
正好借此机会我把我用的.ncl共享出来。
当然,这个就只当做是大家学习交流使用的啦~
- 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/cnmap/cnmap.ncl"
- begin
- wks = gsn_open_wks("eps","Station")
- gsn_define_colormap( wks ,"gui_default")
- ;=================Set Map=================;
- res = True
- res@tiMainString ="Stations Map"
- res@gsnMaximize = True
- res@gsnDraw = False
- res@gsnFrame = False
- res@mpMinLatF = 0.
- res@mpMaxLatF = 70.
- res@mpMinLonF = 70.
- res@mpMaxLonF = 140.
- res@mpFillOn = True
- res@mpOutlineOn = False ; Use outlines from shapefile
- res@mpDataBaseVersion = "MediumRes"
- res@mpDataSetName = "Earth..4"
- res@mpAreaMaskingOn = True
- res@mpMaskAreaSpecifiers = (/"China"/)
- res@mpLandFillColor = "white"
- res@mpInlandWaterFillColor = "white"
- res@mpOceanFillColor = "white"
- res@mpOutlineBoundarySets = "NoBoundaries"
- map = gsn_csm_map(wks,res)
- ;=================Draw Map=================;
- cnres = True
- cnres@china = True ; draw china map or not
- cnres@river = True ; draw changjiang&huanghe or not
- cnres@province = True ; draw province boundary or not
- cnres@nanhai = False ; draw nanhai or not
- cnres@diqu = True ; draw diqujie or not
- chinamap = add_china_map(wks,map,cnres)
- ;=================Draw Station=================;
- nn = 109
- lon = new((/nn/), double)
- lat = new((/nn/), double)
- lon = asciiread("lon.txt", (/nn/), "double")
- lat = asciiread("lat.txt", (/nn/), "double")
- mkres = True
- mkres@gsMarkerIndex = 1
- mkres@gsMarkerSizeF = 0.05
- mkres@gsMarkerColor = 230
- stnmap = gsn_add_polymarker(wks, map, lon, lat, mkres)
- draw(map)
- frame(wks)
- end
复制代码 其中需要修改的地方有:经纬度范围(res@mpMinLatF、res@mpMaxLatF、res@mpMinLonF、res@mpMaxLonF),地图(res@mpMaskAreaSpecifiers)、站数(nn)、站点经纬度数据文件(lon = asciiread("lon.txt", (/nn/), "double")、lat = asciiread("lat.txt", (/nn/), "double"))、标注的图形大小及颜色(mkres@gsMarkerIndex、mkres@gsMarkerSizeF、mkres@gsMarkerColor)。
而对于cnmap的文件,我用的是在本站里面提供的那个~你的NCL没有的话就去搜一下然后根据他的安装说明弄就好了。
另外,GrADS里面标注站点的方式可以参考课本(《GrADS软件基础教程》气象出版社)里标注台风(大约P88左右)的那个例子。
|
-
-
Stn.ncl
1.85 KB, 下载次数: 30, 下载积分: 金钱 -5
其实就是上面的那个贴出来的程序,不想复制粘贴的话可以直接点击这里下载。
|