資源簡介
基于游程理論,可以提取干旱特征,分析區域干旱特診該變化趨勢
代碼片段和文件信息
function?run=droughtrun(spi)
%?the?input?must?be?a?col?vector
spi=spi‘;
x0=0;
x1=-0.3;
x2=-0.5;
indx=find(spi<=x1);
%?the?location?where?spi<=x1?
lspi=[indx;spi(indx)];
%?the?first?row?represents?location?where?spi<=-0.3?and?second?row
%?are?spi?values?via?reletive?lacation
j=[];
for?i=2:length(indx)-1
????if?(lspi(1i+1)-lspi(1i))>1?&&?(lspi(1i)-lspi(1i-1))>1;
????????j=[ji];
????????%?find?the?single?drought?evedent
????end
end
for?k=1:length(j)
????if?lspi(2j(k))>x2?
????????%?judge?whether?consider?the?single?drought?event?as?drought?occurrence
????????lspi(2j(k))=0;
????????%?assign?0?to?these?single?drought?events?which?was?not?considered?as?drought?occurrence
????end
end
ind=find(lspi(2:)~=0);
%?delete?the?non-drought?events
lspi=lspi(:ind);
k=[];
for?i=1:length(lspi(1:))-1;
????if?lspi(1i+1)-lspi(1i)==2;?
????????%?尋找兩次干旱事件之間只間隔一月的間隔月
???????k=[ki];?
????end
end
ls=[];
lspi=lspi‘;
spi=spi‘;
for?i=1:length(k)
????if?spi(lspi(k(i)1)+11) ????????%?判定是否將間隔月定位干旱事件
????????ls=[ls;lspi(k(i)1)+10];
????????%?將干旱事件整合
????end
end
lspi=[lspi;ls];
ls1=lspi(:1);
[yind]=sort(ls1);?
z=zeros(length(y)1);
for?i=
評論
共有 條評論