| Home | zeGraph lib | Lua lib | Custom lib | Tutorials | Notes | XML Script | C-Talk | Z-Script |
Graph
   axis
   blend
   color
   color bar
   fog
   freetype
   light
   line
   material
   node
   point
   plot
   polygon
   render
   scene
   stencil
   texcoord
   text
   texture
   vertex
Utility
   array
   bio
   hdf
   make
   math
   netcdf
Auxiliary
   curl
   expact
   sqlite
   window

zeHDF

Use .new("hdf") to create the object for reading data from and writing data to a file in HDF format. The object supports only simple array types of char, short, usiggned short, int, unsigned in, flaot, and double for HDF dataset and attribute. Functions include open, dataset, group, getcmm, putcmm, getvar, putvar, getatt, putatt, list, rename, version.

:open(file)

Opens the file for reading. Open the root group upon success.

:open(file, "w")

Opens the file for writing. Open the root group upon success.

:dataset(name)

Opens the the existing named dataset.

:dataset(name, spec, type)

Creates a dataset with the name and the type. The unsigned integer vector spec specifies dataset dimensions.

:group(name)

Tries to open the named group. If the file is opened for writing, it tries to create a new group if opening the group fails.

:getcmm(name)

Returns the comment of the named group.

:putcmm(name, cmm)

Writes the comment to the named group.

:getvar(spec, arr)

Reads data to the array arr from the currently opened dataset according to the specification vector spec (type of unsigned integer). The data type of arr must be the same as the dataset. The dimension of spec must be m by 2 with m equal to the number of dimensions of the dataset. The first vector of spec specifies the start in each dimension of the dataset and the second vector specifies the number of data to read from the start.

:getvar(arr)

Reads all data of the opened dataset to arr.

:putvar(spec, arr)

Writes data from the array arr to the currently opened dataset according to the specification array spec (type of unsigned integer). The data type of arr must be the same as the dataset. The dimension of spec must be m by 2 with m equal to the number of dimensions of the dataset. The first vector of spec specifies the start positions in each dimension of the dataset and the second vector specifies the number of data to write from the start positions.

:putvar(arr)

Writes data from the array arr to the currently opened dataset. The array must have the same size and type as the dataset.

:getatt("group", name)

Reads the attribute from the named group. Returns a string or numbers depending on attribute content.

:getatt("dataset", name)

Reads the attribute from the named dataset. Returns a string or numbers depending on attribute content.

:putatt("group", name, att1[, att2, ...])

Writes the attributes to the named group. If att1 is string, arguments after it will be ignored; otherwise all arguments will be treadted as numbers.

:putatt("dataset", name, att1[, att2, ...])

Writes the attributes to the opened dataset. If att1 is string, arguments after it will be ignored; otherwise all arguments will be treadted as numbers.

:list("group")

Lists names of group, dataset, and attribute in the opened group.

:list("dataset")

Lists attribute names of the opened dataset.

:rename(name1, name2)

Tries to rename or move name1 group or dataset to name2 dataset or group.

:version()

Returns the version number of HDF library as string.