UFO
ufo::ObsCategorical Class Reference

Categorical observation operator. More...

#include <ObsCategorical.h>

Inheritance diagram for ufo::ObsCategorical:
Collaboration diagram for ufo::ObsCategorical:

Public Types

typedef ObsCategoricalParameters Parameters_
 

Public Member Functions

 ObsCategorical (const ioda::ObsSpace &, const Parameters_ &)
 
 ~ObsCategorical () override
 
void simulateObs (const GeoVaLs &, ioda::ObsVector &, ObsDiagnostics &) const override
 Obs Operator. More...
 
const oops::Variables & requiredVars () const override
 Operator input required from Model. More...
 
- Public Member Functions inherited from ufo::ObsOperatorBase
 ObsOperatorBase (const ioda::ObsSpace &odb, const eckit::Configuration &=eckit::LocalConfiguration())
 
virtual ~ObsOperatorBase ()
 
virtual std::unique_ptr< Locationslocations () const
 Locations for GeoVaLs. More...
 
virtual oops::Variables simulatedVars () const
 List of variables simulated by this operator. More...
 

Static Public Member Functions

static const std::string classname ()
 

Private Member Functions

void print (std::ostream &) const override
 

Private Attributes

const ioda::ObsSpace & odb_
 ObsSpace. More...
 
ObsCategoricalData< ObsOperatorBasedata_
 Data handler for the Categorical operator and TL/AD code. More...
 

Detailed Description

Categorical observation operator.

The Categorical operator can be used to run several observation operators, each of which produces a vector of H(x) values. The Categorical operator then creates a final H(x) vector by selecting the observation operator at each location according to a categorical variable.

The choice of observation operator at each location is governed by the categorical variable parameter, which must be an integer or string variable in the MetaData group.

The categorised operators map is used to produce a correspondence between values of the categorical variable and the operator used.

The fallback operator parameter governs the observation operator that will be used whenever a particular value of the categorical variable does not exist in categorised operators.

The operator configurations parameter governs the configuration of each of the operators to be used. If either the fallback operator or one of the categorised operators have not been configured, an exception will be thrown.

An example yaml configuration is as follows: obs operator: name: Categorical categorical variable: station_id fallback operator: "Composite" categorised operators: {"47418": "Composite", "54857": "Identity"} operator configurations:

  • name: Identity
  • name: Composite components:
    • name: Identity variables:
      • name: air_temperature
      • name: surface_pressure
    • name: VertInterp variables:
      • name: northward_wind
      • name: eastward_wind

This operator uses station_id@MetaData as the categorical variable. Both the Identity and Composite operators are used to produce H(x) vectors. Then, at each location in the ObsSpace:

  • if station_id@MetaData is equal to 47418 then the Composite H(x) is selected;
  • if station_id@MetaData is equal to 54857 then the Identity H(x) is selected;
  • otherwise, the fallback operator (also Composite in this case) H(x) is selected.

Definition at line 81 of file ObsCategorical.h.

Member Typedef Documentation

◆ Parameters_

The type of parameters accepted by the constructor of this operator. This typedef is used by the ObsOperatorFactory.

Definition at line 86 of file ObsCategorical.h.

Constructor & Destructor Documentation

◆ ObsCategorical()

ufo::ObsCategorical::ObsCategorical ( const ioda::ObsSpace &  odb,
const Parameters_ params 
)

Definition at line 29 of file ObsCategorical.cc.

◆ ~ObsCategorical()

ufo::ObsCategorical::~ObsCategorical ( )
override

Definition at line 42 of file ObsCategorical.cc.

Member Function Documentation

◆ classname()

static const std::string ufo::ObsCategorical::classname ( )
inlinestatic

Definition at line 88 of file ObsCategorical.h.

◆ print()

void ufo::ObsCategorical::print ( std::ostream &  os) const
overrideprivatevirtual

Implements ufo::ObsOperatorBase.

Definition at line 72 of file ObsCategorical.cc.

◆ requiredVars()

const oops::Variables& ufo::ObsCategorical::requiredVars ( ) const
inlineoverridevirtual

Operator input required from Model.

Implements ufo::ObsOperatorBase.

Definition at line 95 of file ObsCategorical.h.

◆ simulateObs()

void ufo::ObsCategorical::simulateObs ( const GeoVaLs ,
ioda::ObsVector &  ,
ObsDiagnostics  
) const
overridevirtual

Obs Operator.

Implements ufo::ObsOperatorBase.

Definition at line 48 of file ObsCategorical.cc.

Member Data Documentation

◆ data_

ObsCategoricalData<ObsOperatorBase> ufo::ObsCategorical::data_
private

Data handler for the Categorical operator and TL/AD code.

Definition at line 105 of file ObsCategorical.h.

◆ odb_

const ioda::ObsSpace& ufo::ObsCategorical::odb_
private

ObsSpace.

Definition at line 102 of file ObsCategorical.h.


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