用Matlab把SMAP vegetation optical depth (VOD)数据转换成带投影信息EASE GRID2的tif文件

下载的SMAP植被光学深度VOD数据为.mat格式

MTDCA_V4_TAU_201601_201603_9km.mat

用matlab读取,包含MTDCA_TAU(1624x3856x90)和DateVector(90x3,年,月,日)

EASE GRID2 相关信息,网址https://nsidc.org/ease/ease-grid-projection-gt

用Matlab把SMAP vegetation optical depth (VOD)数据转换成带投影信息EASE GRID2的tif文件

%EASE-Grid 2.0  9 km 投影参数,x y坐标范围
xworldlimits=[-17367530.45,17367530.45];
yworldlimits=[-7314540.83,7314540.83];
% EASE-Grid 2.0 9km 行列号数
rastersize=[1624,3856];
% 创建参考坐标系
R= maprefcells(xworldlimits,yworldlimits,rastersize,'ColumnsStartFrom','north');

R的属性信息如下图:

用Matlab把SMAP vegetation optical depth (VOD)数据转换成带投影信息EASE GRID2的tif文件

用Matlab把SMAP vegetation optical depth (VOD)数据转换成带投影信息EASE GRID2的tif文件

info=geotiffinfo('EASE2_GRID.tif');%

用Matlab把SMAP vegetation optical depth (VOD)数据转换成带投影信息EASE GRID2的tif文件

geotiffwrite('output.tif',MTDAC_TAU(:,:,1),R,'GeoKeyDirectoryTag',info.GeoTIFFTags.GeoKeyDirectoryTag);

至此,转换成功了,耶(^-^)V

之前用imwrite存成tif,但是出来的值是0-255的,不是double型;geotiffwrite可以存0-1double型。