|
RAVE
|
Functions for performing rave related IO operations, mostly ODIM-formatted HDF5 files. More...
#include <lazy_nodelist_reader.h>#include "rave_io.h"#include "rave_debug.h"#include "rave_alloc.h"#include "rave_utilities.h"#include "rave_data2d.h"#include "hlhdf.h"#include "hlhdf_alloc.h"#include "hlhdf_debug.h"#include "string.h"#include "stdarg.h"#include "raveobject_hashtable.h"#include "raveobject_list.h"#include "polarvolume.h"#include "cartesianvolume.h"#include "rave_field.h"#include "rave_hlhdf_utilities.h"#include "cartesian_odim_io.h"#include "polar_odim_io.h"#include "vp_odim_io.h"#include "odim_io_utilities.h"Classes | |
| struct | _RaveIO_t |
| Defines the structure for the RaveIO in a volume. More... | |
Functions | |
| void | RaveIO_close (RaveIO_t *raveio) |
| Closes the HDF5 file but will keep the RaveIO instance. | |
| RaveIO_t * | RaveIO_open (const char *filename, int lazyLoading, const char *preloadQuantities) |
| Opens a supported HDF5 file and loads it into the RaveIO instance. | |
| int | RaveIO_isHDFFile (const char *filename) |
| Checks if specified file is a HDF file or not. | |
| int | RaveIO_load (RaveIO_t *raveio, int lazyLoading, const char *preloadQuantities) |
| Loads the HDF5 file into the raveio instance. | |
| int | RaveIO_save (RaveIO_t *raveio, const char *filename) |
| Saves a rave object as specified according to ODIM HDF5 format specification. | |
| void | RaveIO_setObject (RaveIO_t *raveio, RaveCoreObject *object) |
| Sets the object to be saved. | |
| RaveCoreObject * | RaveIO_getObject (RaveIO_t *raveio) |
| Returns the loaded object/object to be saved. | |
| int | RaveIO_setFilename (RaveIO_t *raveio, const char *filename) |
| Sets the filename that should be used when saving the object. | |
| const char * | RaveIO_getFilename (RaveIO_t *raveio) |
| Returns the current filename. | |
| Rave_ObjectType | RaveIO_getObjectType (RaveIO_t *raveio) |
| Returns the object type for the currently opened file. | |
| int | RaveIO_setOdimVersion (RaveIO_t *raveio, RaveIO_ODIM_Version version) |
| Sets the ODIM version to use when saving the file. | |
| RaveIO_ODIM_Version | RaveIO_getOdimVersion (RaveIO_t *raveio) |
| Returns the ODIM version that will be used to write the file. | |
| RaveIO_ODIM_Version | RaveIO_getReadOdimVersion (RaveIO_t *raveio) |
| Returns the ODIM version of the file that was read. | |
| int | RaveIO_setH5radVersion (RaveIO_t *raveio, RaveIO_ODIM_H5rad_Version version) |
| Sets the ODIM h5rad version to use when saving the file. | |
| RaveIO_ODIM_H5rad_Version | RaveIO_getH5radVersion (RaveIO_t *raveio) |
| Returns the h5rad version. | |
| RaveIO_ODIM_FileFormat | RaveIO_getFileFormat (RaveIO_t *raveio) |
| Will return the file format that this file was read as. | |
| int | RaveIO_setFileFormat (RaveIO_t *raveio, RaveIO_ODIM_FileFormat format) |
| Sets what file format to use. | |
| int | RaveIO_setExtras (RaveIO_t *raveio, RaveValue_t *hashtable) |
| When saving a file you can provide a set of extra attributes to be added to the /how-groups. | |
| RaveValue_t * | RaveIO_getExtras (RaveIO_t *raveio) |
| Returns a RaveValue of type Hashtable with how-attributes or NULL. | |
| void | RaveIO_setStrict (RaveIO_t *raveio, int strict) |
| If writing should be done strictly. | |
| int | RaveIO_isStrict (RaveIO_t *raveio) |
| If writing should be done strictly. | |
| void | RaveIO_setCompressionLevel (RaveIO_t *raveio, int lvl) |
| Sets the compression level. | |
| int | RaveIO_getCompressionLevel (RaveIO_t *raveio) |
| Returns the compression level. | |
| void | RaveIO_setUserBlock (RaveIO_t *raveio, unsigned long long userblock) |
| Sets the user block. | |
| unsigned long long | RaveIO_getUserBlock (RaveIO_t *raveio) |
| Returns the user block. | |
| void | RaveIO_setSizes (RaveIO_t *raveio, size_t sz, size_t addr) |
| Sets the sizes. | |
| void | RaveIO_getSizes (RaveIO_t *raveio, size_t *sz, size_t *addr) |
| Returns the sizes. | |
| void | RaveIO_setSymk (RaveIO_t *raveio, int ik, int lk) |
| Sets the symk. | |
| void | RaveIO_getSymk (RaveIO_t *raveio, int *ik, int *lk) |
| Returns the symk. | |
| void | RaveIO_setIStoreK (RaveIO_t *raveio, long k) |
| Sets the istore_k value. | |
| long | RaveIO_getIStoreK (RaveIO_t *raveio) |
| Returns the istore_k value. | |
| void | RaveIO_setMetaBlockSize (RaveIO_t *raveio, long sz) |
| Sets the meta block size. | |
| long | RaveIO_getMetaBlockSize (RaveIO_t *raveio) |
| Returns the meta block size. | |
| int | RaveIO_setBufrTableDir (RaveIO_t *raveio, const char *dname) |
| Sets the bufr table directory to use when reading bufr files. | |
| const char * | RaveIO_getBufrTableDir (RaveIO_t *raveio) |
| Returns the bufr table directory. | |
| const char * | RaveIO_getErrorMessage (RaveIO_t *raveio) |
| If an error occurs during writing, you might get an indication for why by checking the error message. | |
| int | RaveIO_supports (RaveIO_ODIM_FileFormat format) |
| Returns if the raveio supports the provided file format. | |
Variables | |
| RaveCoreObjectType | RaveIO_TYPE |
| Type definition to use when creating a rave object. | |
Functions for performing rave related IO operations, mostly ODIM-formatted HDF5 files.
| void RaveIO_close | ( | RaveIO_t * | raveio | ) |
Closes the HDF5 file but will keep the RaveIO instance.
| [in] | raveio | - the rave IO instance |
| const char * RaveIO_getBufrTableDir | ( | RaveIO_t * | raveio | ) |
Returns the bufr table directory.
| [in] | raveio | - self |
| int RaveIO_getCompressionLevel | ( | RaveIO_t * | raveio | ) |
Returns the compression level.
| [in] | raveio- | self |
| const char * RaveIO_getErrorMessage | ( | RaveIO_t * | raveio | ) |
If an error occurs during writing, you might get an indication for why by checking the error message.
| [in] | raveio | - rave io |
| RaveValue_t * RaveIO_getExtras | ( | RaveIO_t * | raveio | ) |
Returns a RaveValue of type Hashtable with how-attributes or NULL.
| [in] | raveio | - self |
| RaveIO_ODIM_FileFormat RaveIO_getFileFormat | ( | RaveIO_t * | raveio | ) |
Will return the file format that this file was read as.
Note, it is currently not possible to save data files in any other formats than HDF5.
| [in] | raveio | - self |
| const char * RaveIO_getFilename | ( | RaveIO_t * | raveio | ) |
Returns the current filename.
| [in] | raveio | - self |
| RaveIO_ODIM_H5rad_Version RaveIO_getH5radVersion | ( | RaveIO_t * | raveio | ) |
Returns the h5rad version.
| [in] | raveio | - self |
| long RaveIO_getIStoreK | ( | RaveIO_t * | raveio | ) |
Returns the istore_k value.
| [in] | raveio | - self |
| long RaveIO_getMetaBlockSize | ( | RaveIO_t * | raveio | ) |
Returns the meta block size.
| [in] | raveio | - self |
| RaveCoreObject * RaveIO_getObject | ( | RaveIO_t * | raveio | ) |
Returns the loaded object/object to be saved.
| [in] | raveio | - self |
| Rave_ObjectType RaveIO_getObjectType | ( | RaveIO_t * | raveio | ) |
Returns the object type for the currently opened file.
Requires that a RaveCoreObject has been set.
| [in] | raveio | - the Rave IO instance |
| RaveIO_ODIM_Version RaveIO_getOdimVersion | ( | RaveIO_t * | raveio | ) |
Returns the ODIM version that will be used to write the file.
| [in] | raveio | - self |
| RaveIO_ODIM_Version RaveIO_getReadOdimVersion | ( | RaveIO_t * | raveio | ) |
Returns the ODIM version of the file that was read.
| [in] | raveio | - self |
| void RaveIO_getSizes | ( | RaveIO_t * | raveio, |
| size_t * | sz, | ||
| size_t * | addr ) |
Returns the sizes.
| [in] | raveio | - self |
| [in] | sz | - same as sizes.sizeof_size |
| [in] | addr | - same as sizes.sizeof_addr |
| void RaveIO_getSymk | ( | RaveIO_t * | raveio, |
| int * | ik, | ||
| int * | lk ) |
Returns the symk.
| [in] | raveio | - self |
| [in] | ik | - same as sym_k.ik |
| [in] | lk | - same as sym_k.lk |
| unsigned long long RaveIO_getUserBlock | ( | RaveIO_t * | raveio | ) |
Returns the user block.
| [in] | raveio | - self |
| int RaveIO_isHDFFile | ( | const char * | filename | ) |
Checks if specified file is a HDF file or not.
| [in] | filename | - the filename |
| int RaveIO_isStrict | ( | RaveIO_t * | raveio | ) |
If writing should be done strictly.
From ODIM H5 2.4 several how-attributes are mandatory. If any of these are missing and strict is set to true, then the writing will fail.
| [in] | raveio | - self |
| int RaveIO_load | ( | RaveIO_t * | raveio, |
| int | lazyLoading, | ||
| const char * | preloadQuantities ) |
Loads the HDF5 file into the raveio instance.
| [in] | raveio | - self |
| [in] | lazyLoading | - if file should be loaded in lazy mode or not |
| [in] | preloadQuantities | - if lazy loading, then these quantities will be loaded immediately.* |
| RaveIO_t * RaveIO_open | ( | const char * | filename, |
| int | lazyLoading, | ||
| const char * | preloadQuantities ) |
Opens a supported HDF5 file and loads it into the RaveIO instance.
Same as: RaveIO_t* instance = RAVE_OBJECT_NEW(&RaveIO_TYPE); RaveIO_setFilename(instance, filename); RaveIO_load(instance);
| [in] | filename | - the HDF5 file to open |
| [in] | lazyLoading | - if file should be loaded in lazy mode or not |
| [in] | preloadQuantities | - if lazy loading, then these quantities will be loaded immediately. |
| int RaveIO_save | ( | RaveIO_t * | raveio, |
| const char * | filename ) |
Saves a rave object as specified according to ODIM HDF5 format specification.
| [in] | raveio | - self |
| [in] | filename | - the filename to save with. May be NULL, same as calling RaveIO_setFilename followed by RaveIO_save(..., NULL) |
| int RaveIO_setBufrTableDir | ( | RaveIO_t * | raveio, |
| const char * | dname ) |
Sets the bufr table directory to use when reading bufr files.
This function is only relevant if BUFR support has been enabled otherwise it will just be a setter that isn't used.
| [in] | raveio | - self |
| [in] | dname | - the directory name |
| void RaveIO_setCompressionLevel | ( | RaveIO_t * | raveio, |
| int | lvl ) |
Sets the compression level.
| [in] | raveio | - self |
| [in] | lvl | - the compression level (0..9) |
| int RaveIO_setExtras | ( | RaveIO_t * | raveio, |
| RaveValue_t * | hashtable ) |
When saving a file you can provide a set of extra attributes to be added to the /how-groups.
Note, that RaveValue_Type must be Hashtable and that all keys must belong to a how-group. No validation of strictness or any other thing is performed on these variables so ensure that they are compliant to the version you are writing.
| [in] | raveio | - self |
| [in] | hashtable | - the rave value hashtable |
| int RaveIO_setFileFormat | ( | RaveIO_t * | raveio, |
| RaveIO_ODIM_FileFormat | format ) |
Sets what file format to use.
| [in] | raveio | - self |
| [in] | format | - the file format to use |
| int RaveIO_setFilename | ( | RaveIO_t * | raveio, |
| const char * | filename ) |
Sets the filename that should be used when saving the object.
| [in] | raveio | - self |
| [in] | filename | - the filename that should be used when saving. |
| int RaveIO_setH5radVersion | ( | RaveIO_t * | raveio, |
| RaveIO_ODIM_H5rad_Version | version ) |
Sets the ODIM h5rad version to use when saving the file.
Currently, the only supported version is 2.0.
| [in] | raveio | - self |
| [in] | version | - the version to be used |
| void RaveIO_setIStoreK | ( | RaveIO_t * | raveio, |
| long | k ) |
Sets the istore_k value.
| [in] | raveio | - self |
| [in] | k | - the istore_k value |
| void RaveIO_setMetaBlockSize | ( | RaveIO_t * | raveio, |
| long | sz ) |
Sets the meta block size.
| [in] | raveio | - self |
| [in] | sz | - the meta block size |
| void RaveIO_setObject | ( | RaveIO_t * | raveio, |
| RaveCoreObject * | object ) |
Sets the object to be saved.
| [in] | raveio | - self |
| [in] | object | - the object to be saved |
| int RaveIO_setOdimVersion | ( | RaveIO_t * | raveio, |
| RaveIO_ODIM_Version | version ) |
Sets the ODIM version to use when saving the file.
| [in] | raveio | - self |
| [in] | version | - the version to be used |
| void RaveIO_setSizes | ( | RaveIO_t * | raveio, |
| size_t | sz, | ||
| size_t | addr ) |
Sets the sizes.
| [in] | raveio | - self |
| [in] | sz | - same as sizes.sizeof_size |
| [in] | addr | - same as sizes.sizeof_addr |
| void RaveIO_setStrict | ( | RaveIO_t * | raveio, |
| int | strict ) |
If writing should be done strictly.
From ODIM H5 2.4 several how-attributes are mandatory. If any of these are missing and strict is set to true, then the writing will fail.
| [in] | raveio | - self |
| [in] | strict | - if writing should be performed strictly or not |
| void RaveIO_setSymk | ( | RaveIO_t * | raveio, |
| int | ik, | ||
| int | lk ) |
Sets the symk.
| [in] | raveio | - self |
| [in] | ik | - same as sym_k.ik |
| [in] | lk | - same as sym_k.lk |
| void RaveIO_setUserBlock | ( | RaveIO_t * | raveio, |
| unsigned long long | userblock ) |
Sets the user block.
| [in] | raveio | - self |
| [in] | userblock | - the user block |
| int RaveIO_supports | ( | RaveIO_ODIM_FileFormat | format | ) |
Returns if the raveio supports the provided file format.
| [in] | format | - the inquiried file format |
| RaveCoreObjectType RaveIO_TYPE |