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
49
58int OdimIoUtilities_convertGainOffsetFromInternalRave(const char* quantity, RaveIO_ODIM_Version version, double* gain, double* offset);
59
68int OdimIoUtilities_convertGainOffsetToInternalRave(const char* quantity, RaveIO_ODIM_Version version, double* gain, double* offset);
69
80int OdimIoUtilities_addRaveField(RaveField_t* field, HL_NodeList* nodelist, RaveIO_ODIM_Version outversion, const char* fmt, ...);
81
92int OdimIoUtilities_addQualityFields(RaveObjectList_t* fields, HL_NodeList* nodelist, RaveIO_ODIM_Version outversion, const char* fmt, ...);
93
103RaveField_t* OdimIoUtilities_loadField(LazyNodeListReader_t* lazyReader, RaveIO_ODIM_Version version, const char* fmt, ...);
104
113RaveLegend_t* OdimIOUtilities_loadLegend(LazyNodeListReader_t* lazyReader, RaveIO_ODIM_Version version, const char* fmt, ...);
114
123int OdimIoUtilities_getIdFromSource(const char* source, const char* id, char* buf, size_t buflen);
124
133int OdimIoUtilities_getNodOrCmtFromSource(const char* source, char* buf, size_t buflen);
134
145int OdimIoUtilities_createLegend(RaveLegend_t* legend, HL_NodeList* nodelist, RaveIO_ODIM_Version version, const char* fmt, ...);
146
147
148#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_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
struct OdimIoUtilityArg OdimIoUtilityArg
Struct that can be used when passing around objects and associated nodelist between the writing and l...
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.
Used for defining a legend that can be added to a parameter.
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
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 that can be used when passing around objects and associated nodelist between the writing and l...
Definition odim_io_utilities.h:43
HL_NodeList * nodelist
the nodelist
Definition odim_io_utilities.h:45
RaveCoreObject * object
the object
Definition odim_io_utilities.h:46
RaveIO_ODIM_Version version
the version
Definition odim_io_utilities.h:47
LazyNodeListReader_t * lazyReader
the lazy node list reader
Definition odim_io_utilities.h:44
Represents the lazy nodelist loader.
Definition lazy_nodelist_reader.c:21
Represents the cartesian volume.
Definition rave_field.c:36
Represents one scan in a volume.
Definition rave_legend.c:39
Represents a list.
Definition raveobject_list.c:35
The basic raveobject that contains the header information for all rave objects.
Definition rave_object.h:42