RAVE
|
Provides a base engine for creating composites. More...
#include "compositeengine.h"
#include "composite_utils.h"
#include "compositearguments.h"
#include "polarvolume.h"
#include "rave_properties.h"
#include "raveobject_hashtable.h"
#include "raveobject_list.h"
#include "rave_types.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 | _CompositeEngine_t |
Represents the cartesian product. More... | |
struct | CompositeEnginePolarValueFunction_t |
The class definition. More... | |
Typedefs | |
typedef struct CompositeEnginePolarValueFunction_t | CompositeEnginePolarValueFunction_t |
The class definition. | |
Functions | |
int | CompositeEngine_setOnStartingFunction (CompositeEngine_t *self, composite_engine_onStarting_fun onStarting) |
Sets the on starting function. | |
int | CompositeEngine_setOnFinishedFunction (CompositeEngine_t *self, composite_engine_onFinished_fun onFinished) |
Sets the on finished function. | |
int | CompositeEngine_setLonLatFunction (CompositeEngine_t *self, composite_engine_getLonLat_fun getLonLat) |
Sets the lon-lat function. | |
int | CompositeEngine_setSelectRadarDataFunction (CompositeEngine_t *self, composite_engine_selectRadarData_fun selectRadarData) |
Sets the select radar data function. | |
int | CompositeEngine_setDefaultPolarValueAtPositionFunction (CompositeEngine_t *self, composite_engine_getPolarValueAtPosition_fun getPolarValueAtPosition) |
Sets the default polarValueAtPosition function,. | |
int | CompositeEngine_registerPolarValueAtPositionFunction (CompositeEngine_t *self, const char *quantity, composite_engine_getPolarValueAtPosition_fun getPolarValueAtPosition) |
Registers a polar value at position function for the specified quantity. | |
int | CompositeEngine_setSetRadarDataFunction (CompositeEngine_t *self, composite_engine_setRadarData_fun setRadarData) |
Sets the set radar data function. | |
int | CompositeEngine_setAddQualityFlagsToCartesianFunction (CompositeEngine_t *self, composite_engine_addQualityFlagsToCartesian_fun addQualityFlagsToCartesian) |
Sets the add quality flags to cartesian that will add the quality flags to the cartesian product. | |
int | CompositeEngine_setGetQualityValueFunction (CompositeEngine_t *self, composite_engine_getQualityValue_fun getQualityValue) |
The get quality value function. | |
int | CompositeEngine_setFillQualityInformationFunction (CompositeEngine_t *self, composite_engine_fillQualityInformation_fun fillQualityInformation) |
The fill quality information function. | |
int | CompositeEngineFunction_onStarting (CompositeEngine_t *self, void *extradata, CompositeArguments_t *arguments, CompositeEngineObjectBinding_t *bindings, int nbindings) |
Delegates to the onStarting function pointer. | |
int | CompositeEngineFunction_onFinished (CompositeEngine_t *self, void *extradata, CompositeArguments_t *arguments, CompositeEngineObjectBinding_t *bindings, int nbindings) |
Delegates to the onFinished function pointer. | |
int | CompositeEngineFunction_getLonLat (CompositeEngine_t *self, void *extradata, CompositeEngineObjectBinding_t *binding, double herex, double herey, double *olon, double *olat) |
This delegates the call to the set lon-lat function. | |
int | CompositeEngineFunction_selectRadarData (CompositeEngine_t *self, void *extradata, CompositeArguments_t *arguments, CompositeEngineObjectBinding_t *binding, int index, double olon, double olat, CompositeEngineRadarData_t *cvalues, int ncvalues) |
int | CompositeEngineFunction_getPolarValueAtPosition (CompositeEngine_t *self, void *extradata, CompositeArguments_t *arguments, CompositeEngineObjectBinding_t *binding, const char *quantity, PolarNavigationInfo *navinfo, const char *qiFieldName, RaveValueType *otype, double *ovalue, double *qivalue) |
int | CompositeEngineFunction_setRadarData (CompositeEngine_t *self, void *extradata, CompositeArguments_t *arguments, Cartesian_t *cartesian, double olon, double olat, long x, long y, CompositeEngineRadarData_t *cvalues, int ncvalues) |
int | CompositeEngineFunction_addQualityFlagsToCartesian (CompositeEngine_t *self, void *extradata, CompositeArguments_t *arguments, Cartesian_t *cartesian) |
Adds the quality flags to the cartesian product. | |
int | CompositeEngineFunction_getQualityValue (CompositeEngine_t *self, void *extradata, CompositeArguments_t *args, RaveCoreObject *obj, const char *quantity, const char *qfieldname, PolarNavigationInfo *navinfo, double *v) |
Returns the quality value at specified polar navigation info. | |
int | CompositeEngineFunction_fillQualityInformation (CompositeEngine_t *self, void *extradata, CompositeArguments_t *arguments, long x, long y, CartesianParam_t *param, double radardist, int radarindex, PolarNavigationInfo *info) |
Fills the quality information into the product. | |
int | CompositeEngineUtility_getLonLat (CompositeEngine_t *engine, CompositeEngineObjectBinding_t *binding, double herex, double herey, double *olon, double *olat) |
Calculates the lon/lat coordinate using the provided pipeline. | |
int | CompositeEngineUtility_selectRadarData (CompositeEngine_t *engine, void *extradata, CompositeArguments_t *arguments, CompositeEngineObjectBinding_t *binding, int index, double olon, double olat, CompositeEngineRadarData_t *cvalues, int ncvalues) |
Fetches the radar data for specified position using NEAREST. | |
int | CompositeEngineUtility_getPolarValueAtPosition (CompositeEngine_t *engine, void *extradata, CompositeArguments_t *arguments, CompositeEngineObjectBinding_t *binding, const char *quantity, PolarNavigationInfo *navinfo, const char *qiFieldName, RaveValueType *otype, double *ovalue, double *qivalue) |
Fetches the polar value from specified position for specified quantity. | |
int | CompositeEngineUtility_setRadarData (CompositeEngine_t *engine, void *extradata, CompositeArguments_t *arguments, Cartesian_t *cartesian, double olon, double olat, long x, long y, CompositeEngineRadarData_t *cvalues, int ncvalues) |
Sets the radar data for specified position using NEAREST. | |
int | CompositeEngineUtility_addQualityFlagsToCartesian (CompositeEngine_t *engine, CompositeArguments_t *arguments, Cartesian_t *cartesian) |
Creates the quality fields in the cartesian product using arguments and default parameters. | |
int | CompositeEngineUtility_fillQualityInformation (CompositeEngine_t *self, void *extradata, CompositeArguments_t *arguments, long x, long y, CartesianParam_t *param, double radardist, int radarindex, PolarNavigationInfo *navinfo) |
Fills the quality information for the provided parameter. | |
void | CompositeEngine_setProperties (CompositeEngine_t *self, RaveProperties_t *properties) |
Sets the properties in this engine. | |
RaveProperties_t * | CompositeEngine_getProperties (CompositeEngine_t *self) |
int | CompositeEngine_registerQualityFlagDefinition (CompositeEngine_t *self, CompositeQualityFlagDefinition_t *definition) |
Registers a definition for a quality flag so that correct datatype, offset and gain are used. | |
Cartesian_t * | CompositeEngine_generate (CompositeEngine_t *self, CompositeArguments_t *arguments, void *extradata) |
Generates the composite using a basic approach. | |
CompositeEngineRadarData_t * | CompositeEngineUtility_createRadarData (CompositeArguments_t *arguments, Cartesian_t *cartesian, int *nentries) |
Creates an array of CompositeEngineRadarData_t. | |
void | CompositeEngineUtility_resetRadarData (CompositeArguments_t *arguments, CompositeEngineRadarData_t *cvalues, int nentries) |
Resets the array of CompositeEngineRadarData_t except the CartesianParam parameter. | |
void | CompositeEngineUtility_freeRadarData (CompositeEngineRadarData_t **cvalues, int nparam) |
Frees the CompositeEngineRadarData_t and ensures that all associated parameters are released. | |
Variables | |
RaveCoreObjectType | CompositeEnginePolarValueFunction_TYPE |
RaveCoreObjectType | CompositeEngine_TYPE |
Type definition to use when creating a rave object. | |
Provides a base engine for creating composites.
typedef struct CompositeEnginePolarValueFunction_t CompositeEnginePolarValueFunction_t |
The class definition.
Cartesian_t * CompositeEngine_generate | ( | CompositeEngine_t * | self, |
CompositeArguments_t * | arguments, | ||
void * | extradata ) |
Generates the composite using a basic approach.
RaveProperties_t * CompositeEngine_getProperties | ( | CompositeEngine_t * | self | ) |
[in] | self | - self |
int CompositeEngine_registerPolarValueAtPositionFunction | ( | CompositeEngine_t * | self, |
const char * | quantity, | ||
composite_engine_getPolarValueAtPosition_fun | getPolarValueAtPosition ) |
Registers a polar value at position function for the specified quantity.
This is using the composite utils definition in order to speed up calls instead of looking up for each quantity. This function will use navinfo to retrieve data from wanted position. If getPolarValueAtPosition is NULL, the mapping is removed.
[in] | self | - self |
[in] | quantity | - the quantity that should trigger this call (can be NULL) |
[in] | getPolarValueAtPosition | - the function that will be called for the specified quantity |
int CompositeEngine_registerQualityFlagDefinition | ( | CompositeEngine_t * | self, |
CompositeQualityFlagDefinition_t * | definition ) |
Registers a definition for a quality flag so that correct datatype, offset and gain are used.
[in] | self | - self |
[in] | definition | - the definition |
int CompositeEngine_setAddQualityFlagsToCartesianFunction | ( | CompositeEngine_t * | self, |
composite_engine_addQualityFlagsToCartesian_fun | addQualityFlagsToCartesian ) |
Sets the add quality flags to cartesian that will add the quality flags to the cartesian product.
int CompositeEngine_setDefaultPolarValueAtPositionFunction | ( | CompositeEngine_t * | self, |
composite_engine_getPolarValueAtPosition_fun | getPolarValueAtPosition ) |
Sets the default polarValueAtPosition function,.
[in] | self | - self |
[in] | getPolarValueAtPosition | - the function that will be called for the specified quantity |
int CompositeEngine_setFillQualityInformationFunction | ( | CompositeEngine_t * | self, |
composite_engine_fillQualityInformation_fun | fillQualityInformation ) |
The fill quality information function.
int CompositeEngine_setGetQualityValueFunction | ( | CompositeEngine_t * | self, |
composite_engine_getQualityValue_fun | getQualityValue ) |
The get quality value function.
int CompositeEngine_setLonLatFunction | ( | CompositeEngine_t * | self, |
composite_engine_getLonLat_fun | getLonLat ) |
Sets the lon-lat function.
Default is to use standard vol/scan information.
int CompositeEngine_setOnFinishedFunction | ( | CompositeEngine_t * | self, |
composite_engine_onFinished_fun | onFinished ) |
Sets the on finished function.
int CompositeEngine_setOnStartingFunction | ( | CompositeEngine_t * | self, |
composite_engine_onStarting_fun | onStarting ) |
Sets the on starting function.
void CompositeEngine_setProperties | ( | CompositeEngine_t * | self, |
RaveProperties_t * | properties ) |
Sets the properties in this engine.
[in] | self | - self |
[in] | properties | - the properties to use |
int CompositeEngine_setSelectRadarDataFunction | ( | CompositeEngine_t * | self, |
composite_engine_selectRadarData_fun | selectRadarData ) |
Sets the select radar data function.
Default is to use standard nearest information.
int CompositeEngine_setSetRadarDataFunction | ( | CompositeEngine_t * | self, |
composite_engine_setRadarData_fun | setRadarData ) |
Sets the set radar data function.
Default is to set data and quality information.
int CompositeEngineFunction_addQualityFlagsToCartesian | ( | CompositeEngine_t * | self, |
void * | extradata, | ||
CompositeArguments_t * | arguments, | ||
Cartesian_t * | cartesian ) |
Adds the quality flags to the cartesian product.
[in] | self | - self |
[in] | extradata | - the extradata, normally the calling instance |
[in] | arguments | - the arguments |
[in] | cartesian | - the cartesian object to write to |
int CompositeEngineFunction_fillQualityInformation | ( | CompositeEngine_t * | self, |
void * | extradata, | ||
CompositeArguments_t * | arguments, | ||
long | x, | ||
long | y, | ||
CartesianParam_t * | param, | ||
double | radardist, | ||
int | radarindex, | ||
PolarNavigationInfo * | info ) |
Fills the quality information into the product.
[in] | self | - self |
[in] | extradata | - the extradata, normally the calling instance |
[in] | arguments | - the arguments |
[in] | x | - the x position in the cartesian parameter |
[in] | y | - the y position in the cartesian parameter |
[in] | radardist | - the distance to the radar |
[in] | radarindex | - index of radar affecting this position |
int CompositeEngineFunction_getLonLat | ( | CompositeEngine_t * | self, |
void * | extradata, | ||
CompositeEngineObjectBinding_t * | binding, | ||
double | herex, | ||
double | herey, | ||
double * | olon, | ||
double * | olat ) |
This delegates the call to the set lon-lat function.
[in] | self | - self |
[in] | extradata | - the extradata, normally the calling instance |
[in] | binding | - the object binding to use for getting lon/lat |
[in] | herex | - cartesian surface x |
[in] | herey | - cartesian surface y |
[out] | olon | - the longitude |
[out] | olat | - the latitude |
int CompositeEngineFunction_getPolarValueAtPosition | ( | CompositeEngine_t * | self, |
void * | extradata, | ||
CompositeArguments_t * | arguments, | ||
CompositeEngineObjectBinding_t * | binding, | ||
const char * | quantity, | ||
PolarNavigationInfo * | navinfo, | ||
const char * | qiFieldName, | ||
RaveValueType * | otype, | ||
double * | ovalue, | ||
double * | qivalue ) |
[in] | self | - self |
[in] | extradata | - the extradata, normally the calling instance |
[in] | arguments | - the arguments |
[in] | binding | - the object binding |
[in] | quantity | - the parameter from which to get the value |
[in] | navinfo | - the polar navigation info of value |
[in] | qiFieldName | - if a quality value should be fetched at same time |
[out] | otype | - value type of value found |
[out] | ovalue | - the value |
[out] | qivalue | - the quality value if requested. |
int CompositeEngineFunction_getQualityValue | ( | CompositeEngine_t * | self, |
void * | extradata, | ||
CompositeArguments_t * | args, | ||
RaveCoreObject * | obj, | ||
const char * | quantity, | ||
const char * | qfieldname, | ||
PolarNavigationInfo * | navinfo, | ||
double * | v ) |
Returns the quality value at specified polar navigation info.
[in] | self | - self |
[in] | extradata | - the extradata, normally the calling instance |
[in] | args | - the arguments |
[in] | obj | - the object from which to pick the value |
[in] | quantity | - the parameter from which to pick value |
[in] | qfieldname | - the how/task value of the quality field |
[in] | navinfo | - the polar navigation info |
[out] | v | - the found quality value |
int CompositeEngineFunction_onFinished | ( | CompositeEngine_t * | self, |
void * | extradata, | ||
CompositeArguments_t * | arguments, | ||
CompositeEngineObjectBinding_t * | bindings, | ||
int | nbindings ) |
Delegates to the onFinished function pointer.
[in] | self | - self |
[in] | extradata | - the extradata, normally the calling instance |
[in] | arguments | - the arguments |
[in] | bindings | - the object binding array |
[in] | nbindings | - the number of objects in the array |
int CompositeEngineFunction_onStarting | ( | CompositeEngine_t * | self, |
void * | extradata, | ||
CompositeArguments_t * | arguments, | ||
CompositeEngineObjectBinding_t * | bindings, | ||
int | nbindings ) |
Delegates to the onStarting function pointer.
[in] | self | - self |
[in] | extradata | - the extradata, normally the calling instance |
[in] | arguments | - the arguments |
[in] | bindings | - the bindings |
[in] | nbindings | - number of bindings |
int CompositeEngineFunction_selectRadarData | ( | CompositeEngine_t * | self, |
void * | extradata, | ||
CompositeArguments_t * | arguments, | ||
CompositeEngineObjectBinding_t * | binding, | ||
int | index, | ||
double | olon, | ||
double | olat, | ||
CompositeEngineRadarData_t * | cvalues, | ||
int | ncvalues ) |
[in] | self | - self |
[in] | extradata | - the extradata, normally the calling instance |
[in] | arguments | - the arguments |
[in] | binding | - the object binding to use for getting the data |
[in] | index | - index of the object in the list (used for radarindexing) |
[in] | olon | - the longitude |
[in] | olat | - the latitude |
[in,out] | cvalues | - the composite values that should be filled in |
[in] | ncvalues | - number of values in cvalues |
int CompositeEngineFunction_setRadarData | ( | CompositeEngine_t * | self, |
void * | extradata, | ||
CompositeArguments_t * | arguments, | ||
Cartesian_t * | cartesian, | ||
double | olon, | ||
double | olat, | ||
long | x, | ||
long | y, | ||
CompositeEngineRadarData_t * | cvalues, | ||
int | ncvalues ) |
[in] | self | - self |
[in] | extradata | - the extradata, normally the calling instance |
[in] | arguments | - the arguments |
[in] | cartesian | - the cartesian object to write to |
[in] | olon | - the longitude |
[in] | olat | - the latitude |
[in] | x | - x coordinate in cartesian |
[in] | y | - y coordinate in cartesian |
[in,out] | cvalues | - the composite values that should be filled in |
[in] | ncvalues | - number of values in cvalues |
int CompositeEngineUtility_addQualityFlagsToCartesian | ( | CompositeEngine_t * | engine, |
CompositeArguments_t * | arguments, | ||
Cartesian_t * | cartesian ) |
Creates the quality fields in the cartesian product using arguments and default parameters.
The default configuration for the quality flags is: static CompositeQualityFlagSettings_t COMPOSITE_ENGINE_QUALITY_FLAG_DEFINITIONS[] = { {COMPOSITE_ENGINE_DISTANCE_TO_RADAR_HOW_TASK, RaveDataType_UCHAR, 0.0, COMPOSITE_ENGINE_DISTANCE_TO_RADAR_RESOLUTION}, {COMPOSITE_ENGINE_HEIGHT_ABOVE_SEA_HOW_TASK, RaveDataType_UCHAR, 0.0, COMPOSITE_ENGINE_HEIGHT_RESOLUTION}, {COMPOSITE_ENGINE_RADAR_INDEX_HOW_TASK, RaveDataType_UCHAR, 0.0, 1.0}, {NULL, RaveDataType_UNDEFINED, 0.0, 0.0} };
[in] | engine | - the engine |
[in] | arguments | - the arguments |
[in] | cartesian | - the cartesian to fill |
CompositeEngineRadarData_t * CompositeEngineUtility_createRadarData | ( | CompositeArguments_t * | arguments, |
Cartesian_t * | cartesian, | ||
int * | nentries ) |
Creates an array of CompositeEngineRadarData_t.
The array length will be the same as number of parameters and the parameter in the struct will be associated with corresponding parameter in the cartesian product.
[in] | arguments | - the arguments structure |
[in] | cartesian | - the cartesian that was created from the arguments |
[in] | nentries | - number of entries in the returned array |
int CompositeEngineUtility_fillQualityInformation | ( | CompositeEngine_t * | self, |
void * | extradata, | ||
CompositeArguments_t * | arguments, | ||
long | x, | ||
long | y, | ||
CartesianParam_t * | param, | ||
double | radardist, | ||
int | radarindex, | ||
PolarNavigationInfo * | navinfo ) |
Fills the quality information for the provided parameter.
[in] | self | - the engine |
[in] | extradata | - the extradata, typically the data passed to the generate function. |
[in] | arguments | - the arguments |
[in] | x | - the x position in cartesian |
[in] | y | - the y position in cartesian |
[in] | param | - the cartesian parameter to fill |
[in] | radardist | - the distance to the radar for the specified point |
[in] | radarindex | - the radar index in list of objects affected |
[in] | navinfo | - the navigation info used |
void CompositeEngineUtility_freeRadarData | ( | CompositeEngineRadarData_t ** | cvalues, |
int | nparam ) |
Frees the CompositeEngineRadarData_t and ensures that all associated parameters are released.
[in,out] | cvalues | - the cvalue struct. |
[in] | nparam | - number of entries in the array |
int CompositeEngineUtility_getLonLat | ( | CompositeEngine_t * | engine, |
CompositeEngineObjectBinding_t * | binding, | ||
double | herex, | ||
double | herey, | ||
double * | olon, | ||
double * | olat ) |
Calculates the lon/lat coordinate using the provided pipeline.
[in] | engine | - the engine |
[in] | binding | - the object binding |
[in] | herex | - the x surface coordinate |
[in] | herey | - the y surface coordinate |
[out] | olon | - the longitude in radians |
[out] | olat | - the latitude in radians |
int CompositeEngineUtility_getPolarValueAtPosition | ( | CompositeEngine_t * | engine, |
void * | extradata, | ||
CompositeArguments_t * | arguments, | ||
CompositeEngineObjectBinding_t * | binding, | ||
const char * | quantity, | ||
PolarNavigationInfo * | navinfo, | ||
const char * | qiFieldName, | ||
RaveValueType * | otype, | ||
double * | ovalue, | ||
double * | qivalue ) |
Fetches the polar value from specified position for specified quantity.
void CompositeEngineUtility_resetRadarData | ( | CompositeArguments_t * | arguments, |
CompositeEngineRadarData_t * | cvalues, | ||
int | nentries ) |
Resets the array of CompositeEngineRadarData_t except the CartesianParam parameter.
[in] | arguments | - the arguments structure |
[in] | cvalues | - pointer at the array |
[in] | nentries | - number of entries |
int CompositeEngineUtility_selectRadarData | ( | CompositeEngine_t * | engine, |
void * | extradata, | ||
CompositeArguments_t * | arguments, | ||
CompositeEngineObjectBinding_t * | binding, | ||
int | index, | ||
double | olon, | ||
double | olat, | ||
CompositeEngineRadarData_t * | cvalues, | ||
int | ncvalues ) |
Fetches the radar data for specified position using NEAREST.
[in] | engine | - the engine |
[in] | arguments | - the arguments |
[in] | binding | - the object binding |
[in] | index | - the index in object list (this has to be set in order to get proper radar indexing) |
[out] | olon | - the longitude in radians |
[out] | olat | - the latitude in radians |
[in,out] | cvalues | - the composite parameter values |
[in] | ncvalues | - number of entries in cvalues |
int CompositeEngineUtility_setRadarData | ( | CompositeEngine_t * | engine, |
void * | extradata, | ||
CompositeArguments_t * | arguments, | ||
Cartesian_t * | cartesian, | ||
double | olon, | ||
double | olat, | ||
long | x, | ||
long | y, | ||
CompositeEngineRadarData_t * | cvalues, | ||
int | ncvalues ) |
Sets the radar data for specified position using NEAREST.
Will also invoke fillQualityInformation function.
[in] | engine | - the engine |
[in] | extradata | - the extradata passed to the fillQualityInformation |
[in] | arguments | - the arguments |
[in] | cartesian | - the cartesian to fill |
[in] | olon | - the longitude in radians |
[in] | olat | - the latitude in radians |
[in] | x | - the x position in cartesian |
[in] | y | - the y position in cartesian |
[in] | cvalues | - the composite parameter values |
[in] | ncvalues | - number of entries in cvalues |
We don't want to calculate vertical max for each overlapping object so we locate vertical max in setter instead
RaveCoreObjectType CompositeEngine_TYPE |
Type definition to use when creating a rave object.
RaveCoreObjectType CompositeEnginePolarValueFunction_TYPE |