HAZE
haze is a drop-in replacement to process water vapor to be used with FORCE
Loading...
Searching...
No Matches
General Math Operations

Functions

double kgsqmTocow (double x)
 Compute water column height.
double calculateWeightedAverage (const double *values, const double *weights, size_t count)
 Compute the weighted average.
int intcmp (const void *a, const void *b)
 Callback function for qsort to compare integers.

Detailed Description

Function Documentation

◆ calculateWeightedAverage()

double calculateWeightedAverage ( const double * values,
const double * weights,
size_t count )

Compute the weighted average.

Compute the weighted arithmetic mean of count amount of values. Every value must be associated with a weight.

\[ \bar{x} = \frac{\sum_{i = 1}^{\textrm{count}}x_i \times w_i}{\sum_{i = 1}^{\textrm{count}}w_i} \]

Parameters
valuesValues to average.
weightsWeights associated with values.
countSize of arrays.
Returns
double Weighted arithmetic mean, NAN on error.

◆ intcmp()

int intcmp ( const void * a,
const void * b )

Callback function for qsort to compare integers.

Parameters
aVoid-casted reference to first value of comparison.
bVoid-casted reference to second value of comparison.
Returns
int Negative value if a < b, 0 if a = b, positive value if a > b.

◆ kgsqmTocow()

double kgsqmTocow ( double x)

Compute water column height.

ECMWF distributes data in unit of kilogram per square meter. To allow easy integration with FORCE, the values are converted to water column height.

Parameters
xWater vapor concentration in kilogram per square meter.
Returns
double Scaled value.