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
45
49typedef struct _RaveIO_t RaveIO_t;
50
55
60void RaveIO_close(RaveIO_t* raveio);
61
74RaveIO_t* RaveIO_open(const char* filename, int lazyLoading, const char* preloadQuantities);
75
83int RaveIO_load(RaveIO_t* raveio, int lazyLoading, const char* preloadQuantities);
84
91int RaveIO_save(RaveIO_t* raveio, const char* filename);
92
98void RaveIO_setObject(RaveIO_t* raveio, RaveCoreObject* object);
99
106
113int RaveIO_setFilename(RaveIO_t* raveio, const char* filename);
114
120const char* RaveIO_getFilename(RaveIO_t* raveio);
121
129
137
144
151
160
167
175
182void RaveIO_setStrict(RaveIO_t* raveio, int strict);
183
190int RaveIO_isStrict(RaveIO_t* raveio);
191
199
205void RaveIO_setCompressionLevel(RaveIO_t* raveio, int lvl);
206
213
219void RaveIO_setUserBlock(RaveIO_t* raveio, unsigned long long userblock);
220
226unsigned long long RaveIO_getUserBlock(RaveIO_t* raveio);
227
234void RaveIO_setSizes(RaveIO_t* raveio, size_t sz, size_t addr);
235
242void RaveIO_getSizes(RaveIO_t* raveio, size_t* sz, size_t* addr);
243
250void RaveIO_setSymk(RaveIO_t* raveio, int ik, int lk);
251
258void RaveIO_getSymk(RaveIO_t* raveio, int* ik, int* lk);
259
265void RaveIO_setIStoreK(RaveIO_t* raveio, long k);
266
272long RaveIO_getIStoreK(RaveIO_t* raveio);
273
279void RaveIO_setMetaBlockSize(RaveIO_t* raveio, long sz);
280
287
297int RaveIO_setBufrTableDir(RaveIO_t* raveio, const char* dname);
298
304const char* RaveIO_getBufrTableDir(RaveIO_t* raveio);
305
312const char* RaveIO_getErrorMessage(RaveIO_t* raveio);
313
320
321
322
323#endif
int RaveIO_load(RaveIO_t *raveio, int lazyLoading, const char *preloadQuantities)
Loads the HDF5 file into the raveio instance.
Definition rave_io.c:616
RaveCoreObject * RaveIO_getObject(RaveIO_t *raveio)
Returns the loaded object/object to be saved.
Definition rave_io.c:728
void RaveIO_setStrict(RaveIO_t *raveio, int strict)
If writing should be done strictly.
Definition rave_io.c:832
void RaveIO_setIStoreK(RaveIO_t *raveio, long k)
Sets the istore_k value.
Definition rave_io.c:910
int RaveIO_setFileFormat(RaveIO_t *raveio, RaveIO_ODIM_FileFormat format)
Sets what file format to use.
Definition rave_io.c:821
void RaveIO_getSymk(RaveIO_t *raveio, int *ik, int *lk)
Returns the symk.
Definition rave_io.c:899
void RaveIO_setSymk(RaveIO_t *raveio, int ik, int lk)
Sets the symk.
Definition rave_io.c:892
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:586
unsigned long long RaveIO_getUserBlock(RaveIO_t *raveio)
Returns the user block.
Definition rave_io.c:868
RaveIO_ODIM_Version RaveIO_getOdimVersion(RaveIO_t *raveio)
Returns the ODIM version that will be used to write the file.
Definition rave_io.c:787
const char * RaveIO_getFilename(RaveIO_t *raveio)
Returns the current filename.
Definition rave_io.c:753
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:962
RaveIO_ODIM_FileFormat
The file format of the data that has been read.
Definition rave_io.h:39
@ RaveIO_ODIM_FileFormat_HDF5
HDF 5.
Definition rave_io.h:41
@ RaveIO_ODIM_FileFormat_UNDEFINED
undefined
Definition rave_io.h:40
@ RaveIO_ODIM_FileFormat_BUFR
BUFR.
Definition rave_io.h:42
void RaveIO_setUserBlock(RaveIO_t *raveio, unsigned long long userblock)
Sets the user block.
Definition rave_io.c:862
void RaveIO_close(RaveIO_t *raveio)
Closes the HDF5 file but will keep the RaveIO instance.
Definition rave_io.c:577
int RaveIO_supports(RaveIO_ODIM_FileFormat format)
Returns if the raveio supports the provided file format.
Definition rave_io.c:969
int RaveIO_setBufrTableDir(RaveIO_t *raveio, const char *dname)
Sets the bufr table directory to use when reading bufr files.
Definition rave_io.c:934
const char * RaveIO_getBufrTableDir(RaveIO_t *raveio)
Returns the bufr table directory.
Definition rave_io.c:956
void RaveIO_setObject(RaveIO_t *raveio, RaveCoreObject *object)
Sets the object to be saved.
Definition rave_io.c:721
void RaveIO_getSizes(RaveIO_t *raveio, size_t *sz, size_t *addr)
Returns the sizes.
Definition rave_io.c:881
long RaveIO_getIStoreK(RaveIO_t *raveio)
Returns the istore_k value.
Definition rave_io.c:916
long RaveIO_getMetaBlockSize(RaveIO_t *raveio)
Returns the meta block size.
Definition rave_io.c:928
RaveCoreObjectType RaveIO_TYPE
Type definition to use when creating a rave object.
Definition rave_io.c:986
void RaveIO_setSizes(RaveIO_t *raveio, size_t sz, size_t addr)
Sets the sizes.
Definition rave_io.c:874
RaveIO_ODIM_FileFormat RaveIO_getFileFormat(RaveIO_t *raveio)
Will return the file format that this file was read as.
Definition rave_io.c:815
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:642
Rave_ObjectType RaveIO_getObjectType(RaveIO_t *raveio)
Returns the object type for the currently opened file.
Definition rave_io.c:759
RaveIO_ODIM_H5rad_Version RaveIO_getH5radVersion(RaveIO_t *raveio)
Returns the h5rad version.
Definition rave_io.c:809
void RaveIO_setMetaBlockSize(RaveIO_t *raveio, long sz)
Sets the meta block size.
Definition rave_io.c:922
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:799
void RaveIO_setCompressionLevel(RaveIO_t *raveio, int lvl)
Sets the compression level.
Definition rave_io.c:848
int RaveIO_setOdimVersion(RaveIO_t *raveio, RaveIO_ODIM_Version version)
Sets the ODIM version to use when saving the file.
Definition rave_io.c:777
RaveIO_ODIM_Version RaveIO_getReadOdimVersion(RaveIO_t *raveio)
Returns the ODIM version of the file that was read.
Definition rave_io.c:793
int RaveIO_isStrict(RaveIO_t *raveio)
If writing should be done strictly.
Definition rave_io.c:842
int RaveIO_setFilename(RaveIO_t *raveio, const char *filename)
Sets the filename that should be used when saving the object.
Definition rave_io.c:734
int RaveIO_getCompressionLevel(RaveIO_t *raveio)
Returns the compression level.
Definition rave_io.c:856
Generic implementation of an object that is used within rave.
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
Defines the structure for the RaveIO in a volume.
Definition rave_io.c:58
RaveIO_ODIM_Version version
the odim version
Definition rave_io.c:61
int strict
if strict writing should be enforced, from 2.4, several how-attributes are required.
Definition rave_io.c:65
char * filename
the filename
Definition rave_io.c:66
The basic raveobject that contains the header information for all rave objects.
Definition rave_object.h:42
The rave object type definition.
Definition rave_object.h:52