jimpeng的个人博客分享 http://blog.sciencenet.cn/u/jimpeng

博文

matlab风云3号卫星微波数据读取

已有 4583 次阅读 2017-12-6 15:29 |系统分类:科研笔记| 风云三号

之前自己在读取风云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);




https://blog.sciencenet.cn/blog-1957071-1088501.html


下一篇:Tensorflow 清华镜像安装
收藏 IP: 124.16.186.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-6-2 12:49

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部