爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 5977|回复: 14

[分享资料] 求助求助!!

[复制链接]
发表于 2013-9-25 13:57:48 | 显示全部楼层 |阅读模式

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

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

x
我要做nino指数与臭氧的滞后相关,臭氧是每个月的纬向平均数据,就是只有经向变化和高度变化。用这个臭氧场怎么合nino指数做滞后相关?nino指数每月一个值,臭氧每月一个二维垂直场。  之前下到的滞后相关程序都是要求经纬度的场,不会改。。。。。求大神帮忙啊!!!!{:eb522:}{:eb522:}
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2013-9-25 14:02:41 | 显示全部楼层
@做个霸气的木头  版主求助啊!!!{:eb522:}
密码修改失败请联系微信:mofangbao
发表于 2013-9-25 14:08:24 | 显示全部楼层
你控制好滞后的时间,nino做var1臭氧做var2,把臭氧的空间set完整然后直接用tcorr可以了。
你下载的程序把经度set去掉不就好了,可以循环高度,这样有问题么?
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2013-9-25 14:34:48 | 显示全部楼层

下载的程序看不是很懂,不会改。。。set好滞后时间和高度,怎么使用tcorr,grads学的不好  求解释。。 谢啦
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2013-9-25 15:06:20 | 显示全部楼层
*
*  computing Lead / Lag correlation coefficient of Two Sequences
*
function tcpl(arg)
var1=subwrd(arg,1)
var2=subwrd(arg,2)
t1=subwrd(arg,3)
t2=subwrd(arg,4)
pl1=subwrd(arg,5)
pl2=subwrd(arg,6)
opts=subwrd(arg,7)
if(pl2='')
say 'Computing the Lead / Lag Correlation Coef of Two Sequences Usage:'
say 'TCPL SEQ1 SEQ2 TSTRT TEND PLSTRT PLEND [opts]'
return
else
say 'Computing the Lead / Lag Correlation Coef of Two Sequences::'
say 'Seq1 = 'var1' Seq2 = 'var2' Time Range 't1' to 't2' Lead/Lag Range 'pl1' to 'pl2
endif
if(opts='')
say 'Computing Two Single Points'
else
say 'Computing a Single Point to a Field'
endif
n=pl1
nn=1
while(n<=pl2)
if(n<0)
tt1=1-n;tt2=t2
'set t 'tt1' 'tt2
'define 'pl'='var1'(t'n')'
else
tt1=t1;tt2=t2-n
'set t 'tt1' 'tt2
'define 'pl'='var1'(t+'n')'
endif
'set t 1'
'define plrr=tcorr('pl','var2',t='tt1',t='tt2')'
if(opts='')
****sgl to sgl
'd plrr'
corr=subwrd(result,4)
plr.nn=corr;nn=nn+1
****screen print
if(n<0)
n2=0-n
say var1' Lead to 'var2' 'n2' Intvls corr='corr' Freedom='tt2-tt1+1-2
else
if(n=0)
say var1' Cont to 'var2' 'n' Intvls corr='corr' Freedom='tt2-tt1+1-2
else
say var1' Lag  to 'var2' 'n' Intvls corr='corr' Freedom='tt2-tt1+1-2
endif
endif
else
**sgl-field
**draw confident shades
say 'SF: Input critic correlation coef(return continue):'
say 'SF: Freedom='tt2-tt1+1-2
pull r0
if(r0 != '')
r1=-1*r0
'set gxout shaded';'set rbcols 5 0 5';'set clevs 'r1' 'r0
'd plrr'
'set rbcols auto';'set gxout contour';'d plrr'
else
'd plrr'
endif
**draw title
say 'SF: Input your title(return continue):'
say 'SF: Lead(<0)/Lag(>0) 'n
pull title
if(title='')
if(n<0)
n2=0-n
'draw title 'var1' Lead to 'var2' 'n2' Corr. Ceof. (N='tt2-tt1+1')'
else
if(n=0)
'draw title 'var1' and 'var2' Corr. Ceof. (N='tt2-tt1+1')'
else
'draw title 'var1' Lag to 'var2' 'n' Corr. Ceof. (N='tt2-tt1+1')'
endif
endif
else
'draw title 'title
endif
**your own cmd for example print the fig
while(1)
say 'SF: input your own cmd(return continue)'
pull cmd
if(cmd=''); break; endif
cmd
endwhile
'c'
endif
n=n+1
endwhile
*draw the sgl-sgl VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
if(opts='')
xbl=2;ybl=2;xtr=8;ytr=6;ym=0.5*(ybl+ytr);siz=0.12;sizz=0.08
dx=(xtr-xbl)/(nn+2);dy=(ytr-ybl)/10;xs=xbl+dx
**draw shaded area
if(pl1<0 & pl2>0)
x2=xs+(1-pl1)*dx
'set line 9';'draw recf 'xbl' 'ybl' 'x2' 'ytr
'set line 4';'draw recf 'x2' 'ybl' 'xtr' 'ytr
endif
**draw frame
'set line 1 1 6'
'draw rec 'xbl' 'ybl' 'xtr' 'ytr
**draw line 0
'set line 15 5 3'
'draw line 'xbl' 'ym' 'xtr' 'ym
**draw ylabs
'set line 1 1 3';'set strsiz 0.12';'set string 1 r 0.05'
n=0;lab=-1
while(n<=10)
'draw line 'xbl' 'ybl+n*dy' 'xbl+siz' 'ybl+n*dy
'draw line 'xtr' 'ybl+n*dy' 'xtr-siz' 'ybl+n*dy
lab=-1+0.2*n
'draw string 'xbl-siz' 'ybl+n*dy' 'lab
n=n+1
endwhile
**draw curve
'set line 1 1 3'
'set string 1 tc'
nn=nn-1
n=1
x1=xs+n*dx;y1=ybl+(ytr-ybl)*(1+plr.1)/2
if(pl1<0)
'draw mark 2 'x1' 'y1' 'sizz
else
'draw mark 3 'x1' 'y1' 'sizz
endif
'draw line 'x1' 'ybl' 'x1' 'ybl+siz;'draw line 'x1' 'ytr' 'x1' 'ytr-siz
n=2
n2=pl1+1
while(n<=nn)
x2=xs+n*dx;y2=ybl+(ytr-ybl)*(1+plr.n)/2
if(n2<0)
'draw mark 2 'x2' 'y2' 'sizz
else
'draw mark 3 'x2' 'y2' 'sizz
endif
if(n2=0);'set line 15 5 3';'draw line 'x2' 'ybl' 'x2' 'ytr;'set line 1 1 3';endif
'draw line 'x2' 'ybl' 'x2' 'ybl+siz;'draw line 'x2' 'ytr' 'x2' 'ytr-siz
'draw line 'x1' 'y1' 'x2' 'y2
x1=x2;y1=y2
n=n+1;n2=n2+1
endwhile
**draw xlabs
x2=xs+1*dx
'draw string 'x2' 'ybl-siz' 'pl1
x2=xs+nn*dx
'draw string 'x2' 'ybl-siz' 'pl2
if(pl1<0 & pl2>0)
x2=xs+(1-pl1)*dx
'draw string 'x2' 'ybl-siz' 0'
endif
**draw title
'set string 1 bc';'set strsiz 0.2'
say 'SS: input title(return continue)'
pull title
if(title='')
'draw string '0.5*(xbl+xtr)' 'ytr+0.2' Lead/Lag Correlation Coefficients'
else
'draw string '0.5*(xbl+xtr)' 'ytr+0.2' 'title' Lead/Lag Corr. Coef.'
endif
**draw critic lines
say 'SS: input critic correlation coef(return continue)'
pull r0
if(r0 != '')
'set line 2 1 3'
y2=ybl+(ytr-ybl)*(1-r0)/2
y1=ybl+(ytr-ybl)*(1+r0)/2
'draw line 'xbl' 'y1' 'xtr' 'y1;'draw line 'xbl' 'y2' 'xtr' 'y2
endif
endif
*draw the sgl-sgl AAAAAAAAAAAAAAAAAAAAA
'undefine 'pl
*end
要如何改呢{:eb522:}{:eb522:}
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2013-9-25 15:16:52 | 显示全部楼层
密码修改失败请联系微信:mofangbao
发表于 2013-9-25 20:54:38 | 显示全部楼层
惭愧了,我不会滞后相关,帮顶吧
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2013-9-25 21:02:02 | 显示全部楼层
@lqouc大神还在吗?
密码修改失败请联系微信:mofangbao
发表于 2013-9-25 21:20:49 | 显示全部楼层
↘禹禹獨行… 发表于 2013-9-25 21:02
@lqouc大神还在吗?

我勒个去啊,没用过这么费事的办法,你这个function也没给个测试数据?我也不知道你这些都要改哪里,我用的都很基础。
我一般就是简单的手动修改ctl的时间,然后直接按照正常的相关做就好了。你要是不想手动改的话就在grads里面设置。
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2013-9-25 21:42:33 | 显示全部楼层
lqouc 发表于 2013-9-25 21:20
我勒个去啊,没用过这么费事的办法,你这个function也没给个测试数据?我也不知道你这些都要改哪里,我用 ...

可不行可以说的具体点,感激不尽
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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