RAVE
odim_io_utilities.h
Go to the documentation of this file.
1/* --------------------------------------------------------------------
2Copyright (C) 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------------------------------------------------------------------------*/
25#ifndef ODIM_IO_UTILITIES_H
26#define ODIM_IO_UTILITIES_H
27
28#include <lazy_nodelist_reader.h>
29#include "rave_field.h"
30#include "rave_object.h"
31#include "rave_types.h"
32#include "raveobject_list.h"
34#include "hlhdf.h"
35#include <stdarg.h>
36#include "rave_legend.h"
37#include "rave_value.h"
38
50
59int OdimIoUtilities_convertGainOffsetFromInternalRave(const char* quantity, RaveIO_ODIM_Version version, double* gain, double* offset);
60
69int OdimIoUtilities_convertGainOffsetToInternalRave(const char* quantity, RaveIO_ODIM_Version version, double* gain, double* offset);
70
81int OdimIoUtilities_addRaveField(RaveField_t* field, HL_NodeList* nodelist, RaveIO_ODIM_Version outversion, const char* fmt, ...);
82
93int OdimIoUtilities_addQualityFields(RaveObjectList_t* fields, HL_NodeList* nodelist, RaveIO_ODIM_Version outversion, const char* fmt, ...);
94
104RaveField_t* OdimIoUtilities_loadField(LazyNodeListReader_t* lazyReader, RaveIO_ODIM_Version version, const char* fmt, ...);
105
114RaveLegend_t* OdimIOUtilities_loadLegend(LazyNodeListReader_t* lazyReader, RaveIO_ODIM_Version version, const char* fmt, ...);
115
124int OdimIoUtilities_getIdFromSource(const char* source, const char* id, char* buf, size_t buflen);
125
134int OdimIoUtilities_getNodOrCmtFromSource(const char* source, char* buf, size_t buflen);
135
146int OdimIoUtilities_createLegend(RaveLegend_t* legend, HL_NodeList* nodelist, RaveIO_ODIM_Version version, const char* fmt, ...);
147
154int OdimIoUtilities_addValuesToFile(RaveValue_t* hashtable, HL_NodeList* nodelist);
155
156#endif /* ODIM_IO_UTILITIES_H */
int OdimIoUtilities_convertGainOffsetFromInternalRave(const char *quantity, RaveIO_ODIM_Version version, double *gain, double *offset)
Converts the gain and offset so that quantity is adjusted for ODIM version to be written.
Definition odim_io_utilities.c:102
int OdimIoUtilities_addValuesToFile(RaveValue_t *hashtable, HL_NodeList *nodelist)
Adds a number of attributes to the nodelist assuming that the RaveValue instance is of hashtable type...
Definition odim_io_utilities.c:508
int OdimIoUtilities_convertGainOffsetToInternalRave(const char *quantity, RaveIO_ODIM_Version version, double *gain, double *offset)
Converts the gain and offset so that quantity is adjusted for the internally used quantity.
Definition odim_io_utilities.c:123
RaveField_t * OdimIoUtilities_loadField(LazyNodeListReader_t *lazyReader, RaveIO_ODIM_Version version, const char *fmt,...)
Loads a rave field.
Definition odim_io_utilities.c:249
int OdimIoUtilities_getNodOrCmtFromSource(const char *source, char *buf, size_t buflen)
Like OdimIoUtilities_getIdFromSource but will first check NOD: and then CMT:
Definition odim_io_utilities.c:347
int OdimIoUtilities_addQualityFields(RaveObjectList_t *fields, HL_NodeList *nodelist, RaveIO_ODIM_Version outversion, const char *fmt,...)
Adds a list of quality fields (RaveField_t) to a nodelist.
Definition odim_io_utilities.c:203
RaveLegend_t * OdimIOUtilities_loadLegend(LazyNodeListReader_t *lazyReader, RaveIO_ODIM_Version version, const char *fmt,...)
Loads a rave legend.
Definition odim_io_utilities.c:292
int OdimIoUtilities_getIdFromSource(const char *source, const char *id, char *buf, size_t buflen)
Gets the specified id from the source string, for example.
Definition odim_io_utilities.c:322
int OdimIoUtilities_addRaveField(RaveField_t *field, HL_NodeList *nodelist, RaveIO_ODIM_Version outversion, const char *fmt,...)
Adds a rave field to a nodelist.
Definition odim_io_utilities.c:144
int OdimIoUtilities_createLegend(RaveLegend_t *legend, HL_NodeList *nodelist, RaveIO_ODIM_Version version, const char *fmt,...)
Adds a legend (RaveLegend_t) to a nodelist.
Definition odim_io_utilities.c:357
Generic field that only provides a 2-dim data field and a number of dynamic attributes.
struct _RaveField_t RaveField_t
Defines a Rave field.
Definition rave_field.h:38
Used for defining a legend that can be added to a parameter.
struct _RaveLegend_t RaveLegend_t
Defines a attribute tablee.
Definition rave_legend.h:35
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.
Type definitions for RAVE.
RaveIO_ODIM_Version
The /Conventions version in a ODIM HDF5 file.
Definition rave_types.h:43
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
Implementation of a rave object hashtable that maps between strings and rave core objects.
Implementation of a rave object list that ensures that the objects contained within the list are rele...
struct _RaveObjectList_t RaveObjectList_t
Defines a list.
Definition raveobject_list.h:38
Struct that can be used when passing around objects and associated nodelist between the writing and l...
Definition odim_io_utilities.h:44
HL_NodeList * nodelist
the nodelist
Definition odim_io_utilities.h:46
RaveCoreObject * object
the object
Definition odim_io_utilities.h:47
RaveIO_ODIM_Version version
the version
Definition odim_io_utilities.h:48
LazyNodeListReader_t * lazyReader
the lazy node list reader
Definition odim_io_utilities.h:45