function I = hdfinfo(fname)
%HDFINFO Returns info about SDS's in an HDF 4 file.
%
%    Info = HDFINFO(File) is (nearly) equivalent to the Matlab command
%    HDFINFO if File contains only (floating point) scientific data sets.
%
%    See also HDFREAD.

% R.S. Weigel, 11/15/2004
  
n_datasets = load_hdf(fname);

% Load the information from the first data set

for j = 1:n_datasets
  Temp                 = load_hdf(fname,j-1);
  I.SDS(j).Filename    = fname;
  I.SDS(j).Type        = 'Scientific Data Set';
  I.SDS(j).Name        = Temp.name;
  I.SDS(j).Rank        = Temp.rank;
  I.SDS(j).DataType    = 'float';
  I.SDS(j).Dims(1).Size = Temp.dim_sizes(1);

  I.SDS(j).Dims(2).Size = Temp.dim_sizes(2);
  I.SDS(j).Label       = {Temp.label};
  I.SDS(j).Description = {''};
  I.SDS(j).Index       = j;

  for i = 1:Temp.n_attributes
    I.SDS(j).Attributes(i).Name   = Temp.AttrNames(i,:);
    I.SDS(j).Attributes(i).Value  = Temp.AttrValues(i,:);
  end

end

I.Filename    = fname;
I.Attributes  = {''};
I.Description = {''};


