首先我以这种方式导入数据
hdfvars = {‘Eight_Day_CMG_Snow_Cover’,‘Eight_Day_CMG_Clear_Index’,……“Eight_Day_CMG_Cloud_Obscured”、“Snow_Spatial_QA '};测试管理扫描= ' E: \ \ hdf测试”;dinfo = dir (fullfile(管理扫描' * .hdf '));num_files =长度(dinfo);文件名= fullfile(管理扫描,{dinfo.name});Eight_Day_CMG_Snow_Cover =细胞(num_files, 1);Eight_Day_CMG_Clear_Index =细胞(num_files, 1);Eight_Day_CMG_Cloud_Obscured =细胞(num_files, 1);Snow_Spatial_QA =细胞(num_files, 1); for K = 1 : num_files this_file = filenames{K}; Eight_Day_CMG_Snow_Cover{K} = hdfread(this_file, hdfvars{1}); Eight_Day_CMG_Clear_Index{K} = hdfread(this_file, hdfvars{2}); Eight_Day_CMG_Cloud_Obscured{K} = hdfread(this_file, hdfvars{3}); Snow_Spatial_QA{K} = hdfread(this_file, hdfvars{4}); end
然后重塑数据
B2 = 0 (3600、7200、24);因为我= 1:3600 j = 1:7200 B2 (i, j,一24)=重塑(Eight_Day_CMG_Snow_Cover {i, j}, [1 3 2]);结束结束
然后生成纬度经度和子集感兴趣的区域
朗= 180:0.05:180;lat = 90:0.05:90;subsetqa = Eight_Day_CMG_Snow_Cover (2001:2817、4801:5741:);
然后试图与高程提取多边形,我试(月度)和(8天)部分积雪数据,海拔从SRTM DEM提取多边形。我试图以这种方式使用matlab