HDF5  1.13.0
Dataset Transfer Properties

Functions

ssize_t H5Pget_data_transform (hid_t plist_id, char *expression, size_t size)
 Retrieves a data transform expression. More...
 
herr_t H5Pset_data_transform (hid_t plist_id, const char *expression)
 Sets a data transform expression. More...
 

Detailed Description

Function Documentation

◆ H5Pget_data_transform()

ssize_t H5Pget_data_transform ( hid_t  plist_id,
char *  expression,
size_t  size 
)

Retrieves a data transform expression.


Parameters
[in]plist_idIdentifier of the property list or class
[out]expressionPointer to memory where the transform expression will be copied
[in]sizeNumber of bytes of the transform expression to copy to
Returns
Returns the size of the transform expression if successful; otherwise returns a negative value.

H5Pget_data_transform() retrieves the data transform expression previously set in the dataset transfer property list plist_id by H5Pset_data_transform().

H5Pget_data_transform() can be used to both retrieve the transform expression and to query its size.

If expression is non-NULL, up to size bytes of the data transform expression are written to the buffer. If expression is NULL, size is ignored and the function does not write anything to the buffer. The function always returns the size of the data transform expression.

If 0 is returned for the size of the expression, no data transform expression exists for the property list.

If an error occurs, the buffer pointed to by expression is unchanged and the function returns a negative value.

Since
1.8.0

◆ H5Pset_data_transform()

herr_t H5Pset_data_transform ( hid_t  plist_id,
const char *  expression 
)

Sets a data transform expression.


Parameters
[in]plist_idIdentifier of the property list or class
[in]expressionPointer to the null-terminated data transform expression
Returns
Returns a non-negative value if successful; otherwise returns a negative value.

H5Pset_data_transform() sets the data transform to be used for reading and writing data. This function operates on the dataset transfer property list plist_id.

The expression parameter is a string containing an algebraic expression, such as (5/9.0)*(x-32) or x*(x-5). When a dataset is read or written with this property list, the transform expression is applied with the x being replaced by the values in the dataset. When reading data, the values in the file are not changed and the transformed data is returned to the user.

Data transforms can only be applied to integer or floating-point datasets. Order of operations is obeyed and the only supported operations are +, -, *, and /. Parentheses can be nested arbitrarily and can be used to change precedence. When writing data back to the dataset, the transformed data is written to the file and there is no way to recover the original values to which the transform was applied.

Since
1.8.0