RAVE
|
Utilities for working with H5 files. More...
Go to the source code of this file.
Macros | |
#define | RAVE_ODIM_VERSION_2_0_STR "ODIM_H5/V2_0" |
ODIM Version string 2.0. | |
#define | RAVE_ODIM_VERSION_2_1_STR "ODIM_H5/V2_1" |
ODIM Version string 2.1. | |
#define | RAVE_ODIM_VERSION_2_2_STR "ODIM_H5/V2_2" |
ODIM Version string 2.2. | |
#define | RAVE_ODIM_VERSION_2_3_STR "ODIM_H5/V2_3" |
ODIM Version string 2.3. | |
#define | RAVE_ODIM_VERSION_2_4_STR "ODIM_H5/V2_4" |
ODIM Version string 2.4. | |
#define | RAVE_ODIM_H5RAD_VERSION_2_0_STR "H5rad 2.0" |
ODIM H5 rad version string 2.0. | |
#define | RAVE_ODIM_H5RAD_VERSION_2_1_STR "H5rad 2.1" |
ODIM H5 rad version string 2.1. | |
#define | RAVE_ODIM_H5RAD_VERSION_2_2_STR "H5rad 2.2" |
ODIM H5 rad version string 2.2. | |
#define | RAVE_ODIM_H5RAD_VERSION_2_3_STR "H5rad 2.3" |
ODIM H5 rad version string 2.3. | |
#define | RAVE_ODIM_H5RAD_VERSION_2_4_STR "H5rad 2.4" |
ODIM H5 rad version string 2.4. | |
Typedefs | |
typedef int(* | RaveHL_attr_f) (void *object, RaveAttribute_t *attr) |
Attribute function called when an attribute is found. | |
typedef int(* | RaveHL_data_f) (void *object, hsize_t xsize, hsize_t ysize, void *data, RaveDataType dtype, const char *nodeName) |
Data function called when an dataset is found. | |
typedef int(* | RaveHL_group_f) (void *object, const char *groupname, const char *name) |
Group function called when a group is found. | |
Functions | |
const char * | RaveHL_convertAttributeName (const char *name) |
Translates an attribute name from 2.0/2.1 ODIM into 2.2 ODIM. | |
const char * | RaveHL_convertQuantity (const char *name) |
Translates a quantity from 2.0/2.1 ODIM into 2.2 ODIM. | |
const char * | RaveHL_getOdimVersionString (RaveIO_ODIM_Version version) |
Returns the string representation of the specified odim version. | |
RaveIO_ODIM_Version | RaveHL_getOdimVersionFromString (const char *str) |
Returns the odim version for the string representation of the ODIM version. | |
const char * | RaveHL_getH5RadVersionStringFromOdimVersion (RaveIO_ODIM_Version version) |
Returns the h5rad string representation of the specified odim version since we can assume that the h5rad and odim version will follow each other. | |
RaveAttribute_t * | RaveHL_createAttribute (HL_Node *node) |
Creates a rave attribute from a HLHDF node value. | |
RaveAttribute_t * | RaveHL_getAttribute (HL_NodeList *nodelist, const char *fmt,...) |
Tries to find the node as defined by the varargs string and then create a rave attribute from it. | |
int | RaveHL_hasNodeByName (HL_NodeList *nodelist, const char *fmt,...) |
Verifies if the file contains a node with the name as specified by the variable argument list. | |
int | RaveHL_getStringValue (HL_NodeList *nodelist, char **value, const char *fmt,...) |
Gets a string value from a nodelist that is represented by a node named according to the varargs formatter string. | |
int | RaveHL_createGroup (HL_NodeList *nodelist, const char *fmt,...) |
Creates a group node in the node list. | |
int | RaveHL_createGroupUnlessExists (HL_NodeList *nodelist, const char *fmt,...) |
Creates a group node in the node list unless it already exists. | |
int | RaveHL_createStringValue (HL_NodeList *nodelist, const char *value, const char *fmt,...) |
Adds a string value to a nodelist. | |
int | RaveHL_addAttribute (HL_NodeList *nodelist, RaveAttribute_t *attribute, const char *fmt,...) |
Puts an attribute in the nodelist as a hlhdf node. | |
int | RaveHL_addAttributes (HL_NodeList *nodelist, RaveObjectList_t *attributes, const char *name) |
Stores the attributes from the object into the nodelist name/how/..., name/where/... and name/what/... If the groups name/how, name/where, name/what does not exist they will be created for you. | |
int | RaveHL_createDataset (HL_NodeList *nodelist, void *data, long xsize, long ysize, RaveDataType dataType, const char *fmt,...) |
Creates a dataset with the provided 2-dimensional array. | |
int | RaveHL_addData (HL_NodeList *nodelist, void *data, long xsize, long ysize, RaveDataType dataType, const char *fmt,...) |
Adds a data field to the node list according to ODIM H5. | |
HL_FormatSpecifier | RaveHL_raveToHlhdfType (RaveDataType format) |
Translates a rave data type into a hlhdf format specifier. | |
RaveDataType | RaveHL_hlhdfToRaveType (HL_FormatSpecifier format) |
Translates a hlhdf format specified into a rave data type. | |
int | RaveHL_loadAttributesAndData (HL_NodeList *nodelist, void *object, RaveHL_attr_f attrf, RaveHL_data_f dataf, const char *fmt,...) |
Loads the attributes from the nodelist name and calls the attrf and dataf respectively depending on what type is found. | |
Utilities for working with H5 files.
#define RAVE_ODIM_H5RAD_VERSION_2_0_STR "H5rad 2.0" |
ODIM H5 rad version string 2.0.
#define RAVE_ODIM_H5RAD_VERSION_2_1_STR "H5rad 2.1" |
ODIM H5 rad version string 2.1.
#define RAVE_ODIM_H5RAD_VERSION_2_2_STR "H5rad 2.2" |
ODIM H5 rad version string 2.2.
#define RAVE_ODIM_H5RAD_VERSION_2_3_STR "H5rad 2.3" |
ODIM H5 rad version string 2.3.
#define RAVE_ODIM_H5RAD_VERSION_2_4_STR "H5rad 2.4" |
ODIM H5 rad version string 2.4.
#define RAVE_ODIM_VERSION_2_0_STR "ODIM_H5/V2_0" |
ODIM Version string 2.0.
#define RAVE_ODIM_VERSION_2_1_STR "ODIM_H5/V2_1" |
ODIM Version string 2.1.
#define RAVE_ODIM_VERSION_2_2_STR "ODIM_H5/V2_2" |
ODIM Version string 2.2.
#define RAVE_ODIM_VERSION_2_3_STR "ODIM_H5/V2_3" |
ODIM Version string 2.3.
#define RAVE_ODIM_VERSION_2_4_STR "ODIM_H5/V2_4" |
ODIM Version string 2.4.
typedef int(* RaveHL_attr_f) (void *object, RaveAttribute_t *attr) |
Attribute function called when an attribute is found.
[in] | object | - the object passed on from the loading functions |
[in] | attr | - the attribute |
typedef int(* RaveHL_data_f) (void *object, hsize_t xsize, hsize_t ysize, void *data, RaveDataType dtype, const char *nodeName) |
Data function called when an dataset is found.
[in] | object | - the object passed on from the loading functions |
[in] | xsize | - the xsize |
[in] | ysize | - the ysize |
[in] | data | - the dataset data |
[in] | dtype | - the data type |
[in] | nodeName | - the name of the data type |
typedef int(* RaveHL_group_f) (void *object, const char *groupname, const char *name) |
Group function called when a group is found.
[in] | object | - the object passed on from the loading functions |
[in] | groupname | - the name of the group |
[in] | name | - the attribute name |
int RaveHL_addAttribute | ( | HL_NodeList * | nodelist, |
RaveAttribute_t * | attribute, | ||
const char * | fmt, | ||
... ) |
Puts an attribute in the nodelist as a hlhdf node.
[in] | nodelist | - the node list |
[in] | attribute | - the attribute, the name of the attribute will be used as attr-member |
[in] | fmt | - the root name, specified as a varargs |
[in] | ... | - the varargs list |
int RaveHL_addAttributes | ( | HL_NodeList * | nodelist, |
RaveObjectList_t * | attributes, | ||
const char * | name ) |
Stores the attributes from the object into the nodelist name/how/..., name/where/... and name/what/... If the groups name/how, name/where, name/what does not exist they will be created for you.
All other groups you will have to add your self.
[in] | nodelist | - the hlhdf list |
[in] | name | - the name of the object |
[in] | object | - the object to fill |
As of ODIM 2.3 we should support subgroups in how
int RaveHL_addData | ( | HL_NodeList * | nodelist, |
void * | data, | ||
long | xsize, | ||
long | ysize, | ||
RaveDataType | dataType, | ||
const char * | fmt, | ||
... ) |
Adds a data field to the node list according to ODIM H5.
If data type is UCHAR, the nessecary attributes for viewing in HdfView will also be added. The name will always be <root>/data since that is according to ODIM H5 as well.
[in] | nodelist | - the node list that should get nodes added |
[in] | data | - the array data |
[in] | xsize | - the xsize |
[in] | ysize | - the ysize |
[in] | dataType | - type of data |
[in] | fmt | - the varargs format |
[in] | ... | - the vararg list |
const char * RaveHL_convertAttributeName | ( | const char * | name | ) |
Translates an attribute name from 2.0/2.1 ODIM into 2.2 ODIM.
For example how/TXloss => how/TXlossH.
[in] | name | - name of current attribute |
const char * RaveHL_convertQuantity | ( | const char * | name | ) |
Translates a quantity from 2.0/2.1 ODIM into 2.2 ODIM.
For example VRAD => VRADH.
[in] | name | - name of current quantity |
RaveAttribute_t * RaveHL_createAttribute | ( | HL_Node * | node | ) |
Creates a rave attribute from a HLHDF node value.
Node must contain data that can be translated to long, double or strings otherwise NULL will be returned. Note, the name will not be set on the attribute and has to be set after this function has been called.
[in] | node | - the HLHDF node |
int RaveHL_createDataset | ( | HL_NodeList * | nodelist, |
void * | data, | ||
long | xsize, | ||
long | ysize, | ||
RaveDataType | dataType, | ||
const char * | fmt, | ||
... ) |
Creates a dataset with the provided 2-dimensional array.
[in] | nodelist | - the node list |
[in] | data | - the data |
[in] | xsize | - the xsize |
[in] | ysize | - the ysize |
[in] | dataType | - the type of data |
[in] | fmt | - the variable argument format |
[in] | ... | - the arguments. |
int RaveHL_createGroup | ( | HL_NodeList * | nodelist, |
const char * | fmt, | ||
... ) |
Creates a group node in the node list.
[in] | nodelist | - the node list |
[in] | fmt | - the variable argument format |
[in] | ... | - the arguments. |
int RaveHL_createGroupUnlessExists | ( | HL_NodeList * | nodelist, |
const char * | fmt, | ||
... ) |
Creates a group node in the node list unless it already exists.
[in] | nodelist | - the node list |
[in] | fmt | - the variable argument format |
[in] | ... | - the arguments. |
int RaveHL_createStringValue | ( | HL_NodeList * | nodelist, |
const char * | value, | ||
const char * | fmt, | ||
... ) |
Adds a string value to a nodelist.
[in] | nodelist | - the hlhdf node list |
[in] | value | - the string value |
[in] | fmt | - the varargs format string |
RaveAttribute_t * RaveHL_getAttribute | ( | HL_NodeList * | nodelist, |
const char * | fmt, | ||
... ) |
Tries to find the node as defined by the varargs string and then create a rave attribute from it.
[in] | nodelist | - the node list |
[in] | fmt | - the varargs format |
[in] | ... | - the varargs |
const char * RaveHL_getH5RadVersionStringFromOdimVersion | ( | RaveIO_ODIM_Version | version | ) |
Returns the h5rad string representation of the specified odim version since we can assume that the h5rad and odim version will follow each other.
[in] | version | - the ODIM version |
RaveIO_ODIM_Version RaveHL_getOdimVersionFromString | ( | const char * | str | ) |
Returns the odim version for the string representation of the ODIM version.
[in] | str | - the string representation |
const char * RaveHL_getOdimVersionString | ( | RaveIO_ODIM_Version | version | ) |
Returns the string representation of the specified odim version.
[in] | version | - the ODIM version |
int RaveHL_getStringValue | ( | HL_NodeList * | nodelist, |
char ** | value, | ||
const char * | fmt, | ||
... ) |
Gets a string value from a nodelist that is represented by a node named according to the varargs formatter string.
The returned string is pointing to internal memory in the nodelist so DO NOT FREE!!
[in] | nodelist | - the node list |
[in|out] | value - the value (Pointing to internal memory, DO NOT FREE) | |
[in] | fmt | - the varargs formatter string |
[in] | ... | - the varargs |
int RaveHL_hasNodeByName | ( | HL_NodeList * | nodelist, |
const char * | fmt, | ||
... ) |
Verifies if the file contains a node with the name as specified by the variable argument list.
[in] | nodelist | - the hlhdf nodelist |
[in] | fmt | - the variable argument format specifier |
[in] | ... | - the variable argument list |
RaveDataType RaveHL_hlhdfToRaveType | ( | HL_FormatSpecifier | format | ) |
Translates a hlhdf format specified into a rave data type.
[in] | format | - the hlhdf format specified |
int RaveHL_loadAttributesAndData | ( | HL_NodeList * | nodelist, |
void * | object, | ||
RaveHL_attr_f | attrf, | ||
RaveHL_data_f | dataf, | ||
const char * | fmt, | ||
... ) |
Loads the attributes from the nodelist name and calls the attrf and dataf respectively depending on what type is found.
E.g. name/how/..., name/where/... and name/what/...
[in] | nodelist | - the hlhdf list |
[in] | object | - the object to fill |
[in] | fmt | - the varargs name of the object |
[in] | ... | - the varargs |
Loads the attributes from the nodelist name and calls the attrf and dataf respectively depending on what type is found.
I.e. name/how/..., name/where/... and name/what/...
[in] | nodelist | - the hlhdf list |
[in] | object | - the object to fill |
[in] | fmt | - the varargs name of the object |
[in] | ... | - the varargs |
HL_FormatSpecifier RaveHL_raveToHlhdfType | ( | RaveDataType | format | ) |
Translates a rave data type into a hlhdf format specifier.
[in] | format | - the rave data type |