| MATLAB® | ![]() |
S = hdfinfo(filename)
S = hdfinfo(filename,mode)
S = hdfinfo(filename) returns a structure S whose fields contain information about the contents of an HDF4 or HDF-EOS file. filename is a string that specifies the name of the HDF4 file.
S = hdfinfo(filename,mode) reads the file as an HDF4 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 HDF4 and HDF-EOS objects, mode must be 'hdf'.
Note hdfinfo can be used on Version 4.x HDF files or Version 2.x HDF-EOS files. To get information about an HDF5 file, use hdf5info. |
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 |
|---|---|---|---|
Attributes of the data set | Structure array | ||
Annotation description | Cell array | ||
Name of the file | String | ||
Annotation label | Cell array | ||
Description of 8-bit raster images | Structure array | ||
Description of 24-bit raster images | Structure array | ||
Description of scientific data sets | Structure array | ||
Description of Vdata sets | Structure array | ||
Description of Vgroups | Structure array | ||
Name of the file | String | ||
Grid data | Structure array | ||
Point data | Structure array | ||
Swath data | Structure array |
Those fields in the table above that contain structure arrays are further described in the tables shown below.
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.
Field Name | Description | Data Type |
|---|---|---|
Data set attributes. Contains fields Name and Value. | Structure array | |
Annotation description | Cell array | |
Name of the file | String | |
Annotation label | Cell array | |
Name of the data set | String | |
Number of dimensions of the data set | Double | |
Data set reference number | Double | |
Type of HDF or HDF-EOS object | String |
Structure arrays returned by hdfinfo also contain fields that are unique to each structure. These are shown in the tables below.
Fields of the Attribute Structure
Field Name | Description | Data Type |
|---|---|---|
Attribute name | String | |
Attribute value or description | Numeric or string |
Fields of the Raster8 and Raster24 Structures
Field Name | Description | Data Type |
|---|---|---|
1 (true) if the image has an associated palette, otherwise 0 (false) (8-bit only) | Logical | |
Height of the image, in pixels | Number | |
Interlace mode of the image (24-bit only) | String | |
Name of the image | String | |
Width of the image, in pixels | Number |
Fields of the SDS Structure
Field Name | Description | Data Type |
|---|---|---|
Data precision | String | |
Dimensions of the data set. Contains fields Name, DataType, Size, Scale, and Attributes. Scale is an array of numbers to place along the dimension and demarcate intervals in the data set. | Structure array | |
Index of the SDS | Number |
Fields of the Vdata Structure
Field Name | Description | Data Type |
|---|---|---|
Attributes of the entire data set. Contains fields Name and Value. | Structure array | |
Class name of the data set | String | |
Fields of the Vdata. Contains fields Name and Attributes. | Structure array | |
Number of data set records | Double | |
1 (true) if Vdata is an attribute, otherwise 0 (false) | Logical |
Fields of the Vgroup Structure
Field Name | Description | Data Type |
|---|---|---|
Class name of the data set | String | |
Description of the 8-bit raster image | Structure array | |
Description of the 24-bit raster image | Structure array | |
Description of the Scientific Data sets | Structure array | |
Tag of this Vgroup | Number | |
Description of the Vdata sets | Structure array | |
Description of the Vgroups | Structure array |
Fields of the Grid Structure
Field Name | Description | Data Type |
|---|---|---|
Number of columns in the grid | Number | |
Description of the data fields in each Grid field of the grid. Contains fields Name, Rank, Dims, NumberType, FillValue, and TileDims. | Structure array | |
Lower right corner location, in meters | Number | |
Origin code for the grid | Number | |
Pixel registration code | Number | |
Projection code, zone code, sphere code, and projection parameters of the grid. Contains fields ProjCode, ZoneCode, SphereCode, and ProjParam. | Structure | |
Number of rows in the grid | Number | |
Upper left corner location, in meters | Number |
Fields of the Point Structure
Field Name | Description | Data Type |
|---|---|---|
Description of each level of the point. Contains fields Name, NumRecords, FieldNames, DataType, and Index. | Structure |
Fields of the Swath Structure
Field Name | Description | Data Type |
|---|---|---|
Data fields in the swath. Contains fields Name, Rank, Dims, NumberType, and FillValue. | Structure array | |
Geolocation fields in the swath. Contains fields Name, Rank, Dims, NumberType, and FillValue. | Structure array | |
Relationship between indexed elements of the geolocation mapping. Contains fields Map and Size. | Structure | |
Relationship between data and geolocation fields. Contains fields Map, Offset, and Increment. | Structure |
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![]() | hdf5write | hdfread | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |