MATLAB Function Reference |
Return information about an HDF or HDF-EOS file
Syntax
Description
S = hdfinfo(filename)
returns a structure S
whose fields contain information about the contents of an HDF or HDF-EOS file. filename
is a string that specifies the name of the HDF file.
S = hdfinfo(filename,mode)
reads the file as an HDF file, if mode
is 'hdf'
, or as an HDF-EOS file, if mode
is 'eos'
. If mode
is 'eos'
, only HDF-EOS data objects are queried. To retrieve information on the entire contents of a file containing both HDF and HDF-EOS objects, mode
must be 'hdf'
.
The set of fields in the returned structure S
depends on the individual file. Fields that can be present in the S
structure are shown in the following table.
Mode |
Field Name |
Description |
Return Type |
HDF | Attributes |
Attributes of the data set
|
Structure array |
Description |
Annotation description |
Cell array |
|
Filename |
Name of the file |
String |
|
Label |
Annotation label |
Cell array |
|
Raster8 |
Description of 8-bit raster images |
Structure array |
|
Raster24 |
Description of 24-bit raster images |
Structure array |
|
SDS |
Description of scientific data sets |
Structure array |
|
Vdata |
Description of Vdata sets |
Structure array |
|
Vgroup |
Description of Vgroups |
Structure array |
|
EOS | Filename |
Name of the file |
String |
Grid |
Grid data |
Structure array |
|
Point |
Point data |
Structure array |
|
Swath |
Swath data |
Structure array |
Those fields in the table above that contain structure arrays are further described in the tables shown below.
Fields Common to Returned Structure Arrays
Structure arrays returned by hdfinfo
contain some common fields. These are shown in the table below. Not all structure arrays will contain all of these fields.
Fields Specific to Certain Structures
Structure arrays returned by hdfinfo
also contain fields that are unique to each structure. These are shown in the tables below.
Field Name |
Description |
Data Type |
Name |
Attribute name |
String |
Value |
Attribute value or description |
Numeric or string |
Field Name |
Description |
Data Type |
Level |
Description of each level of the point. Contains fields Name , NumRecords , FieldNames , DataType , and Index . |
Structure |
Examples
To retrieve information about the file example.hdf
,
fileinfo = hdfinfo('example.hdf') fileinfo = Filename: 'example.hdf' SDS: [1x1 struct] Vdata: [1x1 struct]
And to retrieve information from this about the scientific data set in example.hdf
,
sds_info = fileinfo.SDS sds_info = Filename: 'example.hdf' Type: 'Scientific Data Set' Name: 'Example SDS' Rank: 2 DataType: 'int16' Attributes: [] Dims: [2x1 struct] Label: {} Description: {} Index: 0
See Also
hdf5write | hdfread |
© 1994-2005 The MathWorks, Inc.