||
之前自己在读取风云3号数据时候,各种查资料都没有找到相关的内容,后来自己慢慢摸索终于将数据读了出来,虽然方法很笨,但是算是达到了基本效果吧。给自己记录下,也分享给大家。
中间值得注意的是我读取的是风云3B 和 3C的数据,这两种数据的内部格式其实是不一样的,所以分开来读取。
代码如下:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%This is the program for calculating the Snow Water Equivalent from
%FengYun-3 Satelite Images
%Satalite:FY-3A and FY-3B; Sensor: WMRI; Data Level: L1; Orbit:A&D.
%Author:Jinbang Peng; Coding time: 20171107.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Scan the image files in the appointed fold
FoldPath='C:\FY3\code\datasample\';
% FoldPath='C:\FY3\code\datasample\';
DataPath=dir([FoldPath,'FY3*_MWRI*MS.HDF']);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%1.Data input
for i=1%:numel(DataPath)
i=12
file=[FoldPath,DataPath(i).name];
hinfo = hdf5info(file);
% i=5;
% Judge the satelite style of the images (FY_3B or FY-3C), cause the
% data structure is different for FY_3B and FY-3C datasets.
if strncmp(DataPath(i).name,'FY3B',4)
Lati_info = hdf5read(hinfo.GroupHierarchy.Datasets(20));%
Long_info = hdf5read(hinfo.GroupHierarchy.Datasets(21));%
EO_BT_info = hdf5read(hinfo.GroupHierarchy.Datasets(8));%
elseif strncmp(DataPath(i).name,'FY3C',4)
Lati_info = hdf5read(hinfo.GroupHierarchy.Groups(2).Datasets(1));%
Long_info = hdf5read(hinfo.GroupHierarchy.Groups(2).Datasets(2));%
EO_BT_info = hdf5read(hinfo.GroupHierarchy.Groups(1).Datasets(2));%
else
disp('No FY-3 B&C data available in appointed file fold!');
% pritf('No file available in appointed file fold!');
% return;
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
EO_BT_info19h=EO_BT_info(:,:,4);
EO_BT_info37h=EO_BT_info(:,:,8);
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-10-20 04:40
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社