爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 8173|回复: 5

站点画图出错

[复制链接]
发表于 2015-1-10 19:45:37 | 显示全部楼层 |阅读模式

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

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

x
;;;;;;;;;;read data;;;;;;;;;;;;;;;;;
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   
   a = asciiread ("china.txt",(/2340,4/), "float")                                                                                                                          
   lat = a(:,0)                                                                                                                                                            
   lon = a(:,1)                                                                                                                                                            
   pre10 = a(:,2)
   pre5 = a(:,3)
   
;;;cressman;;;;;;;;
  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
  
; R@_FillValue=-9999
rscan=(/10,5,3/)
data1=obj_anal_ic_Wrap(lon,lat,pre10,olon,olat,rscan,True);creanm插值
;data1=linint2_points(lon,lat,pre10,True,olon,olat,0)

wks = gsn_open_wks("png","china")
gsn_define_colormap(wks,"gui_default")

res=True
res@gsnDraw                 =False
res@gsnFrame                =False
res@mpMinLatF               = 17.                        
res@mpMaxLatF               = 55.
res@mpMinLonF               = 72.
res@mpMaxLonF               = 136.

res@mpFillOn                = True
res@mpOutlineOn             = False  ; Use outlines from shapefile
res@cnFillDrawOrder         = "PreDraw"
res@mpDataBaseVersion       = "MediumRes"
res@mpDataSetName           = "Earth..4"
res@mpAreaMaskingOn         = True
res@mpMaskAreaSpecifiers    = (/"China","Taiwan","Disputed area between India and China","India:Arunachal Pradesh"/)
res@mpLandFillColor         = "white"
res@mpInlandWaterFillColor  = "white"
res@mpOceanFillColor        = "white"
res@mpOutlineBoundarySets   = "NoBoundaries"
;>--------------------------------------------<
; set for the plot

res@cnFillOn                = True               
res@cnLinesOn               = False            
; res@cnLevelSpacingF         = 5.            
res@gsnSpreadColors         = True         
res@lbLabelAutoStride       = True               
map=gsn_csm_contour_map(wks,data1,res)

;>============================================================<
;                      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

chinamap = add_china_map(wks,map,cnres)
;>============================================================<

draw(map)
frame(wks)
end  
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2015-1-10 19:46:33 | 显示全部楼层
提示这样的错误
(0)     gsn_add_cyclic: Warning: The range of your longitude data is not 360.
(0)     You may want to set gsnAddCyclic to False to avoid a warning
(0)     message from the spline function.
warning:_NhlCreateSplineCoordApprox: Attempt to create spline approximation for X axis failed: consider adjusting trXTensionF value
warning:IrTransInitialize: error creating spline approximation for trXCoordPoints; defaulting to linear

请教高手是怎么回事啊
密码修改失败请联系微信:mofangbao
发表于 2015-1-10 19:54:49 来自手机 | 显示全部楼层
(0)     You may want to set gsnAddCyclic to False to avoid a warning
密码修改失败请联系微信:mofangbao
发表于 2015-1-22 13:40:54 | 显示全部楼层
res@gsn_add_cyclic=False
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2015-4-1 21:28:32 | 显示全部楼层
longlivehj 发表于 2015-1-10 19:54
(0)     You may want to set gsnAddCyclic to False to avoid a warning

谢谢您的答复
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2015-4-1 21:28:52 | 显示全部楼层

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

本版积分规则

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

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

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