RAVE
|
Provides functionality for creating composites. More...
#include "composite.h"
#include "polarvolume.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 | _Composite_t |
Represents the cartesian product. More... | |
struct | CompositeRadarItem |
struct | CompositingParameter_t |
Structure for keeping track on parameters that should be composited. More... | |
struct | CompositeValuePosition_t |
Structure for holding information regarding a specific position and values connected with it. More... | |
struct | CompositeValues_t |
Structure for keeping track on values / parameter. More... | |
struct | CompositeValuesVector_t |
Macros | |
#define | MAX_NO_OF_SURROUNDING_POSITIONS 8 |
#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 CompositeRadarItem | CompositeRadarItem_t |
typedef struct CompositingParameter_t | CompositingParameter_t |
Structure for keeping track on parameters that should be composited. | |
typedef struct CompositeValuePosition_t | CompositeValuePosition_t |
Structure for holding information regarding a specific position and values connected with it. | |
typedef struct CompositeValues_t | CompositeValues_t |
Structure for keeping track on values / parameter. | |
typedef struct CompositeValuesVector_t | CompositeValuesVector_t |
typedef enum CompositeInterpolationDimension_t | CompositeInterpolationDimension_t |
Direction in which to perform interpolation. | |
typedef int(* | FUNC_PREPARE_VALUEPOS) (Composite_t *, RaveCoreObject *, const char *, const char *, CompositeValuePosition_t[], int, int[]) |
Function pointer definition for functions where value positions are prepared with values prior to interpolation. | |
Enumerations | |
enum | CompositeInterpolationDimension_t { CompositeInterpolationDimension_AZIMUTH = 0 , CompositeInterpolationDimension_RANGE , CompositeInterpolationDimension_HEIGHT , NO_OF_COMPOSITE_INTERPOLATION_DIMENSIONS } |
Direction in which to perform interpolation. More... | |
Functions | |
int | Composite_add (Composite_t *composite, RaveCoreObject *object) |
Adds one RaveCoreObject, currently, the only supported type is volumes but this might be enhanced in the future to also allow for cartesian products to be added. | |
int | Composite_getNumberOfObjects (Composite_t *composite) |
Returns the number of objects this composite will process. | |
RaveCoreObject * | Composite_get (Composite_t *composite, int index) |
Return the object at position index. | |
int | Composite_getRadarIndexValue (Composite_t *composite, int index) |
Return the radar index value that has been assigned to the object as position index. | |
void | Composite_setProduct (Composite_t *composite, Rave_ProductType type) |
Sets the product type that should be generated when generating the composite. | |
Rave_ProductType | Composite_getProduct (Composite_t *composite) |
Returns the product type. | |
int | Composite_setSelectionMethod (Composite_t *self, CompositeSelectionMethod_t method) |
Sets the selection method to use. | |
CompositeSelectionMethod_t | Composite_getSelectionMethod (Composite_t *self) |
Returns the selection method. | |
int | Composite_setInterpolationMethod (Composite_t *self, CompositeInterpolationMethod_t interpolationMethod) |
Sets the interpolation method to use. | |
CompositeInterpolationMethod_t | Composite_getInterpolationMethod (Composite_t *self) |
Returns the interpolation method. | |
void | Composite_setInterpolateUndetect (Composite_t *self, int interpolateUndetect) |
Sets if undetect should be used in the interpolation. | |
int | Composite_getInterpolateUndetect (Composite_t *self) |
Returns the if interpolation should be performed using undetect or not. | |
void | Composite_setHeight (Composite_t *composite, double height) |
Sets the height that should be used when generating a composite as CAPPI, PCAPPI or PMAX. | |
double | Composite_getHeight (Composite_t *composite) |
Returns the height that is used for composite generation. | |
void | Composite_setElevationAngle (Composite_t *composite, double angle) |
Sets the elevation angle that should be used when generating a composite as PPI. | |
double | Composite_getElevationAngle (Composite_t *composite) |
Returns the elevation angle that is used for composite generation. | |
void | Composite_setRange (Composite_t *self, double range) |
Sets the range that should be used when generating the Pseudo MAX. | |
double | Composite_getRange (Composite_t *self) |
Returns the range in meters. | |
int | Composite_setQualityIndicatorFieldName (Composite_t *self, const char *qiFieldName) |
If this field name is set, then the composite will be generated by first using the quality indicator field for determining radar usage. | |
const char * | Composite_getQualityIndicatorFieldName (Composite_t *self) |
int | Composite_addParameter (Composite_t *composite, const char *quantity, double gain, double offset, double minvalue) |
Adds a parameter to be processed. | |
int | Composite_hasParameter (Composite_t *composite, const char *quantity) |
Returns if this composite generator is going to process specified parameter. | |
int | Composite_getParameterCount (Composite_t *composite) |
Returns the number of parameters to be processed. | |
const char * | Composite_getParameter (Composite_t *composite, int index, double *gain, double *offset) |
Returns the parameter at specified index. | |
int | Composite_setTime (Composite_t *composite, const char *value) |
Sets the nominal time. | |
const char * | Composite_getTime (Composite_t *composite) |
Returns the nominal time. | |
int | Composite_setDate (Composite_t *composite, const char *value) |
Sets the nominal date. | |
const char * | Composite_getDate (Composite_t *composite) |
Returns the nominal date. | |
int | Composite_applyRadarIndexMapping (Composite_t *composite, 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_t * | Composite_generate (Composite_t *composite, Area_t *area, RaveList_t *qualityflags) |
Generates a composite according to the configured parameters in the composite structure. | |
void | Composite_setAlgorithm (Composite_t *composite, CompositeAlgorithm_t *algorithm) |
Sets the algorithm to use when generating the composite. | |
CompositeAlgorithm_t * | Composite_getAlgorithm (Composite_t *composite) |
Returns the currently used algorithm. | |
Variables | |
RaveCoreObjectType | Composite_TYPE |
Type definition to use when creating a rave object. | |
Provides functionality for creating composites.
#define DISTANCE_TO_RADAR_HOW_TASK "se.smhi.composite.distance.radar" |
The name of the task for specifying distance to radar.
#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.
#define HEIGHT_ABOVE_SEA_HOW_TASK "se.smhi.composite.height.radar" |
The name of the task for specifying height above sea level.
#define HEIGHT_RESOLUTION 100.0 |
Same for height, scaled to 100 m resolution up to 25.5 km.
#define RADAR_INDEX_HOW_TASK "se.smhi.composite.index.radar" |
The name of the task for indexing the radars used.
Direction in which to perform interpolation.
NOTE: order is of importance here. The order controls in which order interpolation is done, if done in several dimensions. Since height interpolation must the be done last, it should be last in this enum.
typedef struct CompositeValuePosition_t CompositeValuePosition_t |
Structure for holding information regarding a specific position and values connected with it.
typedef struct CompositeValues_t CompositeValues_t |
Structure for keeping track on values / parameter.
typedef struct CompositingParameter_t CompositingParameter_t |
Structure for keeping track on parameters that should be composited.
typedef int(* FUNC_PREPARE_VALUEPOS) (Composite_t *, RaveCoreObject *, const char *, const char *, CompositeValuePosition_t[], int, int[]) |
Function pointer definition for functions where value positions are prepared with values prior to interpolation.
This type of function shall be provided to CompositeInternal_getInterpolatedValue()
Direction in which to perform interpolation.
NOTE: order is of importance here. The order controls in which order interpolation is done, if done in several dimensions. Since height interpolation must the be done last, it should be last in this enum.
int Composite_add | ( | Composite_t * | composite, |
RaveCoreObject * | object ) |
Adds one RaveCoreObject, currently, the only supported type is volumes but this might be enhanced in the future to also allow for cartesian products to be added.
[in] | composite | - self |
[in] | object | - the item to be added to the composite |
int Composite_addParameter | ( | Composite_t * | composite, |
const char * | quantity, | ||
double | gain, | ||
double | offset, | ||
double | minvalue ) |
Adds a parameter to be processed.
[in] | composite | - 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] | minvalue | - the minimum value that can be represented for this quantity in the composite |
int Composite_applyRadarIndexMapping | ( | Composite_t * | composite, |
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 Composite_generate.
[in] | composite | - self |
[in] | mapping | - the source - index mapping |
Cartesian_t * Composite_generate | ( | Composite_t * | composite, |
Area_t * | area, | ||
RaveList_t * | qualityflags ) |
Generates a composite according to the configured parameters in the composite structure.
[in] | composite | - 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) |
RaveCoreObject * Composite_get | ( | Composite_t * | composite, |
int | index ) |
Return the object at position index.
[in] | composite | - self |
[in] | index | - the index, should be >= 0 and < getNumberOfObjects |
CompositeAlgorithm_t * Composite_getAlgorithm | ( | Composite_t * | composite | ) |
Returns the currently used algorithm.
[in] | composite | - self |
const char * Composite_getDate | ( | Composite_t * | composite | ) |
Returns the nominal date.
[in] | composite | - self |
double Composite_getElevationAngle | ( | Composite_t * | composite | ) |
Returns the elevation angle that is used for composite generation.
[in] | composite | - self |
double Composite_getHeight | ( | Composite_t * | composite | ) |
Returns the height that is used for composite generation.
[in] | composite | - self |
int Composite_getInterpolateUndetect | ( | Composite_t * | self | ) |
Returns the if interpolation should be performed using undetect or not.
[in] | self | - self |
CompositeInterpolationMethod_t Composite_getInterpolationMethod | ( | Composite_t * | self | ) |
Returns the interpolation method.
[in] | self | - self |
int Composite_getNumberOfObjects | ( | Composite_t * | composite | ) |
Returns the number of objects this composite will process.
[in] | composite | - self |
const char * Composite_getParameter | ( | Composite_t * | composite, |
int | index, | ||
double * | gain, | ||
double * | offset ) |
Returns the parameter at specified index.
[in] | composite | - 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) |
int Composite_getParameterCount | ( | Composite_t * | composite | ) |
Returns the number of parameters to be processed.
[in] | composite | - self |
Rave_ProductType Composite_getProduct | ( | Composite_t * | composite | ) |
Returns the product type.
const char * Composite_getQualityIndicatorFieldName | ( | Composite_t * | self | ) |
[in] | self | - self |
int Composite_getRadarIndexValue | ( | Composite_t * | composite, |
int | index ) |
Return the radar index value that has been assigned to the object as position index.
[in] | composite | - self |
[in] | index | - the index, should be >= 0 and < getNumberOfObjects |
double Composite_getRange | ( | Composite_t * | composite | ) |
Returns the range in meters.
[in] | composite | - self |
CompositeSelectionMethod_t Composite_getSelectionMethod | ( | Composite_t * | self | ) |
Returns the selection method.
[in] | self | - self |
const char * Composite_getTime | ( | Composite_t * | composite | ) |
Returns the nominal time.
[in] | composite | - self |
int Composite_hasParameter | ( | Composite_t * | composite, |
const char * | quantity ) |
Returns if this composite generator is going to process specified parameter.
[in] | composite | - self |
[in] | quantity | - the parameter quantity |
void Composite_setAlgorithm | ( | Composite_t * | composite, |
CompositeAlgorithm_t * | algorithm ) |
Sets the algorithm to use when generating the composite.
[in] | composite | - self |
[in] | algorithm | - the actual algorithm to be run (MAY BE NULL, indicating nothing particular should be done) |
int Composite_setDate | ( | Composite_t * | composite, |
const char * | value ) |
Sets the nominal date.
[in] | composite | - self |
[in] | value | - the date in the format YYYYMMDD |
void Composite_setElevationAngle | ( | Composite_t * | composite, |
double | angle ) |
Sets the elevation angle that should be used when generating a composite as PPI.
[in] | composite | - self |
[in] | angle | - the angle in radians |
void Composite_setHeight | ( | Composite_t * | composite, |
double | height ) |
Sets the height that should be used when generating a composite as CAPPI, PCAPPI or PMAX.
[in] | composite | - self |
[in] | height | - the height |
void Composite_setInterpolateUndetect | ( | Composite_t * | self, |
int | interpolateUndetect ) |
Sets if undetect should be used in the interpolation.
This requires proper setting of minvalue in the parameter list. The recommended way is to threat undetect and nodata in the same way since Undetect only represents that nothing has been detected. If not interpolation should be performed using undetect the following behaviour will be done.
If all values are UNDETECT, then result will be UNDETECT. If only one value is DATA, then use that value. If more than one value is DATA, then interpolation. If all values are NODATA, then NODATA. If all values are either NODATA or UNDETECT, then UNDETECT.
[in] | self | - self |
[in] | interpolateUndetect | - If interpolation should be used on undetect or not |
int Composite_setInterpolationMethod | ( | Composite_t * | self, |
CompositeInterpolationMethod_t | interpolationMethod ) |
Sets the interpolation method to use.
[in] | self | - self |
[in] | interpolationMethod | - the interpolation method to use |
void Composite_setProduct | ( | Composite_t * | composite, |
Rave_ProductType | type ) |
Sets the product type that should be generated when generating the composite.
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] | composite | - self |
[in] | type | - the product type, PPI, CAPPI, PCAPPI and PMAX are currently supported. |
int Composite_setQualityIndicatorFieldName | ( | Composite_t * | self, |
const char * | qiFieldName ) |
If this field name is set, then the composite will be generated by first using the quality indicator field for determining radar usage.
If the field name is NULL, then the selection method will be used instead.
[in] | self | - self |
[in] | qiFieldName | - the quality indicator field name |
void Composite_setRange | ( | Composite_t * | composite, |
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] | composite | - self |
[in] | angle | - the range in meters |
int Composite_setSelectionMethod | ( | Composite_t * | self, |
CompositeSelectionMethod_t | method ) |
Sets the selection method to use.
[in] | self | - self |
[in] | method | - the method to use |
int Composite_setTime | ( | Composite_t * | composite, |
const char * | value ) |
Sets the nominal time.
[in] | composite | - self |
[in] | value | - the time in the format HHmmss |
RaveCoreObjectType Composite_TYPE |
Type definition to use when creating a rave object.