UFO
ufo::Conditional< FunctionValue > Class Template Reference

Creates an array with values for specified variables selected by a series of where statements. More...

#include <Conditional.h>

Inheritance diagram for ufo::Conditional< FunctionValue >:
Collaboration diagram for ufo::Conditional< FunctionValue >:

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::VariablesrequiredVariables () const
 geovals required to compute the function More...
 
- Public Member Functions inherited from ufo::ObsFunctionBase< FunctionValue >
 ObsFunctionBase (const eckit::LocalConfiguration conf=eckit::LocalConfiguration())
 
virtual ~ObsFunctionBase ()
 

Private Attributes

ufo::Variables invars_
 
ConditionalParameters< FunctionValue > options_
 

Additional Inherited Members

- Public Types inherited from ufo::ObsFunctionBase< FunctionValue >
typedef FunctionValue Value_
 Type of the values produced by the function. More...
 

Detailed Description

template<typename FunctionValue>
class ufo::Conditional< FunctionValue >

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:

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.

Constructor & Destructor Documentation

◆ Conditional()

template<typename FunctionValue >
ufo::Conditional< FunctionValue >::Conditional ( const eckit::LocalConfiguration &  conf = eckit::LocalConfiguration())
explicit

Definition at line 23 of file Conditional.cc.

Here is the call graph for this function:

Member Function Documentation

◆ compute()

template<typename FunctionValue >
void ufo::Conditional< FunctionValue >::compute ( const ObsFilterData ,
ioda::ObsDataVector< FunctionValue > &   
) const
virtual

compute the result of the function

Implements ufo::ObsFunctionBase< FunctionValue >.

Definition at line 35 of file Conditional.cc.

Here is the call graph for this function:

◆ requiredVariables()

template<typename FunctionValue >
const ufo::Variables & ufo::Conditional< FunctionValue >::requiredVariables ( ) const
virtual

geovals required to compute the function

Implements ufo::ObsFunctionBase< FunctionValue >.

Definition at line 61 of file Conditional.cc.

Member Data Documentation

◆ invars_

template<typename FunctionValue >
ufo::Variables ufo::Conditional< FunctionValue >::invars_
private

Definition at line 142 of file Conditional.h.

◆ options_

template<typename FunctionValue >
ConditionalParameters<FunctionValue> ufo::Conditional< FunctionValue >::options_
private

Definition at line 143 of file Conditional.h.


The documentation for this class was generated from the following files: