- 积分
- 957
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2012-10-23
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
最近气象统计实习课要画站点图,我就想用ncl耍耍,但插值后总是缺测值,我看了好几个网站都没查出我错在哪
http://blog.sina.com.cn/s/blog_5d7295010101jm0g.html
http://bbs.06climate.com/forum.php?mod=viewthread&tid=11417&extra=&page=1
http://blog.sina.com.cn/s/blog_44f7c0840100on44.html
http://bbs.06climate.com/forum.php?mod=viewthread&tid=26775
脚本如下(比较累赘,懒得删-_-||):
;*****************************;
;NCL Graphics;
;*****************************;
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"
;*****************************;
begin
filepath = "160zhan-rainfall-summer.txt" ;
argu = asciiread(filepath,-1,"double") ;
n=160;
;print(argu);
year=argu(1:25);
data=new((/28,n/),double)
do i=0,n-1
data(:,i)=argu(26+i*28:26+27+i*28);
end do
x=data(3:27,:);
b=new((/n/),double);
do i=0,n-1
b(i)=((sum(data(3:27,i)*year)-n*dim_avg(data(3:27,i))*dim_avg(year))/(sum(data(3:27,i)^2)-n*dim_avg(data(3:27,i)^2)));
end do
lon1=data(1,:);
lat1=data(2,:);
lon1!0 = "lon"
lon1@long_name = "lon"
lon1@units = "degrees-east"
lon1&lon = lon1
lat1!0 = "lat"
lat1@long_name = "lat"
lat1@units = "degrees_north"
lat1&lat = lat1
lon=todouble(fspan(60,150,37));
lat=todouble(fspan(0,60,25));
lon!0 = "lon"
lon@long_name = "lon"
lon@units = "degrees-east"
lon&lon = lon
lat!0 = "lat"
lat@long_name = "lat"
lat@units = "degrees_north"
lat&lat = lat
b@_FillValue = 9e+36;
rscan = (/10,5,3/)
;R = cssgrid(lat1,lon1,b,lat,lon) ;
opt = True
opt@blend_wgt = (/1.0, 0.5, 0.25/)
R=obj_anal_ic(lon1,lat1,b,lon,lat,rscan,opt);
printVarSummary(lon1)
;print(lat1)
;print(b)
;print(data)
print(R)
replace_ieeenan(R,9e+36,0) ;change the fillvalue
R@_FillValue = 9e+36
R!1="lon"
R!0="lat"
R&lat = lat
R&lon = lon
R&lat@units = "degrees_north"
R&lon@units = "degrees_east"
;print(b)
;print(R)
printVarSummary(R)
wks = gsn_open_wks("pdf","ex6") ; Open a workstation
gsn_define_colormap(wks,"matlab_jet") ; define a different colormap.
res = True
res@gsnAddCyclic = False
; res@mpDataSetName = "Earth..4" ; This new database contains
; divisions for other countries.
; res@mpDataBaseVersion = "HighRes" ; High resolution database
; res@mpOutlineOn = True ; Turn on map outlines
; res@mpOutlineSpecifiers = (/"China:states","Taiwan"/) ;China:states
res@mpMinLatF = 17 ; Asia limits
res@mpMaxLatF = 55
res@mpMinLonF = 72
res@mpMaxLonF = 136
; res@mpGeophysicalLineThicknessF= 2. ; double the thickness of geophysical boundaries
; res@mpNationalLineThicknessF= 2. ; double the thickness of national boundaries
; res@mpProjection = "LambertConformal"
; res@mpLambertMeridianF = 110.0
; res@mpLimitMode = "LatLon"
; res@mpLambertParallel1F = .001 ;Default: .001 ;
; res@mpLambertParallel2F = 89.999 ;Default: 89.999
; res@mpAreaMaskingOn = True
; res@mpMaskAreaSpecifiers = (/"China:states","Taiwan"/) ;China:states
res@mpOceanFillColor = 0
res@mpInlandWaterFillColor = 0
res@cnFillOn = True
res@cnLinesOn = False
; res@cnLineLabelsOn = False
; res@cnFillDrawOrder = "PreDraw" ; draw contours first
; res@cnLevelSelectionMode = "ExplicitLevels" ; set explicit contour levels
; res@lbLabelBarOn = True ;
; res@lbLabelStrings = (/"-30:S:o:N","-20:S:o:N","-10:S:o:N","0:S:o:N","10:S:o:N","20:S:o:N"/)
; res@lbOrientation = "vertical" ; vertical label bar
; res@vpWidthF = 1.0 ; height and width of plot
; res@vpHeightF = 0.8
; res@tiMainFont = "helvetica"
; res@tiMainOffsetYF = 0.02 ;set place for main title along Y,offset
; res@tiMainFontHeightF = 0.02 ;set main title font size
; res@tiMainString = "argu"
map = gsn_csm_contour_map(wks,R,res)
end
|
-
-
ncl.rar
9.8 KB, 下载次数: 26, 下载积分: 金钱 -5
|