RAVE
|
Functions for performing rave related IO operations, mostly ODIM-formatted HDF5 files. More...
Go to the source code of this file.
Typedefs | |
typedef enum RaveIO_ODIM_FileFormat | RaveIO_ODIM_FileFormat |
The file format of the data that has been read. | |
typedef struct _RaveIO_t | RaveIO_t |
Defines a Rave IO instance. | |
Enumerations | |
enum | RaveIO_ODIM_FileFormat { RaveIO_ODIM_FileFormat_UNDEFINED = -1 , RaveIO_ODIM_FileFormat_HDF5 = 0 , RaveIO_ODIM_FileFormat_BUFR = 1 , RaveIO_FileFormat_CF = 2 } |
The file format of the data that has been read. 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_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. | |
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. | |
int | RaveIO_setFileFormat (RaveIO_t *raveio, RaveIO_ODIM_FileFormat format) |
Sets what file format to use. | |
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.
This object does NOT support RAVE_OBJECT_CLONE.
typedef enum RaveIO_ODIM_FileFormat RaveIO_ODIM_FileFormat |
The file format of the data that has been read.
When reading a file through rave io, you might sometime read exotic formats like BUFR. This type provides information on what type of format we found it to be.
The file format of the data that has been read.
When reading a file through rave io, you might sometime read exotic formats like BUFR. This type provides information on what type of format we found it to be.
Enumerator | |
---|---|
RaveIO_ODIM_FileFormat_UNDEFINED | undefined |
RaveIO_ODIM_FileFormat_HDF5 | HDF 5. |
RaveIO_ODIM_FileFormat_BUFR | BUFR. |
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 |
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_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_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 |
|
extern |
Type definition to use when creating a rave object.