How to read or extract modis HDF aerosol data .

10 ビュー (過去 30 日間)
sunny kant
sunny kant 2014 年 11 月 9 日
コメント済み: David Young 2014 年 11 月 14 日
Hi sir, i have written a code for read a modis hdf aerosol data. i did not read a data or see data in excel. will u check this code and tell me. i attach data set and code also.
% Open the HDF file and assign it a file ID.
modis_id=hdfsd('start','MOD08_M3.A2005001.051.2011046203433.hdf','read');
% Extract information about the file discription
[numdata, numdescr]= hdfsd('fileinfo', modis_id)
% Assigning dataset ID(S)
AODid = hdfsd ('select',modis_id,9) longid = hdfsd ('select',modis_id,0) latid=hdfsd('select', modis_id, 1)
% Extracting infomation from Dataset
[name,numdim,dimvector,type,numdescr]=hdfsd('getinfo',AODid)
[name,numdim,dimvector,type,numdescr]=hdfsd('getinfo',longid)
[name,numdim,dimvector,type,numdescr]=hdfsd('getinfo',latid)
% Reading HDF datasets and importing into MatLAB
startvector=[0 0];
endvector=dimvector;
stride=[];
AODvar=hdfsd('readdata',AODid,startvector,stride,endvector);
longvar=hdfsd('readdata',longid,startvector,stride,endvector);
latvar=hdfsd('readdata',latid,startvector,stride,endvector);
thanks sir
  1 件のコメント
David Young
David Young 2014 年 11 月 14 日
Please edit the first few lines of code to make them readable like the rest. (Put two spaces at the start of each line.)

サインインしてコメントする。

回答 (3 件)

Hyo-Kyung Lee
Hyo-Kyung Lee 2014 年 11 月 14 日
Have you checked the following MODIS MATLAB example?

David Young
David Young 2014 年 11 月 14 日
I've been using hdfinfo with 'eos' as the second argument and hdfread to read MOD10 files.
If you try that and still can't read the data, please could you give more details of what is wrong.

Chad Greene
Chad Greene 2014 年 11 月 9 日
I believe hdfsd is obsolete. Consider h5read instead.
  1 件のコメント
Hyo-Kyung Lee
Hyo-Kyung Lee 2014 年 11 月 14 日
編集済み: Hyo-Kyung Lee 2014 年 11 月 14 日
h5read is for HDF5 file. The MODIS file is HDF4 (HDF-EOS2) so h5read will not work.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeHDF5 についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by