MATLAB遥感降尺度

遥感降尺度(线性回归模型)

对于遥感降尺度,最简单的方法就是线性拟合模型。简单的来说就是若干幅高分辨率的影像和与之对应日期的若干幅低分辨率的影像之间建立一个线性回归模型。(Y=AX+B,其中Y是高分辨率影像,X是低分辨率影像,通过建立模型可以得到系数A,B。)
matlab代码:

[aa,R]=geotiffread('F:\yz\PhD\Recent_work\Rework\Downscaling\rework\Landsat\NDVI_clip\LC08_L2SP_133033_20130721_20200912_02_T1_SR_B4.TI.NDVI.tif_clp.tif');%先导入纬度数据
info=geotiffinfo('F:\yz\PhD\Recent_work\Rework\Downscaling\rework\Landsat\NDVI_clip\LC08_L2SP_133033_20130721_20200912_02_T1_SR_B4.TI.NDVI.tif_clp.tif');
[m,n]=size(aa);
%temsum=zeros(m*n,18);%16表示时间序列长度
presum=zeros(m*n,2);%10表示时间序列长度
ndvisum=zeros(m*n,2);%10表示时间序列长度
for year=2013:2014
     %temp=importdata(['D:\qixiang\年尺度数据\插值的结果\年平均温度\tem',int2str(year),'.tif']) ; 
     pre=importdata(['F:\yz\PhD\Recent_work\Rework\Downscaling\rework\MODIS\NDVI_ree_clip _d\A',int2str(year),'.sample.tif_clp.tif']) ; 
     ndvi=importdata(['F:\yz\PhD\Recent_work\Rework\Downscaling\rework\Landsat\NDVI_clip_d\LC08_L2SP_133033_',int2str(year),'.NDVI.tif_clp.tif']) ; 
     %注意数据的有效范围
     %temp(temp<-1000)=NaN;%温度有效范围
     %pre(pre<0)=NaN;%有效范围大于0
     %ndvi(ndvi<-1)=NaN; %有效范围是-11
     %temsum(:,year-1999)=reshape(temp,m*n,1);
     presum(:,year-2012)=reshape(pre,m*n,1);
     ndvisum(:,year-2012)=reshape(ndvi,m*n,1);
end
%多元回归,ndvi=a*pre+b*tem
pre_slope=zeros(m,n);
%tem_slope=zeros(m,n)+NaN;
b_cofficient=zeros(m,n);
pz=zeros(m,n);
for i=1:m*n
        pre=presum(i,:)';
        ndvi=ndvisum(i,:)';
        %tem=temsum(i,:)';
        X=[ones(size(ndvi)),pre];
        [b,bint,r,rint,stats] = regress(ndvi,X);
        pre_slope(i)=b(2);
        b_cofficient(i)=b(1);
        %tem_slope(i)=b(2);
        pz(i)=stats(3);
    
end
filename='F:\yz\PhD\Recent_work\Rework\Downscaling\rework\result/a.tif';
geotiffwrite(filename,pre_slope,R,'GeoKeyDirectoryTag',info.GeoTIFFTags.GeoKeyDirectoryTag)

%filename='G:/downscale_test/results/方程的显著性.tif';
%geotiffwrite(filename,pz,R,'GeoKeyDirectoryTag',info.GeoTIFFTags.GeoKeyDirectoryTag)

%pre_slope(pz>0.05)=NaN;
%filename='G:/downscale_test/results/方程通过0.05显著性检验的的a.tif';
geotiffwrite(filename,pre_slope,R,'GeoKeyDirectoryTag',info.GeoTIFFTags.GeoKeyDirectoryTag)

filename='F:\yz\PhD\Recent_work\Rework\Downscaling\rework\result/b.tif';
geotiffwrite(filename,b_cofficient,R,'GeoKeyDirectoryTag',info.GeoTIFFTags.GeoKeyDirectoryTag)




参考:参考链接
转载一下,感谢原UP!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值