![4ed0f720db8004ae218e010224e54657.gif](https://i-blog.csdnimg.cn/blog_migrate/6e9f525a2cd422565e24f0563fe5960a.gif)
![99816d90f718c95931efd07407bfb859.gif](https://i-blog.csdnimg.cn/blog_migrate/304c2de3f213cffb9ef218105f9ce3b8.gif)
上一篇推送介绍了如何将下载的nc格式的NDVI数据转换成tif格式,这样结果得到的是旬NDVI【GIMMS NDVI数据处理-nc格式转tif】。今天分享旬NDVI的月最大值合成和月NDVI的年最大值合成。
1 旬NDVI最大值合成月NDVI[a,R]=geotiffread('E:\data\GIMMS NDVI3g V1.0 1982-2015\tif_data\ndvi\1982_1_ndvi.tif');info=geotiffinfo('E:\data\GIMMS NDVI3g V1.0 1982-2015\tif_data\ndvi\1982_1_ndvi.tif');for year=1982:1982 for month=1:12 datasum=zeros(size(a,1)*size(a,2),2); data1=importdata(strcat('E:\data\GIMMS NDVI3g V1.0 1982-2015\tif_data\ndvi\',int2str(year),'_',int2str(month),'.5_ndvi.tif')); data2=importdata(strcat('E:\data\GIMMS NDVI3g V1.0 1982-2015\tif_data\ndvi\',int2str(year),'_',int2str(month),'_ndvi.tif')); data3=reshape(data1,size(a,1)*size(a,2),1); data4=reshape(data2,size(a,1)*size(a,2),1); datasum(:,1)=data3;datasum(:,2)=data4; maxndvi=zeros(1,size(a,1)*size(a,2))+NaN; for n=1:length(datasum) data=datasum(n,:); datamax=max(data); if datamax>-1 maxndvi(1,n)=datamax; end end maxndvi=reshape(maxndvi,size(a,1),size(a,2)); filename=strcat('E:\data\GIMMS NDVI3g V1.0 1982-2015\MVC_month\',int2str(year),'_',int2str(month),'mvc.tif'); geotiffwrite(filename,maxndvi,R,'GeoKeyDirectoryTag',info.GeoTIFFTags.GeoKeyDirectoryTag); endend
关键是将每个像元当月上下旬的NDVI值读取成数组,然后用max函数获取两者最大值,作为月最大NDVI。
2
月NDVI最大值合成年NDVI
[a,R]=geotiffread('E:\data\GIMMS NDVI3g V1.0 1982-2015\MVC\1982_1ndvi.tif');info=geotiffinfo('E:\data\GIMMS NDVI3g V1.0 1982-2015\MVC\1982_1ndvi.tif');for year=1982:2015 datasum=zeros(size(a,1)*size(a,2),12); for month=1:12 data=importdata(strcat('E:\data\GIMMS NDVI3g V1.0 1982-2015\MVC\',int2str(year),'_',int2str(month),'ndvi.tif')); data=reshape(data,size(a,1)*size(a,2),1); datasum(:,month)=data; end maxndvi=zeros(1,size(a,1)*size(a,2))+NaN; for n=1:length(datasum) data=datasum(n,:); datamax=max(data); if datamax>-1 maxndvi(1,n)=datamax; end end maxndvi=reshape(maxndvi,size(a,1),size(a,2)); filename=strcat('E:\data\GIMMS NDVI3g V1.0 1982-2015\MVC年\',int2str(year),'_mvc.tif'); geotiffwrite(filename,maxndvi,R,'GeoKeyDirectoryTag',info.GeoTIFFTags.GeoKeyDirectoryTag);end
关键是将每个像元12个月的NDVI值读取成数组,然后用max函数获取其中最大值,作为年最大NDVI。
说说线性规划
VOSviewer文献综述
泰勒图的MATLAB实现
深度学习--卷积神经网络基础
分享一套数据---GIMMS NDVI
ArcPy批量定义投影和批量投影转换
机器人局部规划算法--DWA算法原理
ArcGIS时间滑块实现车辆轨迹动态展示
GPS数据处理---在野外采样寻点中的应用
Python散点图矩阵--以空气质量数据为例
![7b332c61b53346a70020a5188e4ba8a5.png](https://i-blog.csdnimg.cn/blog_migrate/9e58dd3263ea38c9d6c647a26ebcd584.png)
![1e254aa150a58dcc005dddd902932591.png](https://i-blog.csdnimg.cn/blog_migrate/18b3ee9aab90baaa0770f4663093564d.jpeg)
![88f65f3aa55e2d9ebd25d4b546c2e2c4.png](https://i-blog.csdnimg.cn/blog_migrate/7851e47fff8dfadfd6fdf279023e2920.png)