爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 7641|回复: 6

[作图] 求助!NCL 站点资料画相关系数分布图

[复制链接]

新浪微博达人勋

发表于 2016-3-1 22:02:10 | 显示全部楼层 |阅读模式

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

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

x
用站点资料画相关系数分布图 t检验的时候出了问题 报错:
QQ图片20160301215909.png 附程序如下:
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"
load "$NCARG_ROOT/lib/ncarg/nclscripts/cnmap/cnmap.ncl"
;************************************************
begin
;************************************************
; variable and file handling
;************************************************
;************************************************
;  read station data
;************************************************
tem = asciiread("8002aw.txt",(/678,23/),"float")
info = asciiread("sta678ll.txt",(/678,3/),"float")
tem!0 = "sta"
tem&sta = ispan(1,678,1)
tem!1 = "year"
tem&year =ispan(1980,2002,1)

lon= info(:,1)
lat = info(:,2)
;print(tem)
;************************************************
;  calculate corr of ENSO index&fog days
;************************************************
enso= asciiread("8002enso.txt",23,"float")
ccr2 = escorc(enso,tem)

;printVarSummary(tem)
printVarSummary(ccr2)
;print(ccr2)
;asciiwrite("ccr2.txt",ccr2)
;t检验
t1= new(678,"float")
t1 = ccr2* sqrt((23.-2.)/(1-ccr2^2))
;t1!0 = "lon"
;t1!1 = "lat"
;t1&lon = lon
;t1&lat = lat
t1@_FillValue = 1e+20

olon = new(66,"float");
olat = new(40,"float");
tem1 = new((/40,66/),"float")
tem2 = new((/40,66/),"float")
do i=0,65
   olon(i) =72+i
end do
do l=0,39
   olat(l) = 17+l
end do
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

ccr2@_FillValue = 9.96921e+36  
rscan = (/10,5,3/)   ;连续的有效半径大小,最大为10,依次递减
tem1 = obj_anal_ic_Wrap(lon,lat,ccr2,olon,olat,rscan, False)  ;Creanm插值
;************************************************
; plot
;************************************************
wks = gsn_open_wks("png","tem")
gsn_define_colormap(wks,"BlueWhiteOrangeRed")
;t检验-阴影
tem2 = obj_anal_ic_Wrap(lon,lat,t1,olon,olat,rscan, False)
res2 = True
res2@cnFillOn = True
res2@cnLinesOn = False
res2@gsnDraw = False                      ; do not draw  
res2@gsnFrame = False                      ; do not advance frame
res2@gsnMaximize           = True
res2@lbLabelBarOn= False
res2@cnLineLabelsOn = False

res2@mpCenterLonF = 175.            
res2@mpMinLonF =  0.              
res2@mpMaxLonF = 350.
res2@mpMinLatF = -60.
res2@mpMaxLatF =  60.

res2@cnLevelSelectionMode = "ExplicitLevels"
;res2@cnLevels = (/-2.750,-2.042,2.042,2.750/)   
res2@cnFillColors =(/2,66,0,189,253/)
plot = gsn_csm_contour_map(wks,t1,res2)

res2@mpFillDrawOrder= "PostDraw"

res = True
res@gsnDraw = False
res@gsnFrame = False
res@gsnMaximize = True
res@cnFillOn = True
res@gsnAddCyclic = False

res@mpMinLatF = 17
res@mpMaxLatF = 57
res@mpMinLonF = 72
res@mpMaxLonF = 138
res@mpFillOn                = True
res@mpOutlineOn             = False  ; Use outlines from shapefile
res@cnFillDrawOrder         = "PreDraw"        ;
res@cnLineDrawOrder = "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"
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 no

plot = gsn_csm_contour_map(wks,tem1,res)
chinamap = add_china_map(wks,plot,cnres)


draw(plot)
frame(wks)
end
求大家帮看一下哪里的问题 谢谢大家!!
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2016-3-2 09:33:12 | 显示全部楼层
多谢分享~~~
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

新浪微博达人勋

发表于 2016-3-2 10:16:05 | 显示全部楼层
提示说得很清楚呀!
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2016-3-2 16:26:03 | 显示全部楼层
longlivehj 发表于 2016-3-2 10:16
提示说得很清楚呀!

NCL刚刚入手 报错没有提示错误所在行数  就还是不太懂 如果不做t检验没有问题 加了做t检验的代码后就出现了问题  把t检验查过了 看不出错==...能不能麻烦您指点一下呢?谢谢!!
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2016-3-2 18:37:48 | 显示全部楼层
本帖最后由 海soso 于 2016-3-2 18:39 编辑

求大神
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

新浪微博达人勋

发表于 2018-1-5 14:41:08 | 显示全部楼层
所以最后是哪里错了呀 我也报这样的错
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2018-11-20 17:17:54 | 显示全部楼层
楼主问题解决了吗?
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

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

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

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