![]() |
HDF5
1.13.0
|
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... | |
Retrieves a data transform expression.
[in] | plist_id | Identifier of the property list or class |
[out] | expression | Pointer to memory where the transform expression will be copied |
[in] | size | Number of bytes of the transform expression to copy to |
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.
Sets a data transform expression.
[in] | plist_id | Identifier of the property list or class |
[in] | expression | Pointer to the null-terminated data transform expression |
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.