A module of the pyhdf package implementing the basic API of the NCSA HDF4 library. (see: hdf.ncsa.uiuc.edu)
Version: 0.7-3 Date: July 13 2005
The role of the HDF module is to provide support to other modules of the pyhdf package. It defines constants specifying file opening modes and various data types, methods for accessing files, plus a few utility functions to query library version and check if a file is an HDF one.
It should be noted that, among the modules of the pyhdf package, SD is special in the sense that it is self-contained and does not need support from the HDF module. For example, SD provides its own file opening and closing methods, whereas VS uses methods of the HDF.HDF class for that.
The HDF module provides the following classes.
- HC
- The HC class holds constants defining opening modes and various data types.
- HDF
The HDF class provides methods to open and close an HDF file, and return instances of the major HDF APIs (except SD).
To instantiate an HDF class, call the HDF() constructor.
- methods:
- constructors:
- HDF() open an HDF file, creating the file if necessary,
- and return an HDF instance
- vstart() initialize the VS (Vdata) API over the HDF file and
- return a VS instance
- vgstart() initialize the V (Vgroup) interface over the HDF file
- and return a V instance.
- closing file
- close() close the HDF file
- inquiry
- getfileversion() return info about the version of the HDF file
The HDF module also offers the following functions.
- inquiry
- getlibversion() return info about the version of the library ishdf() determine whether a file is an HDF file
The HDF class encapsulates the basic HDF functions. Its main use is to open and close an HDF file, and return instances of the major HDF APIs (except for SD). To instantiate an HDF class, call the HDF() constructor.
Close the HDF file.
C library equivalent : Hclose
Get file version info.
C library equivalent : Hgetlibversion
Initialize the V API over the file and return a V instance.
C library equivalent : Vstart (in fact: Vinitialize)
Initialize the VS API over the file and return a VS instance.
C library equivalent : Vstart (in fact: Vinitialize)
An error from inside the HDF4 library.
The HC class holds contants defining opening modes and data types.
File opening modes (flags ORed together)
CREATE 4 create file if it does not exist READ 1 read-only mode TRUNC 256 truncate if it exists WRITE 2 read-write mode
Data types
CHAR 4 8-bit char CHAR8 4 8-bit char UCHAR 3 unsigned 8-bit integer (0 to 255) UCHAR8 3 unsigned 8-bit integer (0 to 255) INT8 20 signed 8-bit integer (-128 to 127) UINT8 21 unsigned 8-bit integer (0 to 255) INT16 23 signed 16-bit integer UINT16 23 unsigned 16-bit integer INT32 24 signed 32-bit integer UINT32 25 unsigned 32-bit integer FLOAT32 5 32-bit floating point FLOAT64 6 64-bit floating point
Tags
DFTAG_NDG 720 dataset DFTAG_VH 1962 vdata DFTAG_VG 1965 vgroup
Get the library version info.
C library equivalent : Hgetlibversion
Determine whether a file is an HDF file.
C library equivalent : Hishdf