资源简介
基于游程理论,可以提取干旱特征,分析区域干旱特诊该变化趋势
代码片段和文件信息
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=
评论
共有 条评论