RAVE
vp_odim_io.c File Reference

Polar ODIM IO functions. More...

#include "vp_odim_io.h"
#include "rave_hlhdf_utilities.h"
#include "rave_debug.h"
#include "rave_alloc.h"
#include <string.h>
#include "odim_io_utilities.h"
#include <math.h>

Classes

struct  _VpOdimIO_t
 The Vertical Profile ODIM IO adaptor. More...
 

Functions

void VpOdimIO_setVersion (VpOdimIO_t *self, RaveIO_ODIM_Version version)
 Sets the version that this io class should handle.
 
RaveIO_ODIM_Version VpOdimIO_getVersion (VpOdimIO_t *self)
 Returns the version that this io class handles.
 
void VpOdimIO_setStrict (VpOdimIO_t *self, int strict)
 If writing should be done strictly.
 
int VpOdimIO_isStrict (VpOdimIO_t *self)
 If writing should be done strictly.
 
const char * VpOdimIO_getErrorMessage (VpOdimIO_t *self)
 If an error occurs during writing, you might get an indication for why by checking the error message.
 
int VpOdimIO_read (VpOdimIO_t *self, LazyNodeListReader_t *lazyReader, VerticalProfile_t *vp)
 Reads a vp from the nodelist and sets the data in the vp.
 
int VpOdimIO_fill (VpOdimIO_t *self, VerticalProfile_t *vp, HL_NodeList *nodelist)
 Fills a nodelist with information about a vertical profile.
 
int VpOdimIO_validateVpHowAttributes (VpOdimIO_t *self, VerticalProfile_t *vp)
 Validates a vertical profile according to strictness and version in order to verify if it contains necessary information.
 

Variables

RaveCoreObjectType VpOdimIO_TYPE
 Type definition to use when creating a rave object.
 

Detailed Description

Polar ODIM IO functions.

Author
Anders Henja (Swedish Meteorological and Hydrological Institute, SMHI)
Date
2012-08-30

@co-author Ulf E. Nordh, SMHI

Date
2017-02-23, started overhaul of the code to achieve better resemblance with N2 and requirements from customer E-profile. Added code under the function VpOdimIOInternal_loadDsAttribute, the code makes it possible to read/write the attributes under /dataset1/what

Function Documentation

◆ VpOdimIO_fill()

int VpOdimIO_fill ( VpOdimIO_t * self,
VerticalProfile_t * vp,
HL_NodeList * nodelist )

Fills a nodelist with information about a vertical profile.

Parameters
[in]self- self
[in]vp- the vertical profile
[in]nodelist- the hlhdf nodelist to fill
Returns
1 on success otherwise 0

◆ VpOdimIO_getErrorMessage()

const char * VpOdimIO_getErrorMessage ( VpOdimIO_t * self)

If an error occurs during writing, you might get an indication for why by checking the error message.

Parameters
[in]self- self
Returns
the error message (will be an empty string if nothing to report).

◆ VpOdimIO_getVersion()

RaveIO_ODIM_Version VpOdimIO_getVersion ( VpOdimIO_t * self)

Returns the version that this io class handles.

Parameters
[in]self- self
Returns
- the odim version

◆ VpOdimIO_isStrict()

int VpOdimIO_isStrict ( VpOdimIO_t * self)

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.

Parameters
[in]self- self
Returns
if writing should be performed strictly or not

◆ VpOdimIO_read()

int VpOdimIO_read ( VpOdimIO_t * self,
LazyNodeListReader_t * lazyReader,
VerticalProfile_t * vp )

Reads a vp from the nodelist and sets the data in the vp.

Parameters
[in]self- self
[in]nodelist- the hdf5 node list
[in]vp- the vertical profile that should get the attribute and data set
Returns
1 on success otherwise 0

◆ VpOdimIO_setStrict()

void VpOdimIO_setStrict ( VpOdimIO_t * self,
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.

Parameters
[in]self- self
[in]strict- if writing should be performed strictly or not

◆ VpOdimIO_setVersion()

void VpOdimIO_setVersion ( VpOdimIO_t * self,
RaveIO_ODIM_Version version )

Sets the version that this io class should handle.

Parameters
[in]self- self
[in]version- the odim version

◆ VpOdimIO_validateVpHowAttributes()

int VpOdimIO_validateVpHowAttributes ( VpOdimIO_t * self,
VerticalProfile_t * vp )

Validates a vertical profile according to strictness and version in order to verify if it contains necessary information.

Parameters
[in]self- self
[in]vp- the vertical profile to validate
Returns
1 if valid otherwise 0

Variable Documentation

◆ VpOdimIO_TYPE

RaveCoreObjectType VpOdimIO_TYPE
Initial value:
= {
"VpOdimIO",
sizeof(VpOdimIO_t),
VpOdimIO_constructor,
VpOdimIO_destructor,
VpOdimIO_copyconstructor
}
struct _VpOdimIO_t VpOdimIO_t
Defines the odim h5 adaptor for vp products.
Definition vp_odim_io.h:36

Type definition to use when creating a rave object.