![]() |
HDF User’s GuideVersion 4.2.6 |
[Top] [Prev][Next] |
Appendices
Appendix A Reserved HDF TagsA.1 Overview
This appendix includes tables containing brief descriptions of most of the tags that have been reserved for general use. This list will be expanded in future editions to include new tags as they are assigned. A more detailed description of the tags can be found in the HDF Specification and Developer's Guide. Also see the HDF Specification and Developer's Guide for a description of extended tags, which are not discussed in this appendix.
Each table contains a list of tags within one category. The titles of the tables, with a functional description of each table, are:
- Table A: The HDF Utility Tags. Used by the HDF utilties.
- Table B: The HDF General Raster Image Tags. Used to describe aspects of raster image data.
- Table C: The HDF Composite Image Tags. Used to describe aspects of composite image data.
- Table D: The HDF Scientific Data Set Tags: Used to describe aspects of scientific data set (SDS) data.
- Table E: The HDF Vset Tags. Used to describe aspects of HDF Vset data.
- Table F: The Obsolete HDF Tags: Used to describe aspects of HDF data elements that have been replaced by newer tags or discontinued.
A.2 Tag Types and Descriptions
The following tables have five columns:
Tag Name contains the abbreviated symbolic names of tags that are often used in an augmented form in HDF programs.Short Description contains a brief (four word maximum) description of the tag that is commonly used to describe to the tag in HDF manuals and in-line code documentation.Data Size describes the type of data that is associated with the tag and, where possible, lists the data size.Tag Value lists the numeric value of the tag symbol in the hdf.h header file.Long Description contains a general description of the tag.In the tables, the term String refers to a sequence of ASCII characters with the null byte possibly occurring at the end, but nowhere else. The term Text also refers to a sequence of ASCII characters, but it may contain null characters anywhere in the sequence. An n in the Data Size column describes a data unit of variable-length. For more detailed descriptions of these units of data, refer to the appropriate tag entry in the HDF Specification and Developer's Guide.
TABLE AA The HDF Utility TagsTABLE AB The HDF General Raster Image TagsTABLE AC The HDF Composite Image TagsTABLE AD The HDF Scientific Data Set TagsTABLE AE The HDF Vset TagsTABLE AF The Obsolete HDF TagsAppendix B HDF Installation Overview
B.1 General HDF Installation Overview
B.1.1 Acquiring the HDF Library Source
You may obtain the HDF source code and/or selected binaries at no charge from The HDF Group's server:
http://www.hdfgroup.org/products/hdf4
http://www.hdfgroup.org/release4/obtain.html
For reference, the unpacked HDF source code can be found at
ftp://ftp.hdfgroup.org/HDF/HDF_Current/src/unpacked/.
B.1.2 Building the HDF Library Source
For instructions on building HDF from the source code, please refer to the INSTALL file in the top directory of the unpacked HDF source tree.
Appendix C Attributes in HDF
C.1 Attribute Overview
Attributes are optional components in the HDF data model. They can be used to describe the nature and/or the intended usage of various HDF elements. This type of information is sometimes called user-created metadata because it is data about data. The HDF elements that can be assigned with attributes include:
At the creation, an HDF attribute requires a name, data values, number type, and number of values. The attribute name is an ASCII string of any length from 1 to
H4_MAX_NC_NAME
(or256
). The attribute data contains one or more values, in which case all the values must have the same number type as defined at the time the attribute is created. Attributes take the form label=value, where label is the attribute's name and value is the attribute's data. Number of values declares how many data entries the attribute has. The number type can be any type supported by the HDF library. These number types are listed in Table 1A, "Number Type Definitions" in Section I of the HDF4 Reference Manual.For each attribute, an attribute count is maintained that identifies the number of values in the attribute. Each attribute has a unique attribute index, the value of which ranges from 0 to the total number of attributes minus 1. The attribute index is used to locate an attribute in the object which the attribute is attached to. Once the attribute is identified, its values and information can be retrieved.
There are two types of attributes in HDF: predefined attributes and user-defined attributes.
Predefined attributes have reserved names and, in some cases, predefined number types and/or number of data entries. Predefined attributes are useful because they establish conventions that applications can depend on. They were first introduced in DFSD interface and later in the SD interface. They are further described in Section 3.10, "Predefined Attributes," of the HDF User's Guide. The GR interface was added in 1995 and has only one predefined attribute:
FILL_ATTR
, which is described in Section 7.10.1, "Predefined GR Attributes," of the HDF User's Guide.User-defined attributes are defined by the calling program and contain auxiliary information about the element to which the attributes attach. HDF library provides in each interface of SD, GR, V, and VS a set of functions to add and access attributes. They are fully described in the associated chapters.
C.2 Underlaying storage issues
In general, users should not need the details described in this section, unless one is working with older HDF files (circa prior to 1993) and with raw data which relies on the knowledge of data layout in the file. The inclusion of this section in this User's Guide was prompted by the HDF4 File Content Map Project because various API functions being added to support this project require explanation that involves the layout of attributes in the file.
In the early years of HDF, in addition to the predefined attributes such as label, unit, and format, annotations were used to attach metadata to an HDF element such as data set and raster image. When the library was expanded to include user-defined attributes to SD and GR interfaces, metadata once stored as an annotation could be more conveniently stored as an attribute. This expansion introduced the difference in the ways predefined attributes were stored in DFSD interface and in SD/GR interfaces. The user-defined attribute feature then extended into the V and VS interfaces. Along the way, an incompatibility was inadvertently produced in the storage of attributes and their information. The next sections briefly explains these issues and their effects.
C.2.1 Predefined Attributes in DFSD API
Beginning in 1993, when the SD interface and user-created attribute were introduced, an attribute has been stored in a vdata of class
_HDF_ATTRIBUTE
(or "Attr0.0
",) regardless it is a predefined or user-created attribute. However, prior to this period, there were only predefined attributes in DFSD API and they can be assigned to a data set or a dimension. This early predefined attribute of the data set is stored using tag/ref approach, that is, a pair of tag and ref would point to a string containing the values of the data set's attribute and the dimensions' attributes. The dimension attributes are stored following the SDS attribute. All attributes are separated by null characters. For example, in filemyfile
, there is a two-dimensional data set. The SDS and its dimensions were assigned with pre-defined attributes as followed:Data set: label = "
SDS label
", unit = "SDS unit
", format = <no attribute assigned>Dimension 1: label = "
Dim1 label
", unit = <no attribute assigned>, format = "Dim1 format
"Dimension 2: label = "
Dim2 label
", unit = "Dim2 unit
", format = "Dim2 format
"In the file, the attributes' values are stored as followed:
Data set's label attribute tag/ref
(DFTAG_SDL/<ref#>)
| (point to)
-->
"SDS label<null>Dim1 label<null>Dim2 label<null>"
Data set's unit attribute tag/ref
(DFTAG_SDU/<ref#>)
| (point to)
-->
"SDS unit<null><null>Dim2 unit"
Data set's format attribute tag/ref
(DFTAG_SDF/<ref#>)
| (point to)
-->
"<null>Dim1 format<null>Dim2 format"
A complete list of pre-defined attribute tags are provided in Table AG below.
TABLE AG Pre-defined Attributes in the DFSD and SD APIsThe HDF library handles the situation properly, so the difference in storage approaches does not effect general applications, which simply read the values of these predefined attributes. It would only become significant when an application needs to get access to the raw data. The HDF4 File Content Map Project is an example. The raw data of this type of attribute is not accessible by the function SDgetattdatainfo, which was added to support the HDF4 File Content Map Project. Thus, when such an attribute is encountered, SDgetattdatainfo will return the error code
DFE_NOVGREP
to the caller, which will in turn call SDgetoldattdatainfo to get the data information of that attribute.C.2.2 Vgroup Attribute Without Vsetattr
HDF Version 4.0.2, July 19, 1996, and prior did not support attributes in Vgroup and Vdata as for SD and GR interfaces. However, an application could simulate an attribute for a vgroup by creating and writing a vdata of class
_HDF_ATTRIBUTE
, and then adding that vdata to the vgroup via these calls:
vdata_ref = VHstoredatam(file_id, ATTR_FIELD_NAME, values, size, type,
attr_name, _HDF_ATTRIBUTE, order);
ret_value = Vaddtagref (vgroup_id, DFTAG_VH, vdata2_ref);
For simplicity, this type of attributes is referred to as old-style attributes in this document.
A vgroup and vdata were having version number as
VSET_VERSION
(3
). Starting in version 4.1.1, HDF began to support attributes in Vgroup and Vdata interfaces. Applications were able to add and manipulate attributes via public functions such as Vsetattr/VSsetatt, Vgetattr/VSgetattr, Vattrinfo/VSattrinfo,... This type of attributes is referred to as new-style attributes in this document. The version number of a vgroup or a vdata that has new-style attributes got promoted fromVSET_VERSION
(3
) toVSET_NEW_VERSION
(4
).In addition, the file format was changed for the vgroup/vdata header to store the number of attributes and the tag/reference number of each attribute. The new attribute API functions use this new information to get access to the attributes, but they are not aware of the old-style attributes. Thus, Vnattrs misses counting them and other functions like Vattrinfo and Vgetattr are unable to get to them.
Starting in version 4.2.6, the library provides the updated functions Vnattrs2, Vattrinfo2, and Vgetattr2 for applications to get access to attributes that were not created by Vsetattr. These functions access both types of attributes. In addition, the HDF library provides the function Vnoldattrs to get the number of old-style attributes in a vgroup. The old-style attributes are likely to present in older files or files that were modified by older applications. Please refer to Section 5.8, "Vgroup Attributes," of the HDF User's Guide for details on these functions.
HDF 4.2.6 - August 2011 Copyright |
The HDF Group www.hdfgroup.org ![]() |