- 积分
- 1742
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2013-6-26
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2014-12-14 15:17:34
|
显示全部楼层
这是我的脚本,为什么我用颜色画图就能控制在范围里面,如果用等值线的话就会跑到外面去?看了MASK,还是毫无头绪啊,@longlivehj
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/csm/shea_util.ncl"
begin
fname = "13070308.000"
a = asciiread("/cygdrive/J/Data/rainfall/rainfall/08/"+fname,-1,"string")
b = a(11::)
delim = " "
zlon = stringtofloat(str_get_field(b,2,delim))
zlat = stringtofloat(str_get_field(b,3,delim))
zpre = stringtofloat(str_get_field(b,5,delim))
zsta = stringtofloat(str_get_field(b,1,delim))
olon = ispan(119,135,1) ;olon = ispan(90,126,1)
olat = ispan(38,54,1) ;olat = ispan(22,34,1)
olon!0 = "lon"
olon@long_name = "lon"
olon@units = "degree_east"
olon&lon = olon
olat!0 = "lat"
olat@long_name = "lat"
olat@units = "degree_north"
olat&lat = olat
zpre@_FillValue = 999999.000000
rscan = (/5,3,1,0.5/)
data1 = obj_anal_ic_Wrap(zlon,zlat,zpre,olon,olat,rscan,False)
wks = gsn_open_wks("pdf","2013070200_preciption")
gsn_define_colormap(wks,"MPL_gist_yarg")
res = True
res@gsnDraw = False ; don't draw
res@gsnFrame = False
res@gsnAddCyclic = False
res@mpDataSetName = "Earth..4" res@mpDataBaseVersion = "MediumRes" res@mpOutlineOn = True res@mpFillAreaSpecifiers = (/"Land", "China","Taiwan","Water","Island"/)
res@mpSpecifiedFillColors =(/"white","transparent","transparent","white","transparent"/)
res@mpInlandWaterFillColor = 0
res@mpLandFillColor = -1
res@mpOutlineBoundarySets = "Geophysical"
res@mpOutlineSpecifiers = (/"Land","China","Taiwan","Water","island"/)
; res@mpMaskOutlineSpecifiers = (/"water"/)
res@mpGeophysicalLineThicknessF= 1. ; double the thickness of geophysical boundaries
res@mpNationalLineThicknessF= 2.
res@mpLimitMode="LatLon"
res@mpMinLatF=38 ;17 38
res@mpMaxLatF=54 ;55 54
res@mpMinLonF=119 ;72 115
res@mpMaxLonF=135 ;136 136
res@mpLimbLineColor = "Black"
res@mpPerimLineColor = "Black"
res@cnFillOn = True
res@cnLinesOn = True ;等值线不显示
res@cnLineLabelsOn = True
res@cnFillDrawOrder = "PreDraw" ; draw contours first
res@cnLineLabelPlacementMode = "constant"
res@cnLineDashSegLenF = 0.18
res@cnLineLabelPerimSpaceF =0.1
res@cnLineLabelFontAspectF =1.3
res@cnLevelSelectionMode = "ExplicitLevels" ; set explicit contour levels
res@cnLevels = (/1,5,10,15,20,30,40,50/)
res@cnFillColors =(/0,0,0,0,0,0,0,0,105/)
res@cnSmoothingTensionF = -0.015 res@cnSmoothingDistanceF = 0.015 res@cnSmoothingOn = True res@lbLabelBarOn = False
data1 = smth9(data1,0.5,-0.25,False)
map = gsn_csm_contour_map(wks,data1,res)
draw(map)
frame(wks)
end |
|