RAVE
rave_io.h
Go to the documentation of this file.
1/* --------------------------------------------------------------------
2Copyright (C) 2009, 2011 Swedish Meteorological and Hydrological Institute, SMHI,
3
4This file is part of RAVE.
5
6RAVE is free software: you can redistribute it and/or modify
7it under the terms of the GNU Lesser General Public License as published by
8the Free Software Foundation, either version 3 of the License, or
9(at your option) any later version.
10
11RAVE is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU Lesser General Public License for more details.
15
16You should have received a copy of the GNU Lesser General Public License
17along with RAVE. If not, see <http://www.gnu.org/licenses/>.
18------------------------------------------------------------------------*/
27#ifndef RAVE_IO_H
28#define RAVE_IO_H
29
30#include "rave_object.h"
31#include "rave_types.h"
32#include "rave_value.h"
33
46
50typedef struct _RaveIO_t RaveIO_t;
51
56
61void RaveIO_close(RaveIO_t* raveio);
62
75RaveIO_t* RaveIO_open(const char* filename, int lazyLoading, const char* preloadQuantities);
76
82int RaveIO_isHDFFile(const char* filename);
83
91int RaveIO_load(RaveIO_t* raveio, int lazyLoading, const char* preloadQuantities);
92
99int RaveIO_save(RaveIO_t* raveio, const char* filename);
100
106void RaveIO_setObject(RaveIO_t* raveio, RaveCoreObject* object);
107
114
121int RaveIO_setFilename(RaveIO_t* raveio, const char* filename);
122
128const char* RaveIO_getFilename(RaveIO_t* raveio);
129
137
145
152
159
168
175
183
194int RaveIO_setExtras(RaveIO_t* raveio, RaveValue_t* hashtable);
195
202
209void RaveIO_setStrict(RaveIO_t* raveio, int strict);
210
217int RaveIO_isStrict(RaveIO_t* raveio);
218
226
232void RaveIO_setCompressionLevel(RaveIO_t* raveio, int lvl);
233
240
246void RaveIO_setUserBlock(RaveIO_t* raveio, unsigned long long userblock);
247
253unsigned long long RaveIO_getUserBlock(RaveIO_t* raveio);
254
261void RaveIO_setSizes(RaveIO_t* raveio, size_t sz, size_t addr);
262
269void RaveIO_getSizes(RaveIO_t* raveio, size_t* sz, size_t* addr);
270
277void RaveIO_setSymk(RaveIO_t* raveio, int ik, int lk);
278
285void RaveIO_getSymk(RaveIO_t* raveio, int* ik, int* lk);
286
292void RaveIO_setIStoreK(RaveIO_t* raveio, long k);
293
299long RaveIO_getIStoreK(RaveIO_t* raveio);
300
306void RaveIO_setMetaBlockSize(RaveIO_t* raveio, long sz);
307
314
324int RaveIO_setBufrTableDir(RaveIO_t* raveio, const char* dname);
325
331const char* RaveIO_getBufrTableDir(RaveIO_t* raveio);
332
339const char* RaveIO_getErrorMessage(RaveIO_t* raveio);
340
347
348
349
350#endif
RaveCoreObjectType RaveIO_TYPE
Type definition to use when creating a rave object.
Definition rave_io.c:1070
int RaveIO_load(RaveIO_t *raveio, int lazyLoading, const char *preloadQuantities)
Loads the HDF5 file into the raveio instance.
Definition rave_io.c:670
RaveCoreObject * RaveIO_getObject(RaveIO_t *raveio)
Returns the loaded object/object to be saved.
Definition rave_io.c:791
void RaveIO_setStrict(RaveIO_t *raveio, int strict)
If writing should be done strictly.
Definition rave_io.c:916
int RaveIO_isHDFFile(const char *filename)
Checks if specified file is a HDF file or not.
Definition rave_io.c:665
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.
Definition rave_io.c:895
void RaveIO_setIStoreK(RaveIO_t *raveio, long k)
Sets the istore_k value.
Definition rave_io.c:994
int RaveIO_setFileFormat(RaveIO_t *raveio, RaveIO_ODIM_FileFormat format)
Sets what file format to use.
Definition rave_io.c:884
void RaveIO_getSymk(RaveIO_t *raveio, int *ik, int *lk)
Returns the symk.
Definition rave_io.c:983
void RaveIO_setSymk(RaveIO_t *raveio, int ik, int lk)
Sets the symk.
Definition rave_io.c:976
RaveIO_t * RaveIO_open(const char *filename, int lazyLoading, const char *preloadQuantities)
Opens a supported HDF5 file and loads it into the RaveIO instance.
Definition rave_io.c:635
unsigned long long RaveIO_getUserBlock(RaveIO_t *raveio)
Returns the user block.
Definition rave_io.c:952
RaveIO_ODIM_Version RaveIO_getOdimVersion(RaveIO_t *raveio)
Returns the ODIM version that will be used to write the file.
Definition rave_io.c:850
const char * RaveIO_getFilename(RaveIO_t *raveio)
Returns the current filename.
Definition rave_io.c:816
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.
Definition rave_io.c:1046
RaveIO_ODIM_FileFormat
The file format of the data that has been read.
Definition rave_io.h:40
@ RaveIO_ODIM_FileFormat_HDF5
HDF 5.
Definition rave_io.h:42
@ RaveIO_ODIM_FileFormat_UNDEFINED
undefined
Definition rave_io.h:41
@ RaveIO_ODIM_FileFormat_BUFR
BUFR.
Definition rave_io.h:43
void RaveIO_setUserBlock(RaveIO_t *raveio, unsigned long long userblock)
Sets the user block.
Definition rave_io.c:946
void RaveIO_close(RaveIO_t *raveio)
Closes the HDF5 file but will keep the RaveIO instance.
Definition rave_io.c:626
int RaveIO_supports(RaveIO_ODIM_FileFormat format)
Returns if the raveio supports the provided file format.
Definition rave_io.c:1053
int RaveIO_setBufrTableDir(RaveIO_t *raveio, const char *dname)
Sets the bufr table directory to use when reading bufr files.
Definition rave_io.c:1018
const char * RaveIO_getBufrTableDir(RaveIO_t *raveio)
Returns the bufr table directory.
Definition rave_io.c:1040
void RaveIO_setObject(RaveIO_t *raveio, RaveCoreObject *object)
Sets the object to be saved.
Definition rave_io.c:784
void RaveIO_getSizes(RaveIO_t *raveio, size_t *sz, size_t *addr)
Returns the sizes.
Definition rave_io.c:965
long RaveIO_getIStoreK(RaveIO_t *raveio)
Returns the istore_k value.
Definition rave_io.c:1000
long RaveIO_getMetaBlockSize(RaveIO_t *raveio)
Returns the meta block size.
Definition rave_io.c:1012
struct _RaveIO_t RaveIO_t
Defines a Rave IO instance.
Definition rave_io.h:50
void RaveIO_setSizes(RaveIO_t *raveio, size_t sz, size_t addr)
Sets the sizes.
Definition rave_io.c:958
RaveIO_ODIM_FileFormat RaveIO_getFileFormat(RaveIO_t *raveio)
Will return the file format that this file was read as.
Definition rave_io.c:878
RaveValue_t * RaveIO_getExtras(RaveIO_t *raveio)
Returns a RaveValue of type Hashtable with how-attributes or NULL.
Definition rave_io.c:909
int RaveIO_save(RaveIO_t *raveio, const char *filename)
Saves a rave object as specified according to ODIM HDF5 format specification.
Definition rave_io.c:696
Rave_ObjectType RaveIO_getObjectType(RaveIO_t *raveio)
Returns the object type for the currently opened file.
Definition rave_io.c:822
RaveIO_ODIM_H5rad_Version RaveIO_getH5radVersion(RaveIO_t *raveio)
Returns the h5rad version.
Definition rave_io.c:872
void RaveIO_setMetaBlockSize(RaveIO_t *raveio, long sz)
Sets the meta block size.
Definition rave_io.c:1006
int RaveIO_setH5radVersion(RaveIO_t *raveio, RaveIO_ODIM_H5rad_Version version)
Sets the ODIM h5rad version to use when saving the file.
Definition rave_io.c:862
void RaveIO_setCompressionLevel(RaveIO_t *raveio, int lvl)
Sets the compression level.
Definition rave_io.c:932
int RaveIO_setOdimVersion(RaveIO_t *raveio, RaveIO_ODIM_Version version)
Sets the ODIM version to use when saving the file.
Definition rave_io.c:840
RaveIO_ODIM_Version RaveIO_getReadOdimVersion(RaveIO_t *raveio)
Returns the ODIM version of the file that was read.
Definition rave_io.c:856
int RaveIO_isStrict(RaveIO_t *raveio)
If writing should be done strictly.
Definition rave_io.c:926
int RaveIO_setFilename(RaveIO_t *raveio, const char *filename)
Sets the filename that should be used when saving the object.
Definition rave_io.c:797
int RaveIO_getCompressionLevel(RaveIO_t *raveio)
Returns the compression level.
Definition rave_io.c:940
Generic implementation of an object that is used within rave.
struct _raveobject RaveCoreObject
The basic raveobject that contains the header information for all rave objects.
struct _raveobjecttype RaveCoreObjectType
The rave object type definition.
Type definitions for RAVE.
RaveIO_ODIM_Version
The /Conventions version in a ODIM HDF5 file.
Definition rave_types.h:43
Rave_ObjectType
Object types that defines the /what/object in the ODIM format.
Definition rave_types.h:82
RaveIO_ODIM_H5rad_Version
The /what/version in a ODIM HDF5 file.
Definition rave_types.h:59
A value object that can represent standard types like int, double, .
struct _RaveValue_t RaveValue_t
Defines a rave value.
Definition rave_value.h:47
Defines the structure for the RaveIO in a volume.
Definition rave_io.c:59
RaveIO_ODIM_Version version
the odim version
Definition rave_io.c:62
int strict
if strict writing should be enforced, from 2.4, several how-attributes are required.
Definition rave_io.c:67
char * filename
the filename
Definition rave_io.c:68