UFO
|
Creates an array with values for specified variables selected by a series of where statements. More...
#include <Conditional.h>
Public Member Functions | |
Conditional (const eckit::LocalConfiguration &=eckit::LocalConfiguration()) | |
void | compute (const ObsFilterData &, ioda::ObsDataVector< FunctionValue > &) const |
compute the result of the function More... | |
const ufo::Variables & | requiredVariables () const |
geovals required to compute the function More... | |
![]() | |
ObsFunctionBase (const eckit::LocalConfiguration conf=eckit::LocalConfiguration()) | |
virtual | ~ObsFunctionBase () |
Private Attributes | |
ufo::Variables | invars_ |
ConditionalParameters< FunctionValue > | options_ |
Additional Inherited Members | |
![]() | |
typedef FunctionValue | Value_ |
Type of the values produced by the function. More... | |
Creates an array with values for specified variables selected by a series of where statements.
The obs function has been designed primarily to work with the Variable assignment filter to simplify the assignment of more complicated variables. Any functionality in the processWhere class can be used with this obs function.
This template is used to define four ObsFunctions, each producing values of a different type:
Conditional@ObsFunction
produces floatsConditional@IntObsFunction
produces intsConditional@StringObsFunction
produces stringsConditional@DateTimeObsFunction
produces datetimes.Example 1: Create a new floating-point variable emissivity@ObsDerived
and assign values based on the surface type.
- filter: Variable Assignment assignments: - name: emissivity@ObsDerived type: float function: name: Conditional@ObsFunction options: defaultvalue: 0.0 # default value - rttov to calculate. cases: - where: - variable: name: surface_type@MetaData is_in: 1 # if necessary, further conditions could be specified in extra items # in the 'where' list value: 0.3 - where: - variable: name: surface_type@MetaData is_in: 2 value: 0.5
Example 2: Create a new string variable surface_description@MetaData
and set it to land
, sea
or unknown
depending on the value of the surface_type@MetaData
variable.
- filter: Variable Assignment assignments: - name: surface_description@MetaData type: string function: name: Conditional@StringObsFunction options: defaultvalue: unknown cases: - where: - variable: name: surface_type@MetaData is_in: 1 value: land - where: - variable: name: surface_type@MetaData is_in: 2 value: sea
Definition at line 135 of file Conditional.h.
|
explicit |
|
virtual |
compute the result of the function
Implements ufo::ObsFunctionBase< FunctionValue >.
Definition at line 35 of file Conditional.cc.
|
virtual |
geovals required to compute the function
Implements ufo::ObsFunctionBase< FunctionValue >.
Definition at line 61 of file Conditional.cc.
|
private |
Definition at line 142 of file Conditional.h.
|
private |
Definition at line 143 of file Conditional.h.