- 积分
- 2268
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2014-7-27
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2015-5-13 15:17:43
|
显示全部楼层
- 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
- ;diri = "/home/shenyanling/program/ncl/14062608"
- ;fils = systemfunc ("ls "+ diri + "140*.000")
- ;f = addfiles("14062608.asc","r")
- ; data = asciiread("fils",(/488,20/),"float")
- c := asciiread("/home/shenyanling/program/ncl/14062608.000",-1,"string")
- delim =" "
- lon = stringtofloat(str_get_field(c(1:),2,delim))
- lat = stringtofloat(str_get_field(c(1:),3,delim))
- rain = stringtofloat(str_get_field(c(1:),5,delim))
- olon=new(66,"float");
- olat=new(66,"float");
- data1=new((/66,66/),"float");
- do i=0,65
- olon(i)=72+i
- end do
- do j=0,65
- olat(j)=17+j
- end do
-
- ;;;;;设置属性,符合netcdf规定的数据格式;;;;;;;;
- olon!0 ="lon"
- olon@long_name="lon"
- olon@units ="degrees-east"
- olon&lon =olon
- olat!0 ="lat"
- olat@long_name="lat"
- olat@units ="degrees-north"
- olat&lat =olat
-
- rain@_FillValue = 999999.000000
- rscan = (/10,5,3/) ;连续的有效半径大小,最大为10,依次递减
- data1 = obj_anal_ic_deprecated(lon,lat,rain,olon,olat,rscan, False) ;Creanm插值
- ;data1=linint2_points(lon,lat,pre10,True,olon,olat,0)
- printVarSummary(data1)
- ;exit
- wks = gsn_open_wks("ps","station")
- gsn_define_colormap(wks, "BlRe")
- res=True
- ;res@gsnSpreadColors = True ; spread out color table
- res@cnFillOn = True ; turn on color
- res@cnLinesOn = False
- res@lbLabelBarOn = False
- res@cnInfoLabelOn = False
- res@cnLineLabelsOn = False
- res@mpPerimOn = True
- res@gsnMaximize=True
- res@pmTickMarkDisplayMode = "Always"
- res@gsnDraw = False ; don't draw yet
- res@gsnFrame = False
- res@mpGeophysicalLineColor = "black"
- res@mpNationalLineColor = "black"
- res@mpDataSetName = "Earth..4"
- res@mpDataBaseVersion = "MediumRes"
- res@mpOutlineSpecifiers = ("China:states")
- res@mpNationalLineThicknessF= 0.1
- res@mpOutlineDrawOrder = "PostDraw"
- res@mpLimitMode = "LatLon" ; Limit the map view.
- res@gsnAddCyclic = False
- ;res@mpMinLonF = min(lon2)
- ;res@mpMaxLonF = max(lon2)
- ;res@mpMinLatF = min(lat2)
- ;res@mpMaxLatF = max(lat2)
- ;>============================================================<
- ; add China 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 = True ;draw nanhai or not
- ;cnres@diqu = False draw diqujie or not
- plot=gsn_csm_contour_map(wks,data1,res)
- end
复制代码 |
|