HDF5
1.14.4.3
API Reference
|
Function | Purpose |
---|---|
H5Pset_attr_creation_order/H5Pget_attr_creation_order | Sets/gets tracking and indexing of attribute creation order. |
H5Pset_attr_phase_change/H5Pget_attr_phase_change | Sets/gets attribute storage phase change thresholds |
H5Pset_filter/H5Pget_filter | Adds/gets a filter to/from the filter pipeline. |
H5Pget_filter_by_id | Returns information about a filter in a pipeline. |
H5Pget_nfilters | Returns information about the specified filter. |
H5Pset_obj_track_times/H5Pget_obj_track_times | Sets/gets the recording of times associated with an object. |
H5Pmodify_filter | Modifies a filter in the filter pipeline. |
H5Premove_filter | Delete one or more filters in the filter pipeline. |
H5Pset_fletcher32 | Sets up use of the Fletcher32 checksum filter. |
Modules | |
Dataset Creation Properties | |
Datatype Creation Properties | |
Group Creation Properties | |
Functions | |
herr_t | H5Pget_attr_creation_order (hid_t plist_id, unsigned *crt_order_flags) |
Retrieves tracking and indexing settings for attribute creation order. | |
herr_t | H5Pget_attr_phase_change (hid_t plist_id, unsigned *max_compact, unsigned *min_dense) |
Retrieves attribute storage phase change thresholds. | |
H5Z_filter_t | H5Pget_filter2 (hid_t plist_id, unsigned idx, unsigned int *flags, size_t *cd_nelmts, unsigned cd_values[], size_t namelen, char name[], unsigned *filter_config) |
Returns information about a filter in a pipeline. | |
herr_t | H5Pget_filter_by_id2 (hid_t plist_id, H5Z_filter_t filter_id, unsigned int *flags, size_t *cd_nelmts, unsigned cd_values[], size_t namelen, char name[], unsigned *filter_config) |
Returns information about the specified filter. | |
int | H5Pget_nfilters (hid_t plist_id) |
Returns the number of filters in the pipeline. | |
herr_t | H5Pget_obj_track_times (hid_t plist_id, hbool_t *track_times) |
Determines whether times associated with an object are being recorded. | |
herr_t | H5Pmodify_filter (hid_t plist_id, H5Z_filter_t filter, unsigned int flags, size_t cd_nelmts, const unsigned int cd_values[]) |
Modifies a filter in the filter pipeline. | |
herr_t | H5Premove_filter (hid_t plist_id, H5Z_filter_t filter) |
Delete one or more filters in the filter pipeline. | |
herr_t | H5Pset_attr_creation_order (hid_t plist_id, unsigned crt_order_flags) |
Sets tracking and indexing of attribute creation order. | |
herr_t | H5Pset_attr_phase_change (hid_t plist_id, unsigned max_compact, unsigned min_dense) |
Sets attribute storage phase change thresholds. | |
herr_t | H5Pset_filter (hid_t plist_id, H5Z_filter_t filter, unsigned int flags, size_t cd_nelmts, const unsigned int c_values[]) |
Adds a filter to the filter pipeline. | |
herr_t | H5Pset_fletcher32 (hid_t plist_id) |
Sets up use of the Fletcher32 checksum filter. | |
herr_t | H5Pset_obj_track_times (hid_t plist_id, hbool_t track_times) |
Sets the recording of times associated with an object. | |
Retrieves tracking and indexing settings for attribute creation order.
[in] | plist_id | Property list identifier |
[out] | crt_order_flags | Flags specifying whether to track and index attribute creation order |
H5Pget_attr_creation_order() retrieves the settings for tracking and indexing attribute creation order on an object.
plist_id
is an object creation property list (ocpl
), as it can be a dataset or group creation property list identifier. The term ocpl
is used when different types of objects may be involved.
crt_order_flags
returns flags with the following meanings:
H5P_CRT_ORDER_TRACKED | Attribute creation order is tracked but not necessarily indexed. |
H5P_CRT_ORDER_INDEXED | Attribute creation order is indexed (requires H5P_CRT_ORDER_TRACKED). |
If crt_order_flags
is returned with a value of 0 (zero), attribute creation order is neither tracked nor indexed.
Retrieves attribute storage phase change thresholds.
[in] | plist_id | Property list identifier |
[out] | max_compact | Maximum number of attributes to be stored in compact storage (Default: 8) |
[out] | min_dense | Minimum number of attributes to be stored in dense storage (Default: 6) |
H5Pget_attr_phase_change() retrieves threshold values for attribute storage on an object. These thresholds determine the point at which attribute storage changes from compact storage (i.e., storage in the object header) to dense storage (i.e., storage in a heap and indexed with a B-tree).
In the general case, attributes are initially kept in compact storage. When the number of attributes exceeds max_compact
, attribute storage switches to dense storage. If the number of attributes subsequently falls below min_dense
, the attributes are returned to compact storage.
If max_compact
is set to 0 (zero), dense storage always used.
plist_id
is an object creation property list (ocpl
), as it can be a dataset or group creation property list identifier. The term ocpl
is used when different types of objects may be involved.
H5Z_filter_t H5Pget_filter2 | ( | hid_t | plist_id, |
unsigned | idx, | ||
unsigned int * | flags, | ||
size_t * | cd_nelmts, | ||
unsigned | cd_values[], | ||
size_t | namelen, | ||
char | name[], | ||
unsigned * | filter_config | ||
) |
Returns information about a filter in a pipeline.
[in] | plist_id | Object creation property list identifier |
[in] | idx | Sequence number within the filter pipeline of the filter for which information is sought |
[out] | flags | Bit vector specifying certain general properties of the filter |
[in,out] | cd_nelmts | Number of elements in cd_values |
[out] | cd_values | Auxiliary data for the filter |
[in] | namelen | Anticipated number of characters in name |
[out] | name | Name of the filter |
[out] | filter_config | Bit field, as described in H5Zget_filter_info() |
H5Z_FILTER_SCALEOFFSET Data compression filter, employing the scale-offset algorithm
H5Pget_filter2() returns information about a filter specified by its filter number, in a filter pipeline specified by the property list with which it is associated.
plist_id
must be a dataset or group creation property list.
idx
is a value between zero and N-1, as described in H5Pget_nfilters(). The function will return a negative value if the filter number is out of range.
The structure of the flags
argument is discussed in H5Pset_filter().
On input, cd_nelmts
indicates the number of entries in the cd_values
array, as allocated by the caller; on return, cd_nelmts
contains the number of values defined by the filter.
If name
is a pointer to an array of at least namelen
bytes, the filter name will be copied into that array. The name will be null terminated if namelen
is large enough. The filter name returned will be the name appearing in the file, the name registered for the filter, or an empty string.
filter_config
is the bit field described in H5Zget_filter_info().
herr_t H5Pget_filter_by_id2 | ( | hid_t | plist_id, |
H5Z_filter_t | filter_id, | ||
unsigned int * | flags, | ||
size_t * | cd_nelmts, | ||
unsigned | cd_values[], | ||
size_t | namelen, | ||
char | name[], | ||
unsigned * | filter_config | ||
) |
Returns information about the specified filter.
[in] | plist_id | Object creation property list identifier |
[in] | filter_id | Filter identifier |
[out] | flags | Bit vector specifying certain general properties of the filter |
[in,out] | cd_nelmts | Number of elements in cd_values |
[out] | cd_values[] | Auxiliary data for the filter |
[in] | namelen | Length of filter name and number of elements in name |
[out] | name[] | Name of filter |
[out] | filter_config | Bit field, as described in H5Zget_filter_info() |
H5Pget_filter_by_id2() returns information about the filter specified in filter_id
, a filter identifier.
plist_id
must be a dataset or group creation property list and filter_id
must be in the associated filter pipeline.
The filter_id
and flags
parameters are used in the same manner as described in the discussion of H5Pset_filter().
Aside from the fact that they are used for output, the parameters cd_nelmts
and cd_values
[] are used in the same manner as described in the discussion of H5Pset_filter(). On input, the cd_nelmts
parameter indicates the number of entries in the cd_values
[] array allocated by the calling program; on exit it contains the number of values defined by the filter.
On input, the namelen
parameter indicates the number of characters allocated for the filter name by the calling program in the array name
[]. On exit name
[] contains the name of the filter with one character of the name in each element of the array.
filter_config
is the bit field described in H5Zget_filter_info().
If the filter specified in filter_id
is not set for the property list, an error will be returned and H5Pget_filter_by_id2() will fail.
int H5Pget_nfilters | ( | hid_t | plist_id | ) |
Returns the number of filters in the pipeline.
[in] | plist_id | Object creation property list identifier |
H5Pget_nfilters() returns the number of filters defined in the filter pipeline associated with the property list plist_id
.
In each pipeline, the filters are numbered from 0 through N-1
, where N
is the value returned by this function. During output to the file, the filters are applied in increasing order; during input from the file, they are applied in decreasing order.
H5Pget_nfilters() returns the number of filters in the pipeline, including zero (0) if there are none.
Determines whether times associated with an object are being recorded.
[in] | plist_id | Property list identifier |
[out] | track_times | Boolean value, 1 (true) or 0 (false), specifying whether object times are being recorded |
H5Pget_obj_track_times() queries the object creation property list, plist_id
, to determine whether object times are being recorded.
If track_times
is returned as 1, times are being recorded; if track_times
is returned as 0, times are not being recorded.
Time data can be retrieved with H5Oget_info(), which will return it in the H5O_info_t struct.
If times are not tracked, they will be reported as follows when queried: 12:00 AM UDT, Jan. 1, 1970
See H5Pset_obj_track_times() for further discussion.
herr_t H5Pmodify_filter | ( | hid_t | plist_id, |
H5Z_filter_t | filter, | ||
unsigned int | flags, | ||
size_t | cd_nelmts, | ||
const unsigned int | cd_values[] | ||
) |
Modifies a filter in the filter pipeline.
[in] | plist_id | Object creation property list identifier |
[in] | filter | Filter to be modified |
[in] | flags | Bit vector specifying certain general properties of the filter |
[in] | cd_nelmts | Number of elements in cd_values |
[in] | cd_values[] | Auxiliary data for the filter |
H5Pmodify_filter() modifies the specified filter
in the filter pipeline. plist_id
must be a dataset or group creation property list.
The filter
, flags
cd_nelmts
[], and cd_values
parameters are used in the same manner and accept the same values as described in the discussion of H5Pset_filter().
herr_t H5Premove_filter | ( | hid_t | plist_id, |
H5Z_filter_t | filter | ||
) |
Delete one or more filters in the filter pipeline.
[in] | plist_id | Object creation property list identifier |
[in] | filter | Filter to be deleted |
H5Premove_filter() removes the specified filter
from the filter pipeline in the dataset or group creation property list plist_id
.
The filter
parameter specifies the filter to be removed. Valid values for use in filter
are as follows:
H5Z_FILTER_ALL | Removes all filters from the filter pipeline |
H5Z_FILTER_DEFLATE | Data compression filter, employing the gzip algorithm |
H5Z_FILTER_SHUFFLE | Data shuffling filter |
H5Z_FILTER_FLETCHER32 | Error detection filter, employing the Fletcher32 checksum algorithm |
H5Z_FILTER_SZIP | Data compression filter, employing the SZIP algorithm |
H5Z_FILTER_NBIT | Data compression filter, employing the N-Bit algorithm |
H5Z_FILTER_SCALEOFFSET | Data compression filter, employing the scale-offset algorithm |
Additionally, user-defined filters can be removed with this routine by passing the filter identifier with which they were registered with the HDF5 library.
Attempting to remove a filter that is not in the filter pipeline is an error.
Sets tracking and indexing of attribute creation order.
[in] | plist_id | Property list identifier |
[in] | crt_order_flags | Flags specifying whether to track and index attribute creation order. Default: No flag set; attribute creation order is neither tracked not indexed |
H5Pset_attr_creation_order() sets flags for tracking and indexing attribute creation order on an object.
plist_id
is a dataset or group creation property list identifier.
crt_order_flags
contains flags with the following meanings:
H5P_CRT_ORDER_TRACKED | Attribute creation order is tracked but not necessarily indexed. |
H5P_CRT_ORDER_INDEXED | Attribute creation order is indexed (requires H5P_CRT_ORDER_TRACKED). |
Default behavior is that attribute creation order is neither tracked nor indexed.
H5Pset_attr_creation_order() can be used to set attribute creation order tracking, or to set attribute creation order tracking and indexing.
Sets attribute storage phase change thresholds.
[in] | plist_id | Property list identifier |
[in] | max_compact | Maximum number of attributes to be stored in compact storage (Default: 8); must be greater than or equal to min_dense |
[in] | min_dense | Minimum number of attributes to be stored in dense storage (Default: 6) |
H5Pset_attr_phase_change() sets threshold values for attribute storage on an object. These thresholds determine the point at which attribute storage changes from compact storage (i.e., storage in the object header) to dense storage (i.e., storage in a heap and indexed with a B-tree).
In the general case, attributes are initially kept in compact storage. When the number of attributes exceeds max_compact
, attribute storage switches to dense storage. If the number of attributes subsequently falls below min_dense
, the attributes are returned to compact storage.
If max_compact
is set to 0 (zero), dense storage is always used. min_dense
must be set to 0 (zero) when max_compact
is 0 (zero).
plist_id
is a dataset or group creation property list identifier.
herr_t H5Pset_filter | ( | hid_t | plist_id, |
H5Z_filter_t | filter, | ||
unsigned int | flags, | ||
size_t | cd_nelmts, | ||
const unsigned int | c_values[] | ||
) |
Adds a filter to the filter pipeline.
[in] | plist_id | Object creation property list identifier |
[in] | filter | Filter identifier for the filter to be added to the pipeline |
[in] | flags | Bit vector specifying certain general properties of the filter |
[in] | cd_nelmts | Number of elements in c_values |
[in] | c_values | Auxiliary data for the filter |
H5Pset_filter() adds the specified filter
identifier and corresponding properties to the end of an output filter pipeline.
plist_id
must be either a dataset creation property list or group creation property list identifier. If plist_id
is a dataset creation property list identifier, the filter is added to the raw data filter pipeline.
If plist_id
is a group creation property list identifier, the filter is added to the link filter pipeline, which filters the fractal heap used to store most of the link metadata in certain types of groups. The only predefined filters that can be set in a group creation property list are the gzip filter (H5Z_FILTER_DEFLATE) and the Fletcher32 error detection filter (H5Z_FILTER_FLETCHER32).
The array cd_values
contains cd_nelmts
unsigned integers which are auxiliary data for the filter. The values are typically used as parameters to control the filter. In a filter's set_local
method (called from H5Dcreate
), the values are interpreted and possibly modified before they are used to control the filter. These, possibly modified values, are then stored in the dataset object header as auxiliary data for the filter.
The flags
argument is a bit vector with the following fields specifying certain general properties of the filter:
H5Z_FLAG_OPTIONAL | If this bit is set then the filter is optional. If the filter fails (see below) during an H5Dwrite() operation then the filter is just excluded from the pipeline for the chunk for which it failed; the filter will not participate in the pipeline during an H5Dread() of the chunk. This is commonly used for compression filters: if the filter result would be larger than the input, then the compression filter returns failure and the uncompressed data is stored in the file. This flag should not be set for the Fletcher32 checksum filter as it will bypass the checksum filter without reporting checksum errors to an application. |
H5Z_FLAG_MANDATORY | If the filter is required, that is, set to mandatory, and the filter fails, the library's behavior depends on whether the chunk cache is in use:
For example, assume that an application creates a dataset of four chunks, the chunk cache is enabled and is big enough to hold all four chunks, and the filter fails when it tries to write the fourth chunk. The actual flush of the chunks will happen during H5Dclose(), not H5Dwrite(). By the time H5Dclose() fails, the first three chunks will have been written to the file. Even though H5Dclose() fails, all the resources will be released and the file can be closed properly. If, however, the filter fails on the second chunk, only the first chunk will be written to the file as nothing further can be written once the filter fails. |
The filter
parameter specifies the filter to be set. Valid pre-defined filter identifiers are as follows:
H5Z_FILTER_DEFLATE | Data compression filter, employing the gzip algorithm |
H5Z_FILTER_SHUFFLE | Data shuffling filter |
H5Z_FILTER_FLETCHER32 | Error detection filter, employing the Fletcher32 checksum algorithm |
H5Z_FILTER_SZIP | Data compression filter, employing the SZIP algorithm |
H5Z_FILTER_NBIT | Data compression filter, employing the N-Bit algorithm |
H5Z_FILTER_SCALEOFFSET | Data compression filter, employing the scale-offset algorithm |
Also see H5Pset_edc_check() and H5Pset_filter_callback().
Required FILTER_X not available | FILTER_X available | |
---|---|---|
H5Pset_<FILTER_X> | Will fail. | Will succeed. |
H5Dwrite with FILTER_X set | Will fail. | Will succeed; FILTER_X will be applied to the data. |
H5Dread with FILTER_X set | Will fail. | Will succeed. |
FILTER_Z not available | FILTER_Z available with encode and decode | FILTER_Z available decode only | |
---|---|---|---|
H5Pset_<FILTER_Z> | Will succeed. | Will succeed. | Will succeed. |
H5Dread with FILTER_Z set | Will succeed if FILTER_Z has not actually been applied to data. | Will succeed. | Will succeed. |
H5Dwrite with FILTER_Z set | Will succeed; FILTER_Z will not be applied to the data. | Will succeed; FILTER_Z will be applied to the data. | Will succeed; FILTER_Z will not be applied to the data. |
Sets up use of the Fletcher32 checksum filter.
[in] | plist_id | Object creation property list identifier |
H5Pset_fletcher32() sets the Fletcher32 checksum filter in the dataset or group creation property list plist_id
.
Sets the recording of times associated with an object.
[in] | plist_id | Object creation property list identifier |
[in] | track_times | Boolean value, 1 or 0, specifying whether object times are to be tracked |
H5Pset_obj_track_times() sets a property in the object creation property list, plist_id
, that governs the recording of times associated with an object.
If track_times
is set to 1, time data will be recorded. If track_times
is set to 0, time data will not be recorded.
Time data can be retrieved with H5Oget_info(), which will return it in the H5O_info_t struct.
If times are not tracked, they will be reported as follows when queried: 12:00 AM UDT, Jan. 1, 1970
That date and time are commonly used to represent the beginning of the UNIX epoch.