![]() |
HDF5
1.15.0.fc88fcd
API Reference
|
Functions used to simplify creating and manipulating datasets, attributes and other features (H5LT, H5LD)
The HDF5 Lite API consists of higher-level functions which do more operations per call than the basic HDF5 interface. The purpose is to wrap intuitive functions around certain sets of features in the existing APIs. It has the following sets of functions listed below.
Functions | |
H5_HLDLL herr_t | H5LDget_dset_dims (hid_t did, hsize_t *cur_dims) |
Retrieves the current dimension sizes of a dataset. More... | |
H5_HLDLL size_t | H5LDget_dset_type_size (hid_t did, const char *fields) |
Returns the size in bytes of the dataset's datatype. More... | |
H5_HLDLL herr_t | H5LDget_dset_elmts (hid_t did, const hsize_t *prev_dims, const hsize_t *cur_dims, const char *fields, void *buf) |
Retrieves selected data from the dataset. More... | |
H5_HLDLL herr_t | H5LTmake_dataset (hid_t loc_id, const char *dset_name, int rank, const hsize_t *dims, hid_t type_id, const void *buffer) |
Creates and writes a dataset of a type type_id . More... | |
H5_HLDLL herr_t | H5LTmake_dataset_char (hid_t loc_id, const char *dset_name, int rank, const hsize_t *dims, const char *buffer) |
Creates and writes a dataset. More... | |
H5_HLDLL herr_t | H5LTmake_dataset_short (hid_t loc_id, const char *dset_name, int rank, const hsize_t *dims, const short *buffer) |
Creates and writes a dataset. More... | |
H5_HLDLL herr_t | H5LTmake_dataset_int (hid_t loc_id, const char *dset_name, int rank, const hsize_t *dims, const int *buffer) |
Creates and writes a dataset. More... | |
H5_HLDLL herr_t | H5LTmake_dataset_long (hid_t loc_id, const char *dset_name, int rank, const hsize_t *dims, const long *buffer) |
Creates and writes a dataset. More... | |
H5_HLDLL herr_t | H5LTmake_dataset_float (hid_t loc_id, const char *dset_name, int rank, const hsize_t *dims, const float *buffer) |
Creates and writes a dataset. More... | |
H5_HLDLL herr_t | H5LTmake_dataset_double (hid_t loc_id, const char *dset_name, int rank, const hsize_t *dims, const double *buffer) |
Creates and writes a dataset. More... | |
H5_HLDLL herr_t | H5LTmake_dataset_string (hid_t loc_id, const char *dset_name, const char *buf) |
Creates and writes a dataset with string datatype. More... | |
H5_HLDLL herr_t | H5LTread_dataset (hid_t loc_id, const char *dset_name, hid_t type_id, void *buffer) |
Reads a dataset from disk. More... | |
H5_HLDLL herr_t | H5LTread_dataset_char (hid_t loc_id, const char *dset_name, char *buffer) |
Reads a dataset from disk. More... | |
H5_HLDLL herr_t | H5LTread_dataset_short (hid_t loc_id, const char *dset_name, short *buffer) |
Reads a dataset from disk. More... | |
H5_HLDLL herr_t | H5LTread_dataset_int (hid_t loc_id, const char *dset_name, int *buffer) |
Reads a dataset from disk. More... | |
H5_HLDLL herr_t | H5LTread_dataset_long (hid_t loc_id, const char *dset_name, long *buffer) |
Reads a dataset from disk. More... | |
H5_HLDLL herr_t | H5LTread_dataset_float (hid_t loc_id, const char *dset_name, float *buffer) |
Reads a dataset from disk. More... | |
H5_HLDLL herr_t | H5LTread_dataset_double (hid_t loc_id, const char *dset_name, double *buffer) |
Reads a dataset from disk. More... | |
H5_HLDLL herr_t | H5LTread_dataset_string (hid_t loc_id, const char *dset_name, char *buf) |
Reads a dataset from disk. More... | |
H5_HLDLL herr_t | H5LTget_dataset_ndims (hid_t loc_id, const char *dset_name, int *rank) |
Gets the dimensionality of a dataset. More... | |
H5_HLDLL herr_t | H5LTget_dataset_info (hid_t loc_id, const char *dset_name, hsize_t *dims, H5T_class_t *type_class, size_t *type_size) |
Retrieves information about a dataset. More... | |
H5_HLDLL herr_t | H5LTfind_dataset (hid_t loc_id, const char *name) |
Determines whether a dataset exists. More... | |
H5_HLDLL herr_t | H5LTset_attribute_string (hid_t loc_id, const char *obj_name, const char *attr_name, const char *attr_data) |
Creates and writes a string attribute. More... | |
H5_HLDLL herr_t | H5LTset_attribute_char (hid_t loc_id, const char *obj_name, const char *attr_name, const char *buffer, size_t size) |
Creates and writes an attribute. More... | |
H5_HLDLL herr_t | H5LTset_attribute_uchar (hid_t loc_id, const char *obj_name, const char *attr_name, const unsigned char *buffer, size_t size) |
Creates and writes an attribute. More... | |
H5_HLDLL herr_t | H5LTset_attribute_short (hid_t loc_id, const char *obj_name, const char *attr_name, const short *buffer, size_t size) |
Creates and writes an attribute. More... | |
H5_HLDLL herr_t | H5LTset_attribute_ushort (hid_t loc_id, const char *obj_name, const char *attr_name, const unsigned short *buffer, size_t size) |
Creates and writes an attribute. More... | |
H5_HLDLL herr_t | H5LTset_attribute_int (hid_t loc_id, const char *obj_name, const char *attr_name, const int *buffer, size_t size) |
Creates and writes an attribute. More... | |
H5_HLDLL herr_t | H5LTset_attribute_uint (hid_t loc_id, const char *obj_name, const char *attr_name, const unsigned int *buffer, size_t size) |
Creates and writes an attribute. More... | |
H5_HLDLL herr_t | H5LTset_attribute_long (hid_t loc_id, const char *obj_name, const char *attr_name, const long *buffer, size_t size) |
Creates and writes an attribute. More... | |
H5_HLDLL herr_t | H5LTset_attribute_long_long (hid_t loc_id, const char *obj_name, const char *attr_name, const long long *buffer, size_t size) |
Creates and writes an attribute. More... | |
H5_HLDLL herr_t | H5LTset_attribute_ulong (hid_t loc_id, const char *obj_name, const char *attr_name, const unsigned long *buffer, size_t size) |
Creates and writes an attribute. More... | |
H5_HLDLL herr_t | H5LTset_attribute_ullong (hid_t loc_id, const char *obj_name, const char *attr_name, const unsigned long long *buffer, size_t size) |
Creates and writes an attribute. More... | |
H5_HLDLL herr_t | H5LTset_attribute_float (hid_t loc_id, const char *obj_name, const char *attr_name, const float *buffer, size_t size) |
Creates and writes an attribute. More... | |
H5_HLDLL herr_t | H5LTset_attribute_double (hid_t loc_id, const char *obj_name, const char *attr_name, const double *buffer, size_t size) |
Creates and writes an attribute. More... | |
H5_HLDLL herr_t | H5LTget_attribute (hid_t loc_id, const char *obj_name, const char *attr_name, hid_t mem_type_id, void *data) |
Reads an attribute from disk. More... | |
H5_HLDLL herr_t | H5LTget_attribute_string (hid_t loc_id, const char *obj_name, const char *attr_name, char *data) |
Reads an attribute from disk. More... | |
H5_HLDLL herr_t | H5LTget_attribute_char (hid_t loc_id, const char *obj_name, const char *attr_name, char *data) |
Reads an attribute from disk. More... | |
H5_HLDLL herr_t | H5LTget_attribute_uchar (hid_t loc_id, const char *obj_name, const char *attr_name, unsigned char *data) |
Reads an attribute from disk. More... | |
H5_HLDLL herr_t | H5LTget_attribute_short (hid_t loc_id, const char *obj_name, const char *attr_name, short *data) |
Reads an attribute from disk. More... | |
H5_HLDLL herr_t | H5LTget_attribute_ushort (hid_t loc_id, const char *obj_name, const char *attr_name, unsigned short *data) |
Reads an attribute from disk. More... | |
H5_HLDLL herr_t | H5LTget_attribute_int (hid_t loc_id, const char *obj_name, const char *attr_name, int *data) |
Reads an attribute from disk. More... | |
H5_HLDLL herr_t | H5LTget_attribute_uint (hid_t loc_id, const char *obj_name, const char *attr_name, unsigned int *data) |
Reads an attribute from disk. More... | |
H5_HLDLL herr_t | H5LTget_attribute_long (hid_t loc_id, const char *obj_name, const char *attr_name, long *data) |
Reads an attribute from disk. More... | |
H5_HLDLL herr_t | H5LTget_attribute_long_long (hid_t loc_id, const char *obj_name, const char *attr_name, long long *data) |
Reads a long long attribute. More... | |
H5_HLDLL herr_t | H5LTget_attribute_ulong (hid_t loc_id, const char *obj_name, const char *attr_name, unsigned long *data) |
Reads an attribute from disk. More... | |
H5_HLDLL herr_t | H5LTget_attribute_ullong (hid_t loc_id, const char *obj_name, const char *attr_name, unsigned long long *data) |
Reads an attribute from disk. More... | |
H5_HLDLL herr_t | H5LTget_attribute_float (hid_t loc_id, const char *obj_name, const char *attr_name, float *data) |
Reads an attribute from disk. More... | |
H5_HLDLL herr_t | H5LTget_attribute_double (hid_t loc_id, const char *obj_name, const char *attr_name, double *data) |
Reads an attribute from disk. More... | |
H5_HLDLL herr_t | H5LTget_attribute_ndims (hid_t loc_id, const char *obj_name, const char *attr_name, int *rank) |
Gets the dimensionality of an attribute. More... | |
H5_HLDLL herr_t | H5LTget_attribute_info (hid_t loc_id, const char *obj_name, const char *attr_name, hsize_t *dims, H5T_class_t *type_class, size_t *type_size) |
Gets information about an attribute. More... | |
H5_HLDLL hid_t | H5LTtext_to_dtype (const char *text, H5LT_lang_t lang_type) |
Creates an HDF5 datatype given a text description. More... | |
H5_HLDLL herr_t | H5LTdtype_to_text (hid_t dtype, char *str, H5LT_lang_t lang_type, size_t *len) |
Creates a text description of an HDF5 datatype. More... | |
H5_HLDLL herr_t | H5LTfind_attribute (hid_t loc_id, const char *name) |
Determines whether an attribute exists. More... | |
H5_HLDLL htri_t | H5LTpath_valid (hid_t loc_id, const char *path, hbool_t check_object_valid) |
Determines whether an HDF5 path is valid and, optionally, whether the path resolves to an HDF5 object. More... | |
H5_HLDLL hid_t | H5LTopen_file_image (void *buf_ptr, size_t buf_size, unsigned flags) |
Opens an HDF5 file image in memory. More... | |
Retrieves the current dimension sizes of a dataset.
[in] | did | The dataset identifier |
[out] | cur_dims | The current dimension sizes of the dataset |
H5LDget_dset_dims() retrieves the current dimension sizes for the dataset did
through the parameter cur_dims
. It will return failure if cur_dims
is NULL.
H5_HLDLL herr_t H5LDget_dset_elmts | ( | hid_t | did, |
const hsize_t * | prev_dims, | ||
const hsize_t * | cur_dims, | ||
const char * | fields, | ||
void * | buf | ||
) |
Retrieves selected data from the dataset.
[in] | did | The dataset identifier |
[in] | prev_dims | The previous dimension size of the dataset |
[in] | cur_dims | The current dimension sizes of the dataset |
[in] | fields | A string containing a comma-separated list of fields for a compound datatype |
[out] | buf | Buffer for storing data retrieved from the dataset |
H5LDget_dset_dims() retrieves selected data of the dataset did
and stores the data in the parameter buf
. The difference between the parameters prev_dims
and cur_dims
indicates the dimension sizes of the data to be selected from the dataset. Note that cur_dims
must have at least one dimension whose size is greater than the corresponding dimension in prev_dims
. Users can determine the size of buf by multiplying the datatype size of the dataset by the number of selected elements.
If the parameter fields
is NULL, this routine returns data for the selected elements of the dataset. If fields
is not NULL and the dataset has a compound datatype, fields
is a string containing a comma-separated list of fields. Each name in fields
specifies a field in the compound datatype, and this routine returns data of the selected fields for the dataset's selected elements. Note that ’,’ is the separator for the fields of a compound datatype while ’.’ is the separator for a nested field. Use backslash to escape characters in field names that conflict with these two separators.
For the first example, DSET1
is a two-dimensional chunked dataset with atomic type defined below:
The following coding sample illustrates the reading of data elements appended to the dataset DSET1:
The output buffer will contain data elements selected from DSET1
as follows:
For the second example, DSET2 is a one-dimensional chunked dataset with compound type defined below:
The following coding sample illustrates the reading of data elements appended to the dataset DSET2
with compound datatype. This example selects only 2 fields: the fourth field d
and a subfield of the sixth field s2.c:
The output buffer will contain data for d
and s2.c
selected from DSET2
as follows:
H5_HLDLL size_t H5LDget_dset_type_size | ( | hid_t | did, |
const char * | fields | ||
) |
Returns the size in bytes of the dataset's datatype.
[in] | did | The dataset identifier |
[in] | fields | The pointer to a comma-separated list of fields for a compound datatype |
H5LDget_dset_type_size() allows the user to find out the datatype size for the dataset associated with did
. If the parameter fields
is NULL, this routine just returns the size of the dataset's datatype. If the dataset has a compound datatype and fields
is non-NULL, this routine returns the size of the datatype(s) for the selected fields specified in fields
. Note that ’,’ is the separator for the fields of a compound datatype while ’.’ (dot) is the separator for a nested field. Use a backslash ( \ ) to escape characters in field names that conflict with these two separators.
H5_HLDLL herr_t H5LTdtype_to_text | ( | hid_t | dtype, |
char * | str, | ||
H5LT_lang_t | lang_type, | ||
size_t * | len | ||
) |
Creates a text description of an HDF5 datatype.
[in] | dtype | Identifier of the datatype to be converted |
[out] | str | Buffer for the text description of the datatype |
[in] | lang_type | The language used to describe the datatype. The currently supported language is H5LT_DDL. |
[out] | len | The size of buffer needed to store the text description |
Given an HDF5 datatype identifier, this function creates a description of this datatype in lang_type
language format. A preliminary H5LTdtype_to_text() call can be made to determine the size of the buffer needed with a NULL passed in for str
. This value is returned as len
. That value can then be assigned to len for a second H5Ttype_to_text() call, which will retrieve the actual text description for the datatype.
If len
is not big enough for the description, the text description will be truncated to fit in the buffer.
Currently only DDL (H5LT_DDL) is supported for lang_type
. The complete DDL definition of HDF5 data types can be found in the last chapter of the HDF5 User's Guide.
enum
type is shown as follows. Determines whether an attribute exists.
[in] | loc_id | Identifier of the object to which the attribute is expected to be attached |
[in] | name | Attribute name |
H5LTfind_attribute() determines whether an attribute named name
exists attached to the object specified by loc_id
.
loc_id
must be an object identifier and name
must specify an attribute that is expected to be attached to that object.
Determines whether a dataset exists.
[in] | loc_id | Identifier of the group containing the dataset |
[in] | name | Dataset name |
H5LTfind_dataset() determines whether a dataset named name
exists in the group specified by loc_id
.
loc_id
must be a group identifier and name
must specify a dataset that is a member of that group.
H5_HLDLL herr_t H5LTget_attribute | ( | hid_t | loc_id, |
const char * | obj_name, | ||
const char * | attr_name, | ||
hid_t | mem_type_id, | ||
void * | data | ||
) |
Reads an attribute from disk.
[in] | loc_id | Identifier of the object (dataset or group) to read the attribute from |
[in] | obj_name | The name of the object that the attribute is attached to |
[in] | attr_name | The attribute name |
[in] | mem_type_id | Identifier of the memory datatype |
[out] | data | Buffer with data |
H5LTget_attribute() reads an attribute named attr_name
with the memory type mem_type_id
.
H5_HLDLL herr_t H5LTget_attribute_char | ( | hid_t | loc_id, |
const char * | obj_name, | ||
const char * | attr_name, | ||
char * | data | ||
) |
Reads an attribute from disk.
[in] | loc_id | Identifier of the object (dataset or group) to read the attribute from |
[in] | obj_name | The name of the object that the attribute is attached to |
[in] | attr_name | The attribute name |
[out] | data | Buffer with data |
H5LTget_attribute_char() reads an attribute named attr_name
that is attached to the object specified by the name obj_name
. The datatype of the attribute is H5T_NATIVE_CHAR.
H5_HLDLL herr_t H5LTget_attribute_double | ( | hid_t | loc_id, |
const char * | obj_name, | ||
const char * | attr_name, | ||
double * | data | ||
) |
Reads an attribute from disk.
[in] | loc_id | Identifier of the object (dataset or group) to read the attribute from |
[in] | obj_name | The name of the object that the attribute is attached to |
[in] | attr_name | The attribute name |
[out] | data | Buffer with data |
H5LTget_attribute_double() reads an attribute named attr_name
that is attached to the object specified by the name obj_name
. The HDF5 datatype of the attribute is H5T_NATIVE_DOUBLE.
H5_HLDLL herr_t H5LTget_attribute_float | ( | hid_t | loc_id, |
const char * | obj_name, | ||
const char * | attr_name, | ||
float * | data | ||
) |
Reads an attribute from disk.
[in] | loc_id | Identifier of the object (dataset or group) to read the attribute from |
[in] | obj_name | The name of the object that the attribute is attached to |
[in] | attr_name | The attribute name |
[out] | data | Buffer with data |
H5LTget_attribute_float() reads an attribute named attr_name
that is attached to the object specified by the name obj_name
. The HDF5 datatype of the attribute is H5T_NATIVE_FLOAT.
H5_HLDLL herr_t H5LTget_attribute_info | ( | hid_t | loc_id, |
const char * | obj_name, | ||
const char * | attr_name, | ||
hsize_t * | dims, | ||
H5T_class_t * | type_class, | ||
size_t * | type_size | ||
) |
Gets information about an attribute.
[in] | loc_id | Identifier of the object (dataset or group) to read the attribute from |
[in] | obj_name | The name of the object that the attribute is attached to |
[in] | attr_name | The attribute name |
[out] | dims | The dimensions of the attribute |
[out] | type_class | The class identifier. H5T_class_t is defined in H5Tpublic.h. For a list of valid class types see: H5Tget_class(). |
[out] | type_size | The size of the datatype in bytes |
H5LTget_attribute_info() gets information about an attribute named attr_name
attached to the object specified by the name obj_name
.
H5_HLDLL herr_t H5LTget_attribute_int | ( | hid_t | loc_id, |
const char * | obj_name, | ||
const char * | attr_name, | ||
int * | data | ||
) |
Reads an attribute from disk.
[in] | loc_id | Identifier of the object (dataset or group) to read the attribute from |
[in] | obj_name | The name of the object that the attribute is attached to |
[in] | attr_name | The attribute name |
[out] | data | Buffer with data |
H5LTget_attribute_int() reads an attribute named attr_name
that is attached to the object specified by the name obj_name
. The HDF5 datatype of the attribute is H5T_NATIVE_INT.
H5_HLDLL herr_t H5LTget_attribute_long | ( | hid_t | loc_id, |
const char * | obj_name, | ||
const char * | attr_name, | ||
long * | data | ||
) |
Reads an attribute from disk.
[in] | loc_id | Identifier of the object (dataset or group) to read the attribute from |
[in] | obj_name | The name of the object that the attribute is attached to |
[in] | attr_name | The attribute name |
[out] | data | Buffer with data |
H5LTget_attribute_long() reads an attribute named attr_name
that is attached to the object specified by the name obj_name
. The HDF5 datatype of the attribute is H5T_NATIVE_LONG.
H5_HLDLL herr_t H5LTget_attribute_long_long | ( | hid_t | loc_id, |
const char * | obj_name, | ||
const char * | attr_name, | ||
long long * | data | ||
) |
Reads a long long attribute.
[in] | loc_id | Location of the object to which the attribute is attached |
[in] | obj_name | That object's name |
[in] | attr_name | Attribute name |
[out] | data | Attribute value |
H5LTget_attribute_long_long() reads the attribute specified by loc_id
and obj_name
.
H5_HLDLL herr_t H5LTget_attribute_ndims | ( | hid_t | loc_id, |
const char * | obj_name, | ||
const char * | attr_name, | ||
int * | rank | ||
) |
Gets the dimensionality of an attribute.
[in] | loc_id | Identifier of the object (dataset or group) to read the attribute from |
[in] | obj_name | The name of the object that the attribute is attached to |
[in] | attr_name | The attribute name |
[out] | rank | The dimensionality of the attribute |
H5LTget_attribute_ndims() gets the dimensionality of an attribute named attr_name
that is attached to the object specified by the name obj_name
.
H5_HLDLL herr_t H5LTget_attribute_short | ( | hid_t | loc_id, |
const char * | obj_name, | ||
const char * | attr_name, | ||
short * | data | ||
) |
Reads an attribute from disk.
[in] | loc_id | Identifier of the object (dataset or group) to read the attribute from |
[in] | obj_name | The name of the object that the attribute is attached to |
[in] | attr_name | The attribute name |
[out] | data | Buffer with data |
H5LTget_attribute_short() reads an attribute named attr_name
that is attached to the object specified by the name obj_name
. The HDF5 datatype of the attribute is H5T_NATIVE_SHORT
H5_HLDLL herr_t H5LTget_attribute_string | ( | hid_t | loc_id, |
const char * | obj_name, | ||
const char * | attr_name, | ||
char * | data | ||
) |
Reads an attribute from disk.
[in] | loc_id | Identifier of the object (dataset or group) to read the attribute from |
[in] | obj_name | The name of the object that the attribute is attached to |
[in] | attr_name | The attribute name |
[out] | data | Buffer with data |
H5LTget_attribute_string() reads an attribute named attr_name
that is attached to the object specified by the name obj_name
. The datatype is a string.
H5_HLDLL herr_t H5LTget_attribute_uchar | ( | hid_t | loc_id, |
const char * | obj_name, | ||
const char * | attr_name, | ||
unsigned char * | data | ||
) |
Reads an attribute from disk.
[in] | loc_id | Identifier of the object (dataset or group) to read the attribute from |
[in] | obj_name | The name of the object that the attribute is attached to |
[in] | attr_name | The attribute name |
[out] | data | Buffer with data |
H5LTget_attribute_uchar() reads an attribute named attr_name
that is attached to the object specified by the name obj_name
. The HDF5 datatype of the attribute is H5T_NATIVE_UCHAR
H5_HLDLL herr_t H5LTget_attribute_uint | ( | hid_t | loc_id, |
const char * | obj_name, | ||
const char * | attr_name, | ||
unsigned int * | data | ||
) |
Reads an attribute from disk.
[in] | loc_id | Identifier of the object (dataset or group) to read the attribute from |
[in] | obj_name | The name of the object that the attribute is attached to |
[in] | attr_name | The attribute name |
[out] | data | Buffer with data |
H5LTget_attribute_uint() reads an attribute named attr_name
that is attached to the object specified by the name obj_name
. The HDF5 datatype of the attribute is H5T_NATIVE_INT.
H5_HLDLL herr_t H5LTget_attribute_ullong | ( | hid_t | loc_id, |
const char * | obj_name, | ||
const char * | attr_name, | ||
unsigned long long * | data | ||
) |
Reads an attribute from disk.
[in] | loc_id | Identifier of the object (dataset or group) to read the attribute from |
[in] | obj_name | The name of the object that the attribute is attached to |
[in] | attr_name | The attribute name |
[out] | data | Buffer with data |
H5LTget_attribute_ullong() reads an attribute named attr_name
that is attached to the object specified by the name obj_name
. The HDF5 datatype of the attribute is H5T_NATIVE_ULLONG.
H5_HLDLL herr_t H5LTget_attribute_ulong | ( | hid_t | loc_id, |
const char * | obj_name, | ||
const char * | attr_name, | ||
unsigned long * | data | ||
) |
Reads an attribute from disk.
[in] | loc_id | Identifier of the object (dataset or group) to read the attribute from |
[in] | obj_name | The name of the object that the attribute is attached to |
[in] | attr_name | The attribute name |
[out] | data | Buffer with data |
H5LTget_attribute_ulong() reads an attribute named attr_name
that is attached to the object specified by the name obj_name
. The HDF5 datatype of the attribute is H5T_NATIVE_ULONG.
H5_HLDLL herr_t H5LTget_attribute_ushort | ( | hid_t | loc_id, |
const char * | obj_name, | ||
const char * | attr_name, | ||
unsigned short * | data | ||
) |
Reads an attribute from disk.
[in] | loc_id | Identifier of the object (dataset or group) to read the attribute from |
[in] | obj_name | The name of the object that the attribute is attached to |
[in] | attr_name | The attribute name |
[out] | data | Buffer with data |
H5LTget_attribute_ushort() reads an attribute named attr_name
that is attached to the object specified by the name obj_name
. The HDF5 datatype of the attribute is H5T_NATIVE_USHORT.
H5_HLDLL herr_t H5LTget_dataset_info | ( | hid_t | loc_id, |
const char * | dset_name, | ||
hsize_t * | dims, | ||
H5T_class_t * | type_class, | ||
size_t * | type_size | ||
) |
Retrieves information about a dataset.
[in] | loc_id | Identifier of the object to locate the dataset within |
[in] | dset_name | The dataset name |
[out] | dims | The dimensions of the dataset |
[out] | type_class | The class identifier. H5T_class_t is defined in H5Tpublic.h. See H5Tget_class() for a list of class types. |
[out] | type_size | The size of the datatype in bytes |
H5LTget_dataset_info() retrieves information about a dataset named dset_name
attached to the object loc_id
.
Gets the dimensionality of a dataset.
[in] | loc_id | Identifier of the object to locate the dataset within |
[in] | dset_name | The dataset name |
[out] | rank | The dimensionality of the dataset |
H5LTget_dataset_ndims() gets the dimensionality of a dataset named dset_name
exists attached to the object loc_id
.
H5_HLDLL herr_t H5LTmake_dataset | ( | hid_t | loc_id, |
const char * | dset_name, | ||
int | rank, | ||
const hsize_t * | dims, | ||
hid_t | type_id, | ||
const void * | buffer | ||
) |
Creates and writes a dataset of a type type_id
.
[in] | loc_id | Location identifier. The identifier may be that of a file or group. |
[in] | dset_name | The Name of the dataset to create |
[in] | rank | Number of dimensions of dataspace |
[in] | dims | An array of the size of each dimension |
[in] | type_id | Identifier of the datatype to use when creating the dataset |
[in] | buffer | Buffer with data to be written to the dataset |
H5LTmake_dataset() creates and writes a dataset named dset_name
attached to the object specified by the identifier loc_id
.
The parameter type_id
can be any valid HDF5 Prdefined Native Datatypes; For example, setting type_id
to H5T_NATIVE_INT will result in a dataset of signed integer datatype.
H5_HLDLL herr_t H5LTmake_dataset_char | ( | hid_t | loc_id, |
const char * | dset_name, | ||
int | rank, | ||
const hsize_t * | dims, | ||
const char * | buffer | ||
) |
Creates and writes a dataset.
[in] | loc_id | Location identifier. The identifier may be that of a file or group. |
[in] | dset_name | The Name of the dataset to create |
[in] | rank | Number of dimensions of dataspace |
[in] | dims | An array of the size of each dimension |
[in] | buffer | Buffer with data to be written to the dataset |
H5LTmake_dataset_char() creates and writes a dataset named dset_name
attached to the object specified by the identifier loc_id
.
The dataset's datatype will be character, H5T_NATIVE_CHAR.
H5_HLDLL herr_t H5LTmake_dataset_double | ( | hid_t | loc_id, |
const char * | dset_name, | ||
int | rank, | ||
const hsize_t * | dims, | ||
const double * | buffer | ||
) |
Creates and writes a dataset.
[in] | loc_id | Location identifier. The identifier may be that of a file or group. |
[in] | dset_name | The Name of the dataset to create |
[in] | rank | Number of dimensions of dataspace |
[in] | dims | An array of the size of each dimension |
[in] | buffer | Buffer with data to be written to the dataset |
H5LTmake_dataset_double() creates and writes a dataset named dset_name
attached to the object specified by the identifier loc_id
.
The dataset's datatype will be native floating-point double, H5T_NATIVE_DOUBLE.
H5_HLDLL herr_t H5LTmake_dataset_float | ( | hid_t | loc_id, |
const char * | dset_name, | ||
int | rank, | ||
const hsize_t * | dims, | ||
const float * | buffer | ||
) |
Creates and writes a dataset.
[in] | loc_id | Location identifier. The identifier may be that of a file or group. |
[in] | dset_name | The Name of the dataset to create |
[in] | rank | Number of dimensions of dataspace |
[in] | dims | An array of the size of each dimension |
[in] | buffer | Buffer with data to be written to the dataset |
H5LTmake_dataset_float() creates and writes a dataset named dset_name
attached to the object specified by the identifier loc_id
.
The dataset's datatype will be native floating point, H5T_NATIVE_FLOAT.
H5_HLDLL herr_t H5LTmake_dataset_int | ( | hid_t | loc_id, |
const char * | dset_name, | ||
int | rank, | ||
const hsize_t * | dims, | ||
const int * | buffer | ||
) |
Creates and writes a dataset.
[in] | loc_id | Location identifier. The identifier may be that of a file or group. |
[in] | dset_name | The Name of the dataset to create |
[in] | rank | Number of dimensions of dataspace |
[in] | dims | An array of the size of each dimension |
[in] | buffer | Buffer with data to be written to the dataset |
H5LTmake_dataset_int() creates and writes a dataset named dset_name
attached to the object specified by the identifier loc_id
.
The dataset's datatype will be native signed integer, H5T_NATIVE_INT.
H5_HLDLL herr_t H5LTmake_dataset_long | ( | hid_t | loc_id, |
const char * | dset_name, | ||
int | rank, | ||
const hsize_t * | dims, | ||
const long * | buffer | ||
) |
Creates and writes a dataset.
[in] | loc_id | Location identifier. The identifier may be that of a file or group. |
[in] | dset_name | The Name of the dataset to create |
[in] | rank | Number of dimensions of dataspace |
[in] | dims | An array of the size of each dimension |
[in] | buffer | Buffer with data to be written to the dataset |
H5LTmake_dataset_long() creates and writes a dataset named dset_name
attached to the object specified by the identifier loc_id
.
The dataset's datatype will be long signed integer, H5T_NATIVE_LONG.
H5_HLDLL herr_t H5LTmake_dataset_short | ( | hid_t | loc_id, |
const char * | dset_name, | ||
int | rank, | ||
const hsize_t * | dims, | ||
const short * | buffer | ||
) |
Creates and writes a dataset.
[in] | loc_id | Location identifier. The identifier may be that of a file or group. |
[in] | dset_name | The Name of the dataset to create |
[in] | rank | Number of dimensions of dataspace |
[in] | dims | An array of the size of each dimension |
[in] | buffer | Buffer with data to be written to the dataset |
H5LTmake_dataset_short() creates and writes a dataset named dset_name
attached to the object specified by the identifier loc_id
.
The dataset's datatype will be short signed integer, H5T_NATIVE_SHORT.
Creates and writes a dataset with string datatype.
[in] | loc_id | Location identifier. The identifier may be that of a file or group. |
[in] | dset_name | The name of the dataset to create |
[in] | buf | Buffer with data to be written to the dataset |
H5LTmake_dataset_string() creates and writes a dataset named dset_name
attached to the object specified by the identifier loc_id
.
The dataset's datatype will be C string, H5T_C_S1.
H5_HLDLL hid_t H5LTopen_file_image | ( | void * | buf_ptr, |
size_t | buf_size, | ||
unsigned | flags | ||
) |
Opens an HDF5 file image in memory.
[in] | buf_ptr | A pointer to the supplied initial image |
[in] | buf_size | Size of the supplied buffer |
[in] | flags | Flags specifying whether to open the image read-only or read/write, whether HDF5 is to take control of the buffer, and instruction regarding releasing the buffer. |
buf_ptr
is NULL or buf_size
equals 0 (zero).H5LTopen_file_image() opens the HDF5 file image that is located in system memory at the address indicated by buf_ptr
of size buf_size
. H5LTopen_file_image() opens a file image with the Core driver, H5FD_CORE.
A value of NULL for buf_ptr
is invalid and will cause the function to fail.
A value of 0 for buf_size
is invalid and will cause the function to fail.
The flags passed in flags
specify whether to open the image read-only or read/write, whether HDF5 is to take control of the buffer, and instruction regarding releasing the buffer. Valid values are:
Determines whether an HDF5 path is valid and, optionally, whether the path resolves to an HDF5 object.
[in] | loc_id | Identifier of an object in the file |
[in] | path | The path to the object to check; links in path may be of any type. |
[in] | check_object_valid | If TRUE, determine whether the final component of path resolves to an object; if FALSE, do not check. |
check_object_valid
is set to FALSE:
TRUE
if the path is valid; otherwise returns FALSE
. check_object_valid
is set to TRUE:
TRUE
if the path is valid and resolves to an HDF5 object; otherwise returns FALSE
.H5LTpath_valid() checks the validity of path
relative to the identifier of an object, loc_id
. Optionally, check_object_valid
can be set to determine whether the final component of path
resolves to an HDF5 object; if not, the final component is a dangling link.
The meaning of the function's return value depends on the value of check_object_valid:
If check_object_valid
is set to FALSE
, H5LTpath_valid() will check all links in path
to verify that they exist. If all the links in path
exist, the function will return TRUE
; otherwise the function will return FALSE
.
If check_object_valid
is set to TRUE
, H5LTpath_valid() will first check the links in path
, as described above. If all the links exist, check_object_valid
will then determine whether the final component of path
resolves to an actual HDF5 object. H5LTpath_valid() will return TRUE
if all the links in path
exist and the final component resolves to an actual object; otherwise, it will return FALSE
.
path
can be any one of the following:
/
) indicating the file's root group, followed by the membersloc_id
.), if loc_id
is the object identifier for the object itself.If path
is an absolute path, then loc_id
can be an identifier for any object in the file as it is used only to identify the file. If path
is a relative path, then loc_id
must be a file or a group identifier.
loc_id
denote a valid HDF5 file identifier, and let check_object_valid
be set to true or false. A call to H5LTpath_valid() with arguments loc_id
, “/”, and check_object_valid
returns a positive value; in other words, H5LTpath_valid(loc_id, "/", check_object_valid) returns a positive value. In HDF5 version 1.8.16, this function returns 0.check_object_valid
be set to true or false. A call to H5LTpath_valid() with arguments ‘root’, “/”, and check_object_valid
returns a positive value; in other words, H5LTpath_valid(root, "/", check_object_valid) returns a positive value. In HDF5 version 1.8.16, this function returns 0.H5_HLDLL herr_t H5LTread_dataset | ( | hid_t | loc_id, |
const char * | dset_name, | ||
hid_t | type_id, | ||
void * | buffer | ||
) |
Reads a dataset from disk.
[in] | loc_id | Location identifier. The identifier may be that of a file or group. |
[in] | dset_name | The name of the dataset to read |
[in] | type_id | Identifier of the datatype to use when reading the dataset |
[out] | buffer | Buffer with data |
H5LTread_dataset() reads a dataset named dset_name
attached to the object specified by the identifier loc_id
.
Reads a dataset from disk.
[in] | loc_id | Location identifier. The identifier may be that of a file or group. |
[in] | dset_name | The name of the dataset to read |
[out] | buffer | Buffer with data |
H5LTread_dataset_char() reads a dataset named dset_name
attached to the object specified by the identifier loc_id
. The HDF5 datatype is H5T_NATIVE_CHAR.
Reads a dataset from disk.
[in] | loc_id | Location identifier. The identifier may be that of a file or group. |
[in] | dset_name | The name of the dataset to read |
[out] | buffer | Buffer with data |
H5LTread_dataset_double() reads a dataset named dset_name
attached to the object specified by the identifier loc_id
. The HDF5 datatype is H5T_NATIVE_DOUBLE.
Reads a dataset from disk.
[in] | loc_id | Location identifier. The identifier may be that of a file or group. |
[in] | dset_name | The name of the dataset to read |
[out] | buffer | Buffer with data |
H5LTread_dataset_float() reads a dataset named dset_name
attached to the object specified by the identifier loc_id
. The HDF5 datatype is H5T_NATIVE_FLOAT.
Reads a dataset from disk.
[in] | loc_id | Location identifier. The identifier may be that of a file or group. |
[in] | dset_name | The name of the dataset to read |
[out] | buffer | Buffer with data |
H5LTread_dataset_int() reads a dataset named dset_name
attached to the object specified by the identifier loc_id
. The HDF5 datatype is H5T_NATIVE_INT.
Reads a dataset from disk.
[in] | loc_id | Location identifier. The identifier may be that of a file or group. |
[in] | dset_name | The name of the dataset to read |
[out] | buffer | Buffer with data |
H5LTread_dataset_long() reads a dataset named dset_name
attached to the object specified by the identifier loc_id
. The HDF5 datatype is H5T_NATIVE_LONG.
Reads a dataset from disk.
[in] | loc_id | Location identifier. The identifier may be that of a file or group. |
[in] | dset_name | The name of the dataset to read |
[out] | buffer | Buffer with data |
H5LTread_dataset_short() reads a dataset named dset_name
attached to the object specified by the identifier loc_id
. The HDF5 datatype is H5T_NATIVE_SHORT.
Reads a dataset from disk.
[in] | loc_id | Location identifier. The identifier may be that of a file or group. |
[in] | dset_name | The name of the dataset to read |
[out] | buf | Buffer with data |
H5LTread_dataset_string() reads a dataset named dset_name
attached to the object specified by the identifier loc_id
. The HDF5 datatype is H5T_C_S1.
H5_HLDLL herr_t H5LTset_attribute_char | ( | hid_t | loc_id, |
const char * | obj_name, | ||
const char * | attr_name, | ||
const char * | buffer, | ||
size_t | size | ||
) |
Creates and writes an attribute.
[in] | loc_id | Identifier of the object (dataset or group) to create the attribute within |
[in] | obj_name | The name of the object to attach the attribute |
[in] | attr_name | The attribute name |
[in] | buffer | Buffer with data to be written to the attribute |
[in] | size | The size of the 1D array (one in the case of a scalar attribute). This value is used by H5Screate_simple() to create the dataspace. |
H5LTset_attribute_char() creates and writes a numerical attribute named attr_name
and attaches it to the object specified by the name obj_name
. The attribute has a dimensionality of 1. The HDF5 datatype of the attribute is H5T_NATIVE_CHAR.
H5_HLDLL herr_t H5LTset_attribute_double | ( | hid_t | loc_id, |
const char * | obj_name, | ||
const char * | attr_name, | ||
const double * | buffer, | ||
size_t | size | ||
) |
Creates and writes an attribute.
[in] | loc_id | Identifier of the object (dataset or group) to create the attribute within |
[in] | obj_name | The name of the object to attach the attribute |
[in] | attr_name | The attribute name |
[in] | buffer | Buffer with data to be written to the attribute |
[in] | size | The size of the 1D array (one in the case of a scalar attribute). This value is used by H5Screate_simple() to create the dataspace. |
H5LTset_attribute_double() creates and writes a numerical attribute named attr_name
and attaches it to the object specified by the name obj_name
. The attribute has a dimensionality of 1. The HDF5 datatype of the attribute is H5T_NATIVE_DOUBLE.
H5_HLDLL herr_t H5LTset_attribute_float | ( | hid_t | loc_id, |
const char * | obj_name, | ||
const char * | attr_name, | ||
const float * | buffer, | ||
size_t | size | ||
) |
Creates and writes an attribute.
[in] | loc_id | Identifier of the object (dataset or group) to create the attribute within |
[in] | obj_name | The name of the object to attach the attribute |
[in] | attr_name | The attribute name |
[in] | buffer | Buffer with data to be written to the attribute |
[in] | size | The size of the 1D array (one in the case of a scalar attribute). This value is used by H5Screate_simple() to create the dataspace. |
H5LTset_attribute_float() creates and writes a numerical floating point attribute named attr_name
and attaches it to the object specified by the name obj_name
. The attribute has a dimensionality of 1. The HDF5 datatype of the attribute is H5T_NATIVE_FLOAT.
H5_HLDLL herr_t H5LTset_attribute_int | ( | hid_t | loc_id, |
const char * | obj_name, | ||
const char * | attr_name, | ||
const int * | buffer, | ||
size_t | size | ||
) |
Creates and writes an attribute.
[in] | loc_id | Identifier of the object (dataset or group) to create the attribute within |
[in] | obj_name | The name of the object to attach the attribute |
[in] | attr_name | The attribute name |
[in] | buffer | Buffer with data to be written to the attribute |
[in] | size | The size of the 1D array (one in the case of a scalar attribute). This value is used by H5Screate_simple() to create the dataspace. |
H5LTset_attribute_int() creates and writes a numerical integer attribute named attr_name
and attaches it to the object specified by the name obj_name
. The attribute has a dimensionality of 1. The HDF5 datatype of the attribute is H5T_NATIVE_INT.
H5_HLDLL herr_t H5LTset_attribute_long | ( | hid_t | loc_id, |
const char * | obj_name, | ||
const char * | attr_name, | ||
const long * | buffer, | ||
size_t | size | ||
) |
Creates and writes an attribute.
[in] | loc_id | Identifier of the object (dataset or group) to create the attribute within |
[in] | obj_name | The name of the object to attach the attribute |
[in] | attr_name | The attribute name |
[in] | buffer | Buffer with data to be written to the attribute |
[in] | size | The size of the 1D array (one in the case of a scalar attribute). This value is used by H5Screate_simple() to create the dataspace. |
H5LTset_attribute_long() creates and writes a numerical attribute named attr_name
and attaches it to the object specified by the name obj_name
. The attribute has a dimensionality of 1. The HDF5 datatype of the attribute is H5T_NATIVE_LONG.
H5_HLDLL herr_t H5LTset_attribute_long_long | ( | hid_t | loc_id, |
const char * | obj_name, | ||
const char * | attr_name, | ||
const long long * | buffer, | ||
size_t | size | ||
) |
Creates and writes an attribute.
[in] | loc_id | Location of the object to which the attribute is to be attached |
[in] | obj_name | That object's name |
[in] | attr_name | Attribute name |
[in] | buffer | Attribute value |
[in] | size | Attribute size |
H5LTset_attribute_long_long() creates and writes a numerical attribute named attr_name
and attaches it to the object specified by the name obj_name
.
The attribute has a dimensionality of 1 and its HDF5 datatype is H5T_NATIVE_LLONG.
H5_HLDLL herr_t H5LTset_attribute_short | ( | hid_t | loc_id, |
const char * | obj_name, | ||
const char * | attr_name, | ||
const short * | buffer, | ||
size_t | size | ||
) |
Creates and writes an attribute.
[in] | loc_id | Identifier of the object (dataset or group) to create the attribute within |
[in] | obj_name | The name of the object to attach the attribute |
[in] | attr_name | The attribute name |
[in] | buffer | Buffer with data to be written to the attribute |
[in] | size | The size of the 1D array (one in the case of a scalar attribute). This value is used by H5Screate_simple() to create the dataspace. |
H5LTset_attribute_short() creates and writes a numerical attribute named attr_name
and attaches it to the object specified by the name obj_name
. The attribute has a dimensionality of 1. The HDF5 datatype of the attribute is H5T_NATIVE_SHORT.
H5_HLDLL herr_t H5LTset_attribute_string | ( | hid_t | loc_id, |
const char * | obj_name, | ||
const char * | attr_name, | ||
const char * | attr_data | ||
) |
Creates and writes a string attribute.
[in] | loc_id | Identifier of the object (dataset or group) to create the attribute within |
[in] | obj_name | The name of the object to attach the attribute |
[in] | attr_name | The attribute name |
[in] | attr_data | Buffer with data to be written to the attribute |
H5LTset_attribute_string() creates and writes a string attribute named attr_name
and attaches it to the object specified by the name obj_name
. If the attribute already exists, it is overwritten.
H5_HLDLL herr_t H5LTset_attribute_uchar | ( | hid_t | loc_id, |
const char * | obj_name, | ||
const char * | attr_name, | ||
const unsigned char * | buffer, | ||
size_t | size | ||
) |
Creates and writes an attribute.
[in] | loc_id | Identifier of the object (dataset or group) to create the attribute within |
[in] | obj_name | The name of the object to attach the attribute |
[in] | attr_name | The attribute name |
[in] | buffer | Buffer with data to be written to the attribute |
[in] | size | The size of the 1D array (one in the case of a scalar attribute). This value is used by H5Screate_simple() to create the dataspace. |
H5LTset_attribute_uchar() creates and writes a numerical attribute named attr_name
and attaches it to the object specified by the name obj_name
. The attribute has a dimensionality of 1. The HDF5 datatype of the attribute is H5T_NATIVE_UCHAR.
H5_HLDLL herr_t H5LTset_attribute_uint | ( | hid_t | loc_id, |
const char * | obj_name, | ||
const char * | attr_name, | ||
const unsigned int * | buffer, | ||
size_t | size | ||
) |
Creates and writes an attribute.
[in] | loc_id | Identifier of the object (dataset or group) to create the attribute within |
[in] | obj_name | The name of the object to attach the attribute |
[in] | attr_name | The attribute name |
[in] | buffer | Buffer with data to be written to the attribute |
[in] | size | The size of the 1D array (one in the case of a scalar attribute). This value is used by H5Screate_simple() to create the dataspace. |
H5LTset_attribute_uint() creates and writes a numerical integer attribute named attr_name
and attaches it to the object specified by the name obj_name
. The attribute has a dimensionality of 1. The HDF5 datatype of the attribute is H5T_NATIVE_UINT.
H5_HLDLL herr_t H5LTset_attribute_ullong | ( | hid_t | loc_id, |
const char * | obj_name, | ||
const char * | attr_name, | ||
const unsigned long long * | buffer, | ||
size_t | size | ||
) |
Creates and writes an attribute.
[in] | loc_id | Location of the object to which the attribute is to be attached |
[in] | obj_name | That object's name |
[in] | attr_name | Attribute name |
[in] | buffer | Attribute value |
[in] | size | Attribute size |
H5LTset_attribute_ullong() creates and writes a numerical attribute named attr_name
and attaches it to the object specified by the name obj_name
.
The attribute has a dimensionality of 1 and its HDF5 datatype is H5T_NATIVE_ULLONG.
H5_HLDLL herr_t H5LTset_attribute_ulong | ( | hid_t | loc_id, |
const char * | obj_name, | ||
const char * | attr_name, | ||
const unsigned long * | buffer, | ||
size_t | size | ||
) |
Creates and writes an attribute.
[in] | loc_id | Identifier of the object (dataset or group) to create the attribute within |
[in] | obj_name | The name of the object to attach the attribute |
[in] | attr_name | The attribute name |
[in] | buffer | Buffer with data to be written to the attribute |
[in] | size | The size of the 1D array (one in the case of a scalar attribute). This value is used by H5Screate_simple() to create the dataspace. |
H5LTset_attribute_ulong() creates and writes a numerical attribute named attr_name
and attaches it to the object specified by the name obj_name
. The attribute has a dimensionality of 1. The HDF5 datatype of the attribute is H5T_NATIVE_ULONG.
H5_HLDLL herr_t H5LTset_attribute_ushort | ( | hid_t | loc_id, |
const char * | obj_name, | ||
const char * | attr_name, | ||
const unsigned short * | buffer, | ||
size_t | size | ||
) |
Creates and writes an attribute.
[in] | loc_id | Identifier of the object (dataset or group) to create the attribute within |
[in] | obj_name | The name of the object to attach the attribute |
[in] | attr_name | The attribute name |
[in] | buffer | Buffer with data to be written to the attribute |
[in] | size | The size of the 1D array (one in the case of a scalar attribute). This value is used by H5Screate_simple() to create the dataspace. |
H5LTset_attribute_ushort() creates and writes a numerical attribute named attr_name
and attaches it to the object specified by the name obj_name
. The attribute has a dimensionality of 1. The HDF5 datatype of the attribute is H5T_NATIVE_USHORT.
H5_HLDLL hid_t H5LTtext_to_dtype | ( | const char * | text, |
H5LT_lang_t | lang_type | ||
) |
Creates an HDF5 datatype given a text description.
[in] | text | A character string containing a DDL definition of the datatype to be created |
[in] | lang_type | The language used to describe the datatype. The only currently supported language is H5LT_DDL. |
Given a text description of a datatype, this function creates an HDF5 datatype and returns the datatype identifier. The text description of the datatype has to comply with the lang_type
definition of HDF5 datatypes. Currently, only the DDL(H5LT_DDL) is supported. The complete DDL definition of HDF5 datatypes can be found in the last chapter of the HDF5 User's Guide.
enum
type is shown as follows.