hdfinfo
Information about HDF4 or HDF-EOS2 file
Syntax
S = hdfinfo(filename)
S = hdfinfo(filename,mode)
Description
S = hdfinfo(filename)
returns a structure
S
whose fields contain information about the contents of an HDF4 or
HDF-EOS2 file. Specify filename
as a character vector or string scalar
containing the name of the HDF4 or HDF-EOS2 file.
S = hdfinfo(filename,mode)
reads the file as an HDF4
file if mode
is 'hdf'
, or as an HDF-EOS2 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 HDF4 files or HDF-EOS2 files. To get
information about an HDF5 file, use h5info
.
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 | Character vector | |
| 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 | Character vector |
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.
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.
Field Name | Description | Data Type |
---|---|---|
| Data set attributes. Contains fields | Structure array |
| Annotation description | Cell array |
| Name of the file | Character vector |
| Annotation label | Cell array |
| Name of the data set | Character vector |
| Number of dimensions of the data set | Double |
| Data set reference number | Double |
| Type of HDF or HDF-EOS object | Character vector |
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.
Fields of the Attribute Structure
Field Name | Description | Data Type |
---|---|---|
| Attribute name | Character vector |
| Attribute value or description | Numeric or Text |
Fields of the Raster8 and Raster24 Structures
Field Name | Description | Data Type |
---|---|---|
|
| Logical |
| Height of the image, in pixels | Number |
| Interlace mode of the image (24-bit only) | Character vector |
| Name of the image | Character vector |
| Width of the image, in pixels | Number |
Fields of the SDS Structure
Field Name | Description | Data Type |
---|---|---|
| Data precision | Character vector |
| Dimensions of the data set. Contains fields | 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 | Structure array |
| Class name of the data set | Character vector |
| Fields of the Vdata. Contains fields | Structure array |
| Number of data set records | Double |
|
| Logical |
Fields of the Vgroup Structure
Field Name | Description | Data Type |
---|---|---|
| Class name of the data set | Character vector |
| 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 | 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 | 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 | Structure |
Fields of the Swath Structure
Field Name | Description | Data Type |
---|---|---|
| Data fields in the swath. Contains fields | Structure array |
| Geolocation fields in the swath. Contains fields | Structure array |
| Relationship between indexed elements of the geolocation
mapping. Contains fields | Structure |
| Relationship between data and geolocation fields. Contains
fields | 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
Version History
Introduced before R2006a