RAVE
acqva.c File Reference

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

#include "acqva.h"
#include "cartesianparam.h"
#include "polarscan.h"
#include "polarvolume.h"
#include "rave_object.h"
#include "rave_types.h"
#include "raveobject_list.h"
#include "rave_debug.h"
#include "rave_alloc.h"
#include "rave_datetime.h"
#include "projection_pipeline.h"
#include <string.h>
#include "rave_field.h"
#include <float.h>
#include <stdio.h>
#include <math.h>

Classes

struct  _Acqva_t
 Represents the cartesian product. More...
 
struct  AcqvaCompositeRadarItem
 
struct  AcqvaCompositingParameter_t
 Structure for keeping track on parameters that should be composited. More...
 
struct  AcqvaCompositeValuePosition_t
 Structure for holding information regarding a specific position and values connected with it. More...
 
struct  AcqvaCompositeValues_t
 Structure for keeping track on values / parameter. More...
 

Macros

#define DISTANCE_TO_RADAR_RESOLUTION   2000.0
 The resolution to use for scaling the distance from pixel to used radar.
 
#define HEIGHT_RESOLUTION   100.0
 Same for height, scaled to 100 m resolution up to 25.5 km.
 
#define DISTANCE_TO_RADAR_HOW_TASK   "se.smhi.composite.distance.radar"
 The name of the task for specifying distance to radar.
 
#define HEIGHT_ABOVE_SEA_HOW_TASK   "se.smhi.composite.height.radar"
 The name of the task for specifying height above sea level.
 
#define RADAR_INDEX_HOW_TASK   "se.smhi.composite.index.radar"
 The name of the task for indexing the radars used.
 

Typedefs

typedef struct AcqvaCompositeRadarItem AcqvaCompositeRadarItem_t
 
typedef struct AcqvaCompositingParameter_t AcqvaCompositingParameter_t
 Structure for keeping track on parameters that should be composited.
 
typedef struct AcqvaCompositeValuePosition_t AcqvaCompositeValuePosition_t
 Structure for holding information regarding a specific position and values connected with it.
 
typedef struct AcqvaCompositeValues_t AcqvaCompositeValues_t
 Structure for keeping track on values / parameter.
 

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.
 
int Acqva_findLowestUsableValue (Acqva_t *self, PolarVolume_t *pvol, double lon, double lat, const char *qfieldname, double *height, double *elangle, int *ray, int *bin, int *eindex, PolarNavigationInfo *outnavinfo)
 
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

Macro Definition Documentation

◆ DISTANCE_TO_RADAR_HOW_TASK

#define DISTANCE_TO_RADAR_HOW_TASK   "se.smhi.composite.distance.radar"

The name of the task for specifying distance to radar.

◆ DISTANCE_TO_RADAR_RESOLUTION

#define DISTANCE_TO_RADAR_RESOLUTION   2000.0

The resolution to use for scaling the distance from pixel to used radar.

By multiplying the values in the distance field by 2000, we get the value in unit meters.

◆ HEIGHT_ABOVE_SEA_HOW_TASK

#define HEIGHT_ABOVE_SEA_HOW_TASK   "se.smhi.composite.height.radar"

The name of the task for specifying height above sea level.

◆ HEIGHT_RESOLUTION

#define HEIGHT_RESOLUTION   100.0

Same for height, scaled to 100 m resolution up to 25.5 km.

◆ RADAR_INDEX_HOW_TASK

#define RADAR_INDEX_HOW_TASK   "se.smhi.composite.index.radar"

The name of the task for indexing the radars used.

Typedef Documentation

◆ AcqvaCompositeValuePosition_t

typedef struct AcqvaCompositeValuePosition_t AcqvaCompositeValuePosition_t

Structure for holding information regarding a specific position and values connected with it.

◆ AcqvaCompositeValues_t

typedef struct AcqvaCompositeValues_t AcqvaCompositeValues_t

Structure for keeping track on values / parameter.

◆ AcqvaCompositingParameter_t

typedef struct AcqvaCompositingParameter_t AcqvaCompositingParameter_t

Structure for keeping track on parameters that should be composited.

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
Initial value:
= {
"Acqva",
sizeof(Acqva_t),
Acqva_constructor,
Acqva_destructor,
Acqva_copyconstructor
}
struct _Acqva_t Acqva_t
Defines a Acqva composite generator.
Definition acqva.h:41

Type definition to use when creating a rave object.