Liza
Liza

Reputation: 1126

How to read in Modis MYDOCGA files in Matlab

I'm trying to import this file into Matlab, so that I can crop it: http://e4ftl01.cr.usgs.gov/MOLA/MYDOCGA.006/2002.07.04/MYDOCGA.A2002185.h00v08.006.2015149042409.hdf

mypath='C:\Users\Desktop\';
fname='MYDOCGA.A2002185.h00v08.006.2015149042409.hdf';
Band8_Aqua=hdfread([mypath fname],'sur_refl_b08_c');

but it opens the file as a vector, not a matrix.

Upvotes: 0

Views: 197

Answers (1)

horchler
horchler

Reputation: 18484

I think that you need to understand the data format and all of the other information in the file. I don't really know much about this area, but using hdftool, the following command was suggested:

frame = 'MYDOCGA.A2002185.h00v08.006.2015149042409.hdf';
sur_refl_b08_1 = hdfread(fname, 'MODIS_Grid_2D', 'Fields', 'sur_refl_b08_1');

Then imshow(sur_refl_b08_1) yields an image. You'll have to explore and learn more yourself. Check out this page, including the learning resources at the bottom.

Upvotes: 1

Related Questions