RAVE
|
The arguments that should be passed on to a composite generator. More...
#include "compositearguments.h"
#include "composite_utils.h"
#include "odim_source.h"
#include "rave_attribute.h"
#include "rave_datetime.h"
#include "rave_debug.h"
#include "rave_alloc.h"
#include "rave_list.h"
#include "rave_object.h"
#include "rave_types.h"
#include "rave_value.h"
#include "raveobject_hashtable.h"
#include "raveobject_list.h"
#include <string.h>
#include <strings.h>
#include <stdio.h>
Classes | |
struct | _CompositeArguments_t |
Represents the area. More... | |
struct | ProductTypeMapping_t |
Mapping between a product string and the Rave_ProductType which is a mapping to ODIM. More... | |
struct | CompositeArgumentParameter_t |
Structure for keeping track on parameters that should be composited. More... | |
struct | CompositeArgumentObjectEntry_t |
The object entry that is stored inside the arguments. More... | |
Typedefs | |
typedef struct ProductTypeMapping_t | ProductTypeMapping_t |
Mapping between a product string and the Rave_ProductType which is a mapping to ODIM. | |
typedef struct CompositeArgumentParameter_t | CompositeArgumentParameter_t |
Structure for keeping track on parameters that should be composited. | |
typedef struct CompositeArgumentObjectEntry_t | CompositeArgumentObjectEntry_t |
The object entry that is stored inside the arguments. | |
Functions | |
const char * | CompositeArguments_productToString (Rave_CompositingProduct product) |
Converts a method into a string. | |
Rave_CompositingProduct | CompositeArguments_stringToProduct (const char *product) |
Converts a string into a product. | |
int | CompositeArguments_setProduct (CompositeArguments_t *args, const char *product) |
Sets the compositing method to use when creating the composite. | |
const char * | CompositeArguments_getProduct (CompositeArguments_t *args) |
Returns the compositing product. | |
Rave_CompositingProduct | CompositeArguments_getCompositingProduct (CompositeArguments_t *args) |
If the product could be translated to a compositing product, this will be returned. | |
Rave_ProductType | CompositeArguments_getProductType (CompositeArguments_t *args) |
In some cases it is possible to translate a Rave_CompositingProduct into a Rave_ProductType. | |
int | CompositeArguments_setArea (CompositeArguments_t *args, Area_t *area) |
Sets the area to use when creating the composite. | |
Area_t * | CompositeArguments_getArea (CompositeArguments_t *args) |
Returns the area. | |
int | CompositeArguments_setTime (CompositeArguments_t *args, const char *value) |
Sets the nominal time. | |
const char * | CompositeArguments_getTime (CompositeArguments_t *args) |
Returns the nominal time. | |
int | CompositeArguments_setDate (CompositeArguments_t *args, const char *value) |
Sets the nominal date. | |
const char * | CompositeArguments_getDate (CompositeArguments_t *args) |
Returns the nominal date. | |
void | CompositeArguments_setHeight (CompositeArguments_t *args, double height) |
Sets the height that should be used when generating a composite. | |
double | CompositeArguments_getHeight (CompositeArguments_t *args) |
Returns the height that is used for composite generation. | |
void | CompositeArguments_setElevationAngle (CompositeArguments_t *args, double angle) |
Sets the elevation angle that should be used when generating a composite as PPI. | |
double | CompositeArguments_getElevationAngle (CompositeArguments_t *args) |
Returns the elevation angle that is used for composite generation. | |
void | CompositeArguments_setRange (CompositeArguments_t *args, double range) |
Sets the range that should be used when generating the Pseudo MAX. | |
double | CompositeArguments_getRange (CompositeArguments_t *args) |
Returns the range in meters. | |
int | CompositeArguments_setStrategy (CompositeArguments_t *args, const char *strategy) |
Sets the strategy id. | |
const char * | CompositeArguments_getStrategy (CompositeArguments_t *args) |
Returns the strategy. | |
int | CompositeArguments_addArgument (CompositeArguments_t *args, RaveAttribute_t *argument) |
Adds a rave attriargumentbute to the composite arguments. | |
void | CompositeArguments_removeArgument (CompositeArguments_t *args, const char *name) |
Removes the rave argument that is named accordingly. | |
RaveAttribute_t * | CompositeArguments_getArgument (CompositeArguments_t *args, const char *name) |
Returns the rave argument that is named accordingly. | |
int | CompositeArguments_hasArgument (CompositeArguments_t *args, const char *name) |
Returns if there is a rave argument that is named accordingly. | |
int | CompositeArguments_addParameter (CompositeArguments_t *args, const char *quantity, double gain, double offset, RaveDataType datatype, double nodata, double undetect) |
Adds a parameter to be processed. | |
int | CompositeArguments_hasParameter (CompositeArguments_t *args, const char *parameter) |
Returns if this composite generator is going to process specified parameter. | |
int | CompositeArguments_getParameter (CompositeArguments_t *args, const char *parameter, double *gain, double *offset, RaveDataType *datatype, double *nodata, double *undetect) |
Returns the parameter at specified index. | |
int | CompositeArguments_getParameterCount (CompositeArguments_t *args) |
Returns the number of parameters to be processed. | |
const char * | CompositeArguments_getParameterAtIndex (CompositeArguments_t *args, int index, double *gain, double *offset, RaveDataType *datatype, double *nodata, double *undetect) |
Returns the parameter at specified index. | |
const char * | CompositeArguments_getParameterName (CompositeArguments_t *args, int index) |
Returns the parameter name at specified index. | |
int | CompositeArguments_addObject (CompositeArguments_t *args, RaveCoreObject *object) |
Adds a rave object to the arguments. | |
int | CompositeArguments_getNumberOfObjects (CompositeArguments_t *args) |
Returns the number of objects. | |
RaveCoreObject * | CompositeArguments_getObject (CompositeArguments_t *args, int index) |
Returns the object at specified index. | |
RaveObjectList_t * | CompositeArguments_getObjects (CompositeArguments_t *args) |
param[in] args - self | |
int | CompositeArguments_setQIFieldName (CompositeArguments_t *args, const char *fieldname) |
If a quality field based algorithm is implemented, this field can be set to indicate what field to use. | |
const char * | CompositeArguments_getQIFieldName (CompositeArguments_t *args) |
Returns the name of the field to use when implementing a quality based compositing. | |
int | CompositeArguments_addQualityFlag (CompositeArguments_t *args, const char *flag) |
Adds a quality flag that should be generated during processing. | |
int | CompositeArguments_setQualityFlags (CompositeArguments_t *args, const char *flags[], int nrflags) |
Sets the quality flags that should be used. | |
int | CompositeArguments_getNumberOfQualityFlags (CompositeArguments_t *args) |
Returns the number of quality flags. | |
const char * | CompositeArguments_getQualityFlagAt (CompositeArguments_t *args, int index) |
Returns the name of the quality flag at specified position. | |
int | CompositeArguments_removeQualityFlag (CompositeArguments_t *args, const char *flag) |
Removes the quality flag with provided name. | |
int | CompositeArguments_removeQualityFlagAt (CompositeArguments_t *args, int index) |
Removes the quality flag at specified index. | |
RaveList_t * | CompositeArguments_getQualityFlags (CompositeArguments_t *args) |
Returns a full list of all set quality flags. | |
int | CompositeArguments_hasQualityFlag (CompositeArguments_t *args, const char *name) |
int | CompositeArguments_createRadarIndexMapping (CompositeArguments_t *args, OdimSources_t *sources) |
Creates the radar index mapping from the objects and the sources. | |
RaveObjectHashTable_t * | CompositeArguments_getRadarIndexMapping (CompositeArguments_t *args) |
Returns the radar index mapping. | |
int | CompositeArguments_updateRadarIndexMapping (CompositeArguments_t *args, RaveObjectHashTable_t *mapping, OdimSources_t *sources) |
Updates the radar index mapping. | |
RaveList_t * | CompositeArguments_getRadarIndexKeys (CompositeArguments_t *args) |
Returns the registered radar indexes. | |
int | CompositeArguments_getRadarIndexValue (CompositeArguments_t *args, const char *key) |
Returns the index for the specified key. | |
int | CompositeArguments_createRadarIndex (CompositeArguments_t *args, const char *key) |
Creates a radar index value for the specified key. | |
int | CompositeArguments_getObjectRadarIndexValue (CompositeArguments_t *args, int index) |
Returns the objects radar index at specified index. | |
Variables | |
RaveCoreObjectType | CompositeArgumentObjectEntry_TYPE |
A composite argument object entry that that keeps track of added objects. | |
RaveCoreObjectType | CompositeArguments_TYPE |
Type definition to use when creating a rave object. | |
The arguments that should be passed on to a composite generator.
typedef struct CompositeArgumentObjectEntry_t CompositeArgumentObjectEntry_t |
The object entry that is stored inside the arguments.
typedef struct CompositeArgumentParameter_t CompositeArgumentParameter_t |
Structure for keeping track on parameters that should be composited.
typedef struct ProductTypeMapping_t ProductTypeMapping_t |
Mapping between a product string and the Rave_ProductType which is a mapping to ODIM.
int CompositeArguments_addArgument | ( | CompositeArguments_t * | args, |
RaveAttribute_t * | argument ) |
Adds a rave attriargumentbute to the composite arguments.
instead.
[in] | args | - self |
[in] | argument | - the argument |
int CompositeArguments_addObject | ( | CompositeArguments_t * | args, |
RaveCoreObject * | object ) |
Adds a rave object to the arguments.
[in] | args | - self |
[in] | object | - a rave object. |
int CompositeArguments_addParameter | ( | CompositeArguments_t * | args, |
const char * | quantity, | ||
double | gain, | ||
double | offset, | ||
RaveDataType | datatype, | ||
double | nodata, | ||
double | undetect ) |
Adds a parameter to be processed.
[in] | args | - 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 |
[in] | datatype | - the type of data RaveDataType |
[in] | nodata | - the nodata value to use |
[in] | undetect | - the undetect value to use |
int CompositeArguments_addQualityFlag | ( | CompositeArguments_t * | args, |
const char * | flag ) |
Adds a quality flag that should be generated during processing.
[in] | args | - self |
[in] | flag | - the quality flag that should be passed on |
int CompositeArguments_createRadarIndex | ( | CompositeArguments_t * | args, |
const char * | key ) |
Creates a radar index value for the specified key.
If there already is a key the currently set index will be returned.
[in] | args | - self |
[in] | key | - the key |
int CompositeArguments_createRadarIndexMapping | ( | CompositeArguments_t * | args, |
OdimSources_t * | sources ) |
Creates the radar index mapping from the objects and the sources.
If no sources instance a best effort will be done creating the index mapping.
[in] | args | - self |
[in] | sources | - the odim sources |
Area_t * CompositeArguments_getArea | ( | CompositeArguments_t * | args | ) |
Returns the area.
[in] | args | - self |
RaveAttribute_t * CompositeArguments_getArgument | ( | CompositeArguments_t * | args, |
const char * | name ) |
Returns the rave argument that is named accordingly.
[in] | args | - self |
[in] | name | - the name of the argument |
Rave_CompositingProduct CompositeArguments_getCompositingProduct | ( | CompositeArguments_t * | args | ) |
If the product could be translated to a compositing product, this will be returned.
[in] | args | - self |
const char * CompositeArguments_getDate | ( | CompositeArguments_t * | args | ) |
Returns the nominal date.
[in] | args | - self |
double CompositeArguments_getElevationAngle | ( | CompositeArguments_t * | args | ) |
Returns the elevation angle that is used for composite generation.
[in] | args | - self |
double CompositeArguments_getHeight | ( | CompositeArguments_t * | args | ) |
Returns the height that is used for composite generation.
[in] | args | - self |
int CompositeArguments_getNumberOfObjects | ( | CompositeArguments_t * | args | ) |
Returns the number of objects.
[in] | args | - self |
int CompositeArguments_getNumberOfQualityFlags | ( | CompositeArguments_t * | args | ) |
Returns the number of quality flags.
[in] | args | - self |
RaveCoreObject * CompositeArguments_getObject | ( | CompositeArguments_t * | args, |
int | index ) |
Returns the object at specified index.
[in] | args | - self |
[in] | index | - position in list of objects |
int CompositeArguments_getObjectRadarIndexValue | ( | CompositeArguments_t * | args, |
int | index ) |
Returns the objects radar index at specified index.
Requires that radar mapping has been applied and that there exists some sort of mapping.
[in] | args | - self |
[in] | index | -position in list of objects |
RaveObjectList_t * CompositeArguments_getObjects | ( | CompositeArguments_t * | args | ) |
param[in] args - self
int CompositeArguments_getParameter | ( | CompositeArguments_t * | args, |
const char * | parameter, | ||
double * | gain, | ||
double * | offset, | ||
RaveDataType * | datatype, | ||
double * | nodata, | ||
double * | undetect ) |
Returns the parameter at specified index.
[in] | args | - self |
[in] | parameter | - the name of the parameter |
[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) |
[out] | datatype | - the datatype to be used for the parameter (MAY BE NULL) |
[out] | nodata | - the nodata to be used for the parameter (MAY BE NULL) |
[out] | undetect | - the undetect to be used for the parameter (MAY BE NULL) |
const char * CompositeArguments_getParameterAtIndex | ( | CompositeArguments_t * | args, |
int | index, | ||
double * | gain, | ||
double * | offset, | ||
RaveDataType * | datatype, | ||
double * | nodata, | ||
double * | undetect ) |
Returns the parameter at specified index.
[in] | args | - 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) |
[out] | datatype | - the datatype to be used for the parameter (MAY BE NULL) |
[out] | nodata | - the nodata to be used for the parameter (MAY BE NULL) |
[out] | undetect | - the undetect to be used for the parameter (MAY BE NULL) |
int CompositeArguments_getParameterCount | ( | CompositeArguments_t * | args | ) |
Returns the number of parameters to be processed.
[in] | args | - self |
const char * CompositeArguments_getParameterName | ( | CompositeArguments_t * | args, |
int | index ) |
Returns the parameter name at specified index.
[in] | args | - self |
[in] | index | - the index |
const char * CompositeArguments_getProduct | ( | CompositeArguments_t * | args | ) |
Returns the compositing product.
Rave_ProductType CompositeArguments_getProductType | ( | CompositeArguments_t * | args | ) |
In some cases it is possible to translate a Rave_CompositingProduct into a Rave_ProductType.
If it is possible, then the product type is returned, otherwise UNDEFINED is returned.
[in] | args | - self |
const char * CompositeArguments_getQIFieldName | ( | CompositeArguments_t * | args | ) |
Returns the name of the field to use when implementing a quality based compositing.
[in] | args | - self |
const char * CompositeArguments_getQualityFlagAt | ( | CompositeArguments_t * | args, |
int | index ) |
Returns the name of the quality flag at specified position.
[in] | args | - self |
[in] | index | - index of quality flag |
RaveList_t * CompositeArguments_getQualityFlags | ( | CompositeArguments_t * | args | ) |
Returns a full list of all set quality flags.
Remember to call RaveList_freeAndDestroy
[in] | args | - self |
RaveList_t * CompositeArguments_getRadarIndexKeys | ( | CompositeArguments_t * | args | ) |
Returns the registered radar indexes.
[in] | args | - self |
RaveObjectHashTable_t * CompositeArguments_getRadarIndexMapping | ( | CompositeArguments_t * | args | ) |
Returns the radar index mapping.
[in] | args | - self |
int CompositeArguments_getRadarIndexValue | ( | CompositeArguments_t * | args, |
const char * | key ) |
Returns the index for the specified key.
[in] | args | - self |
[in] | key | - the key |
double CompositeArguments_getRange | ( | CompositeArguments_t * | args | ) |
Returns the range in meters.
[in] | args | - self |
const char * CompositeArguments_getStrategy | ( | CompositeArguments_t * | args | ) |
Returns the strategy.
[in] | args | - self |
const char * CompositeArguments_getTime | ( | CompositeArguments_t * | args | ) |
Returns the nominal time.
[in] | args | - self |
int CompositeArguments_hasArgument | ( | CompositeArguments_t * | args, |
const char * | name ) |
Returns if there is a rave argument that is named accordingly.
[in] | args | - self |
[in] | name | - the name of the argument |
int CompositeArguments_hasParameter | ( | CompositeArguments_t * | args, |
const char * | quantity ) |
Returns if this composite generator is going to process specified parameter.
[in] | args | - self |
[in] | quantity | - the parameter quantity |
int CompositeArguments_hasQualityFlag | ( | CompositeArguments_t * | args, |
const char * | name ) |
[in] | args | - self |
[in] | name | - the name of the quality flag |
const char * CompositeArguments_productToString | ( | Rave_CompositingProduct | product | ) |
Converts a method into a string.
[in] | product | - the Rave_CompositingProduct |
void CompositeArguments_removeArgument | ( | CompositeArguments_t * | args, |
const char * | name ) |
Removes the rave argument that is named accordingly.
[in] | args | - self |
[in] | name | - the name of the argument |
int CompositeArguments_removeQualityFlag | ( | CompositeArguments_t * | args, |
const char * | flag ) |
Removes the quality flag with provided name.
[in] | args | - self |
[in] | flag | - the quality flag that should be removed |
int CompositeArguments_removeQualityFlagAt | ( | CompositeArguments_t * | args, |
int | index ) |
Removes the quality flag at specified index.
[in] | args | - self |
[in] | index | - the index |
int CompositeArguments_setArea | ( | CompositeArguments_t * | args, |
Area_t * | area ) |
Sets the area to use when creating the composite.
[in] | args | - self |
[in] | area | - the area |
int CompositeArguments_setDate | ( | CompositeArguments_t * | args, |
const char * | value ) |
Sets the nominal date.
[in] | args | - self |
[in] | value | - the date in the format YYYYMMDD |
void CompositeArguments_setElevationAngle | ( | CompositeArguments_t * | args, |
double | angle ) |
Sets the elevation angle that should be used when generating a composite as PPI.
[in] | args | - self |
[in] | angle | - the angle in radians |
void CompositeArguments_setHeight | ( | CompositeArguments_t * | args, |
double | height ) |
Sets the height that should be used when generating a composite.
[in] | args | - self |
[in] | height | - the height |
int CompositeArguments_setProduct | ( | CompositeArguments_t * | args, |
const char * | product ) |
Sets the compositing method to use when creating the composite.
Note, this should be set as a const char since a plugin might be able to provide support for a non-predefined method.
Each method will have it's own requirements and as such it is up to the plugin to validate and allow for the combination.
Height/Elevation angle and range are used in combination with the products. PPI requires elevation angle CAPPI, PCAPPI and PMAX requires height above sea level PMAX also requires range in meters
[in] | args | - self |
[in] | product | - the method to use |
int CompositeArguments_setQIFieldName | ( | CompositeArguments_t * | args, |
const char * | fieldname ) |
If a quality field based algorithm is implemented, this field can be set to indicate what field to use.
If not enough it is also possible to use arguments.
[in] | args | - self |
[in] | fieldname | - name of quality field to use |
int CompositeArguments_setQualityFlags | ( | CompositeArguments_t * | args, |
const char * | flags[], | ||
int | nrflags ) |
Sets the quality flags that should be used.
[in] | args | - self |
[in] | flags | - an array of quality flags |
[in] | nrflags | - number of flags |
void CompositeArguments_setRange | ( | CompositeArguments_t * | args, |
double | range ) |
Sets the range that should be used when generating the Pseudo MAX.
This range is the limit in meters for when the vertical max should be used. When outside this range, the PCAPPI value is used instead.
[in] | args | - self |
[in] | range | - the range in meters |
int CompositeArguments_setStrategy | ( | CompositeArguments_t * | args, |
const char * | strategy ) |
Sets the strategy id.
Will help when determining which plugin/factory to use for product generation.
[in] | args | - self |
[in] | strategy | - the strategy id |
int CompositeArguments_setTime | ( | CompositeArguments_t * | args, |
const char * | value ) |
Sets the nominal time.
[in] | args | - self |
[in] | value | - the time in the format HHmmss |
Rave_CompositingProduct CompositeArguments_stringToProduct | ( | const char * | product | ) |
Converts a string into a product.
[in] | product | - the string |
int CompositeArguments_updateRadarIndexMapping | ( | CompositeArguments_t * | args, |
RaveObjectHashTable_t * | mapping, | ||
OdimSources_t * | sources ) |
Updates the radar index mapping.
[in] | args | - self |
[in] | mapping | - the mapping. |
[in] | sources | - the odim sources. |
RaveCoreObjectType CompositeArgumentObjectEntry_TYPE |
A composite argument object entry that that keeps track of added objects.
RaveCoreObjectType CompositeArguments_TYPE |
Type definition to use when creating a rave object.