RAVE
acqva.h File Reference

Provides functionality for creating composites according to the acqva method. More...

#include "rave_object.h"
#include "rave_types.h"
#include "cartesian.h"
#include "area.h"
#include "raveobject_hashtable.h"
#include "limits.h"

Go to the source code of this file.

Macros

#define ACQVA_QUALITY_FIELDS_GAIN   (1.0/UCHAR_MAX)
 
#define ACQVA_QUALITY_FIELDS_OFFSET   0.0
 

Typedefs

typedef struct _Acqva_t Acqva_t
 Defines a Acqva composite generator.
 

Functions

int Acqva_add (Acqva_t *self, RaveCoreObject *object)
 Adds one RaveCoreObject.
 
int Acqva_getNumberOfObjects (Acqva_t *self)
 Returns the number of objects this composite will process.
 
RaveCoreObjectAcqva_get (Acqva_t *self, int index)
 Return the object at position index.
 
int Acqva_getRadarIndexValue (Acqva_t *self, int index)
 Return the radar index value that has been assigned to the object as position index.
 
int Acqva_addParameter (Acqva_t *self, const char *quantity, double gain, double offset)
 Adds a parameter to be processed.
 
int Acqva_hasParameter (Acqva_t *self, const char *quantity)
 Returns if this composite generator is going to process specified parameter.
 
int Acqva_getParameterCount (Acqva_t *self)
 Returns the number of parameters to be processed.
 
const char * Acqva_getParameter (Acqva_t *self, int index, double *gain, double *offset)
 Returns the parameter at specified index.
 
int Acqva_setTime (Acqva_t *self, const char *value)
 Sets the nominal time.
 
const char * Acqva_getTime (Acqva_t *self)
 Returns the nominal time.
 
int Acqva_setDate (Acqva_t *self, const char *value)
 Sets the nominal date.
 
const char * Acqva_getDate (Acqva_t *self)
 Returns the nominal date.
 
int Acqva_applyRadarIndexMapping (Acqva_t *self, RaveObjectHashTable_t *mapping)
 If you want the objects included in the composite to have a specific index value when generating the quality field se.smhi.composite.index.radar, then you can provide a hash table that maps source with a RaveAttribute_t containing a long value.
 
Cartesian_tAcqva_generate (Acqva_t *self, Area_t *area, RaveList_t *qualityflags)
 Generates a composite according to the configured parameters in the composite structure.
 

Variables

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

Detailed Description

Provides functionality for creating composites according to the acqva method.

Author
Anders Henja (Swedish Meteorological and Hydrological Institute, SMHI)
Date
2024-01-17

Typedef Documentation

◆ Acqva_t

typedef struct _Acqva_t Acqva_t

Defines a Acqva composite generator.

Function Documentation

◆ Acqva_add()

int Acqva_add ( Acqva_t * self,
RaveCoreObject * object )

Adds one RaveCoreObject.

The only supported types are volumes (& possibly scans) due to the nature of the algorithm.

Parameters
[in]self- self
[in]object- the item to be added to the composite
Returns
1 on success, otherwise 0

◆ Acqva_addParameter()

int Acqva_addParameter ( Acqva_t * self,
const char * quantity,
double gain,
double offset )

Adds a parameter to be processed.

Parameters
[in]self- self
[in]quantity- the parameter quantity
[in]gain- the gain to be used for the parameter
[in]offset- the offset to be used for the parameter
Returns
1 on success

◆ Acqva_applyRadarIndexMapping()

int Acqva_applyRadarIndexMapping ( Acqva_t * self,
RaveObjectHashTable_t * mapping )

If you want the objects included in the composite to have a specific index value when generating the quality field se.smhi.composite.index.radar, then you can provide a hash table that maps source with a RaveAttribute_t containing a long value.

The source should be the full source as defined in the added objects. The indexes must be unique values, preferrably starting from 1. If there is a mapping missing, the default behaviour is to take first available integer closest to 1.

Note, that in order to the mapping to take, this call must be performed after all the objects has been added to the generator and before calling Acqva_generate.

Parameters
[in]self- self
[in]mapping- the source - index mapping
Returns
1 on success, otherwise 0.

◆ Acqva_generate()

Cartesian_t * Acqva_generate ( Acqva_t * self,
Area_t * area,
RaveList_t * qualityflags )

Generates a composite according to the configured parameters in the composite structure.

Parameters
[in]self- self
[in]area- the area that should be used for defining the composite.
[in]qualityflags- A list of char pointers identifying how/task values in the quality fields of the polar data. Each entry in this list will result in the atempt to generate a corresponding quality field in the resulting cartesian product. (MAY BE NULL)
Returns
the generated composite.

◆ Acqva_get()

RaveCoreObject * Acqva_get ( Acqva_t * self,
int index )

Return the object at position index.

Parameters
[in]self- self
[in]index- the index, should be >= 0 and < getNumberOfObjects
Returns
the object or NULL if outside range

◆ Acqva_getDate()

const char * Acqva_getDate ( Acqva_t * self)

Returns the nominal date.

Parameters
[in]self- self
Returns
the nominal time (or NULL if there is none)

◆ Acqva_getNumberOfObjects()

int Acqva_getNumberOfObjects ( Acqva_t * self)

Returns the number of objects this composite will process.

Parameters
[in]self- self
Returns
the number of objects

◆ Acqva_getParameter()

const char * Acqva_getParameter ( Acqva_t * self,
int index,
double * gain,
double * offset )

Returns the parameter at specified index.

Parameters
[in]self- self
[in]index- the index
[out]gain- the gain to be used for the parameter (MAY BE NULL)
[out]offset- the offset to be used for the parameter (MAY BE NULL)
Returns
the parameter name

◆ Acqva_getParameterCount()

int Acqva_getParameterCount ( Acqva_t * self)

Returns the number of parameters to be processed.

Parameters
[in]self- self
Returns
the number of parameters

◆ Acqva_getRadarIndexValue()

int Acqva_getRadarIndexValue ( Acqva_t * self,
int index )

Return the radar index value that has been assigned to the object as position index.

Parameters
[in]self- self
[in]index- the index, should be >= 0 and < getNumberOfObjects
Returns
the radar index or 0 if no index has been assigned yet.

◆ Acqva_getTime()

const char * Acqva_getTime ( Acqva_t * self)

Returns the nominal time.

Parameters
[in]self- self
Returns
the nominal time (or NULL if there is none)

◆ Acqva_hasParameter()

int Acqva_hasParameter ( Acqva_t * self,
const char * quantity )

Returns if this composite generator is going to process specified parameter.

Parameters
[in]self- self
[in]quantity- the parameter quantity
Returns
1 if yes otherwise 0

◆ Acqva_setDate()

int Acqva_setDate ( Acqva_t * self,
const char * value )

Sets the nominal date.

Parameters
[in]self- self
[in]value- the date in the format YYYYMMDD
Returns
1 on success, otherwise 0

◆ Acqva_setTime()

int Acqva_setTime ( Acqva_t * self,
const char * value )

Sets the nominal time.

Parameters
[in]self- self
[in]value- the time in the format HHmmss
Returns
1 on success, otherwise 0

Variable Documentation

◆ Acqva_TYPE

RaveCoreObjectType Acqva_TYPE
extern

Type definition to use when creating a rave object.