UFO
ufo::VariableAssignment Class Reference

Assigns specified values to elements of specified variables selected by the where statement. More...

#include <VariableAssignment.h>

Inheritance diagram for ufo::VariableAssignment:
Collaboration diagram for ufo::VariableAssignment:

Public Types

typedef VariableAssignmentParameters Parameters_
 

Public Member Functions

 VariableAssignment (ioda::ObsSpace &obsdb, const Parameters_ &parameters, std::shared_ptr< ioda::ObsDataVector< int > > flags, std::shared_ptr< ioda::ObsDataVector< float > > obserr)
 
- Public Member Functions inherited from ufo::ObsProcessorBase
 ObsProcessorBase (ioda::ObsSpace &, bool deferToPost, std::shared_ptr< ioda::ObsDataVector< int > >, std::shared_ptr< ioda::ObsDataVector< float > >)
 
 ~ObsProcessorBase ()
 
void preProcess () override
 
void priorFilter (const GeoVaLs &) override
 
void postFilter (const ioda::ObsVector &, const ioda::ObsVector &, const ObsDiagnostics &) override
 
oops::Variables requiredVars () const override
 
oops::Variables requiredHdiagnostics () const override
 

Static Public Member Functions

static const std::string classname ()
 

Private Member Functions

void print (std::ostream &) const override
 
void doFilter () const override
 

Private Attributes

Parameters_ parameters_
 

Additional Inherited Members

- Protected Attributes inherited from ufo::ObsProcessorBase
ioda::ObsSpace & obsdb_
 
std::shared_ptr< ioda::ObsDataVector< int > > flags_
 
std::shared_ptr< ioda::ObsDataVector< float > > obserr_
 
ufo::Variables allvars_
 
ObsFilterData data_
 

Detailed Description

Assigns specified values to elements of specified variables selected by the where statement.

The values can be constants or vectors generated by ObsFunctions. If the variables don't exist yet, they will be created; in this case elements not selected by the where clause will be initialized with the missing value markers.

If the modified variable belongs to the DerivedObsValue group and is a simulated variable, QC flags previously set to missing are reset to pass at locations where a valid obs value has been assigned. Conversely, QC flags previously set to pass are reset to missing at locations where the obs value has been set to missing.

Example 1: Create new variables air_temperature@GrossErrorProbability and relative_humidity@GrossErrorProbability and set them to 0.1 at all locations.

filter: Variable Assignment
assignments:
- name: air_temperature@GrossErrorProbability
  type: float  # type must be specified if the variable doesn't already exist
  value: 0.1
- name: relative_humidity@GrossErrorProbability
  type: float
  value: 0.1

Example 2: Set air_temperature@GrossErrorProbability to 0.05 at all locations in the tropics.

filter: Variable Assignment
where:
- variable:
    name: latitude@MetaData
  minvalue: -30
  maxvalue:  30
assignments:
- name: air_temperature@GrossErrorProbability
  value: 0.05

Example 3: Set relative_humidity@GrossErrorProbability to values computed by an ObsFunction (0.1 in the southern extratropics and 0.05 in the northern extratropics, with a linear transition in between).

filter: Variable Assignment
assignments:
- name: relative_humidity@GrossErrorProbability
  function:
    name: ObsErrorModelRamp@ObsFunction
    options:
      xvar:
        name: latitude@MetaData
      x0: [-30]
      x1: [30]
      err0: [0.1]
      err1: [0.05]

Definition at line 141 of file VariableAssignment.h.

Member Typedef Documentation

◆ Parameters_

The type of parameters accepted by the constructor of this filter. This typedef is used by the FilterFactory.

Definition at line 146 of file VariableAssignment.h.

Constructor & Destructor Documentation

◆ VariableAssignment()

ufo::VariableAssignment::VariableAssignment ( ioda::ObsSpace &  obsdb,
const Parameters_ parameters,
std::shared_ptr< ioda::ObsDataVector< int > >  flags,
std::shared_ptr< ioda::ObsDataVector< float > >  obserr 
)

Definition at line 367 of file VariableAssignment.cc.

Here is the call graph for this function:

Member Function Documentation

◆ classname()

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

Definition at line 148 of file VariableAssignment.h.

◆ doFilter()

void ufo::VariableAssignment::doFilter ( ) const
overrideprivatevirtual

Implements ufo::ObsProcessorBase.

Definition at line 386 of file VariableAssignment.cc.

Here is the call graph for this function:

◆ print()

void ufo::VariableAssignment::print ( std::ostream &  os) const
overrideprivate

Definition at line 402 of file VariableAssignment.cc.

Member Data Documentation

◆ parameters_

Parameters_ ufo::VariableAssignment::parameters_
private

Definition at line 158 of file VariableAssignment.h.


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