RAVE
rave_acrr.c File Reference

Implementation of the Precipitation accumulation - ACRR algorithm This object does NOT support RAVE_OBJECT_CLONE. More...

#include "rave_acrr.h"
#include "rave_attribute.h"
#include "rave_debug.h"
#include "rave_alloc.h"
#include "raveutil.h"
#include <string.h>

Classes

struct  _RaveAcrr_t
 Represents the acrr generator. More...
 

Macros

#define ACRR_DISTANCE_TO_RADAR_RESOLUTION   1000.0
 The resolution to use for scaling the distance from pixel to used radar.
 

Functions

int RaveAcrr_sum (RaveAcrr_t *self, CartesianParam_t *param, double zr_a, double zr_b)
 Sums a parameter with the previously calculated values.
 
CartesianParam_tRaveAcrr_accumulate (RaveAcrr_t *self, double acpt, long N, double hours)
 Generates the result.
 
int RaveAcrr_isInitialized (RaveAcrr_t *self)
 Returns if this instance has been initialized or not.
 
void RaveAcrr_setNodata (RaveAcrr_t *self, double nodata)
 Sets the nodata to be used for the accumulation.
 
double RaveAcrr_getNodata (RaveAcrr_t *self)
 Returns the nodata that will be used in the accumulation.
 
void RaveAcrr_setUndetect (RaveAcrr_t *self, double undetect)
 Sets the undetect to be used for the accumulation.
 
double RaveAcrr_getUndetect (RaveAcrr_t *self)
 Returns the undetect that will be used in the accumulation.
 
const char * RaveAcrr_getQuantity (RaveAcrr_t *self)
 Returns the quantity for this generator instance.
 
int RaveAcrr_setQualityFieldName (RaveAcrr_t *self, const char *fieldname)
 Sets the name of the quality field (how/task value) to be used as distance field when performing the Acrr algorithm.
 
const char * RaveAcrr_getQualityFieldName (RaveAcrr_t *self)
 Returns the name of the quality field (how/task value) to be used as distance field when performing the Acrr algorithm.
 

Variables

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

Detailed Description

Implementation of the Precipitation accumulation - ACRR algorithm This object does NOT support RAVE_OBJECT_CLONE.

Author
Anders Henja (Swedish Meteorological and Hydrological Institute, SMHI)
Date
2012-05-31

Macro Definition Documentation

◆ ACRR_DISTANCE_TO_RADAR_RESOLUTION

#define ACRR_DISTANCE_TO_RADAR_RESOLUTION   1000.0

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

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

Function Documentation

◆ RaveAcrr_accumulate()

CartesianParam_t * RaveAcrr_accumulate ( RaveAcrr_t * self,
double acpt,
long N,
double hours )

Generates the result.

Parameters
[in]self- self
[in]acpt- the limit for accepting the accumulation (percent between 0 - 1)
[in]N- the number of expected calls to sum (will be used when calculating acceptable limit)
[in]hours- the number of hours this accumulation has been performed on.
Returns
the cartesian parameter with quantity ACRR on success otherwise NULL

◆ RaveAcrr_getNodata()

double RaveAcrr_getNodata ( RaveAcrr_t * self)

Returns the nodata that will be used in the accumulation.

Parameters
[in]self- self
Returns
the nodata value to be used

◆ RaveAcrr_getQualityFieldName()

const char * RaveAcrr_getQualityFieldName ( RaveAcrr_t * self)

Returns the name of the quality field (how/task value) to be used as distance field when performing the Acrr algorithm.

Parameters
[in]self- self
Returns
the quality field name

◆ RaveAcrr_getQuantity()

const char * RaveAcrr_getQuantity ( RaveAcrr_t * self)

Returns the quantity for this generator instance.

Parameters
[in]self- self
Returns
the quantity for this generator instance or NULL if not initialized.

◆ RaveAcrr_getUndetect()

double RaveAcrr_getUndetect ( RaveAcrr_t * self)

Returns the undetect that will be used in the accumulation.

Parameters
[in]self- self
Returns
the undetect value to be used

◆ RaveAcrr_isInitialized()

int RaveAcrr_isInitialized ( RaveAcrr_t * self)

Returns if this instance has been initialized or not.

Parameters
[in]self- self
Returns
1 if instance has been initialized otherwise 0

◆ RaveAcrr_setNodata()

void RaveAcrr_setNodata ( RaveAcrr_t * self,
double nodata )

Sets the nodata to be used for the accumulation.

Parameters
[in]self- self
[in]nodata- the nodata value to use

◆ RaveAcrr_setQualityFieldName()

int RaveAcrr_setQualityFieldName ( RaveAcrr_t * self,
const char * fieldname )

Sets the name of the quality field (how/task value) to be used as distance field when performing the Acrr algorithm.

(default is se.smhi.composite.distance.radar).

Parameters
[in]self- self
[in]fieldname- the name of the quality field (MAY NOT BE NULL)
Returns
1 on success or 0 on error

◆ RaveAcrr_setUndetect()

void RaveAcrr_setUndetect ( RaveAcrr_t * self,
double undetect )

Sets the undetect to be used for the accumulation.

Parameters
[in]self- self
[in]undetect- the undetect value to use

◆ RaveAcrr_sum()

int RaveAcrr_sum ( RaveAcrr_t * self,
CartesianParam_t * param,
double zr_a,
double zr_b )

Sums a parameter with the previously calculated values.

Parameters
[in]self- self
[in]param- the cartesian parameter

Variable Documentation

◆ RaveAcrr_TYPE

RaveCoreObjectType RaveAcrr_TYPE
Initial value:
= {
"RaveAcrr",
sizeof(RaveAcrr_t),
RaveAcrr_constructor,
RaveAcrr_destructor,
RaveAcrr_copyconstructor
}
struct _RaveAcrr_t RaveAcrr_t
Defines ACRR.
Definition rave_acrr.h:33

Type definition to use when creating a rave object.