UFO
ufo::anonymous_namespace{VariableAssignment.cc} Namespace Reference

Functions

int safeCast (float x, float missingIn, int missingOut)
 
float safeCast (int x, int missingIn, float missingOut)
 Cast an int x to a float. If is equal to missingIn, return missingOut. More...
 
template<typename VariableType >
void assignValue (const std::string &valueAsString, const std::vector< bool > &apply, ioda::ObsDataVector< VariableType > &values)
 
template<typename SourceVariableType , typename DestinationVariableType >
void assignObsDataVector (const std::vector< bool > &apply, const ioda::ObsDataVector< SourceVariableType > &source, ioda::ObsDataVector< DestinationVariableType > &destination)
 
template<typename VariableType >
void assignObsDataVector (const std::vector< bool > &apply, const ioda::ObsDataVector< VariableType > &source, ioda::ObsDataVector< VariableType > &destination)
 
template<typename SourceVariableType , typename DestinationVariableType >
void assignVariable (const ufo::Variable &variable, const std::vector< bool > &apply, const ObsFilterData &data, ioda::ObsDataVector< DestinationVariableType > &values)
 
template<typename FunctionValueType , typename VariableType >
void assignFunction (const ufo::Variable &function, const ufo::Variable &variable, const std::vector< bool > &apply, const ObsFilterData &data, ioda::ObsDataVector< VariableType > &values)
 
template<typename VariableType >
void assignNumericValues (const AssignmentParameters &params, const ufo::Variable &variable, const std::vector< bool > &apply, const ObsFilterData &data, ioda::ObsDataVector< VariableType > &values)
 Assign values to a numeric variable (of type float or int). More...
 
template<typename VariableType >
void assignNonnumericValues (const AssignmentParameters &params, const ufo::Variable &variable, const std::vector< bool > &apply, const ObsFilterData &data, ioda::ObsDataVector< VariableType > &values)
 Assign values to a non-numeric variable (of type string or DateTime). More...
 
template<typename VariableType >
ioda::ObsDataVector< VariableType > getCurrentValues (const ufo::Variable &variable, ioda::ObsSpace &obsdb)
 
template<typename VariableType >
void saveValues (const ufo::Variable &variable, const ioda::ObsDataVector< VariableType > &values, ioda::ObsSpace &obsdb)
 Save the values values of variable variable to obsdb. More...
 
void updateQCFlags (const ioda::ObsDataVector< float > &obsvalues, ioda::ObsDataVector< int > &qcflags)
 
void assignToIntVariable (const ufo::Variable &variable, const AssignmentParameters &params, const std::vector< bool > &apply, const ObsFilterData &data, ioda::ObsSpace &obsdb)
 
void assignToFloatVariable (const ufo::Variable &variable, const AssignmentParameters &params, const std::vector< bool > &apply, const ObsFilterData &data, ioda::ObsSpace &obsdb, ioda::ObsDataVector< int > &qcflags)
 
template<typename VariableType >
void assignToNonnumericVariable (const ufo::Variable &variable, const AssignmentParameters &params, const std::vector< bool > &apply, const ObsFilterData &data, ioda::ObsSpace &obsdb)
 
void assignToVariable (const ufo::Variable &variable, ioda::ObsDtype dtype, const AssignmentParameters &params, const std::vector< bool > &apply, const ObsFilterData &data, ioda::ObsSpace &obsdb, ioda::ObsDataVector< int > &qcflags)
 
ufo::Variable getVariable (const AssignmentParameters &params)
 Return the variable to which new values will be assigned. More...
 
ioda::ObsDtype getDataType (boost::optional< ioda::ObsDtype > dtypeParam, const ufo::Variable &variable, const ioda::ObsSpace &obsdb)
 Return the data type of the variable to which new values will be assigned. More...
 

Function Documentation

◆ assignFunction()

template<typename FunctionValueType , typename VariableType >
void ufo::anonymous_namespace{VariableAssignment.cc}::assignFunction ( const ufo::Variable function,
const ufo::Variable variable,
const std::vector< bool > &  apply,
const ObsFilterData data,
ioda::ObsDataVector< VariableType > &  values 
)

Evaluate the ObsFunction function and assign the vectors it produced to successive vectors in values (only at locations selected by the where statement).

Definition at line 136 of file VariableAssignment.cc.

Here is the call graph for this function:

◆ assignNonnumericValues()

template<typename VariableType >
void ufo::anonymous_namespace{VariableAssignment.cc}::assignNonnumericValues ( const AssignmentParameters params,
const ufo::Variable variable,
const std::vector< bool > &  apply,
const ObsFilterData data,
ioda::ObsDataVector< VariableType > &  values 
)

Assign values to a non-numeric variable (of type string or DateTime).

Definition at line 181 of file VariableAssignment.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ assignNumericValues()

template<typename VariableType >
void ufo::anonymous_namespace{VariableAssignment.cc}::assignNumericValues ( const AssignmentParameters params,
const ufo::Variable variable,
const std::vector< bool > &  apply,
const ObsFilterData data,
ioda::ObsDataVector< VariableType > &  values 
)

Assign values to a numeric variable (of type float or int).

Definition at line 148 of file VariableAssignment.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ assignObsDataVector() [1/2]

template<typename SourceVariableType , typename DestinationVariableType >
void ufo::anonymous_namespace{VariableAssignment.cc}::assignObsDataVector ( const std::vector< bool > &  apply,
const ioda::ObsDataVector< SourceVariableType > &  source,
ioda::ObsDataVector< DestinationVariableType > &  destination 
)

For each location selected by the where statement, copy the corresponding element of source to destination.

This two-parameter template is selected by the compiler when SourceVariableType is different from DestinationVariableType. It takes care of converting missing value indicators of type SourceVariableType to ones of type DestinationVariableType.

Definition at line 79 of file VariableAssignment.cc.

Here is the call graph for this function:

◆ assignObsDataVector() [2/2]

template<typename VariableType >
void ufo::anonymous_namespace{VariableAssignment.cc}::assignObsDataVector ( const std::vector< bool > &  apply,
const ioda::ObsDataVector< VariableType > &  source,
ioda::ObsDataVector< VariableType > &  destination 
)

For each location selected by the where statement, copy the corresponding element of source to destination.

This single-parameter template is selected by the compiler when source and destination are of the same type.

Definition at line 104 of file VariableAssignment.cc.

Here is the caller graph for this function:

◆ assignToFloatVariable()

void ufo::anonymous_namespace{VariableAssignment.cc}::assignToFloatVariable ( const ufo::Variable variable,
const AssignmentParameters params,
const std::vector< bool > &  apply,
const ObsFilterData data,
ioda::ObsSpace &  obsdb,
ioda::ObsDataVector< int > &  qcflags 
)

Works like assignToIntVariable(), but in addition if variable belongs to the ObsValue or DerivedObsValue group and is one of the simulated variables, it updates qcflags by (a) changing miss to pass if the obs value is no longer missing and (b) changing pass to miss if the obs value is now missing.

Definition at line 261 of file VariableAssignment.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ assignToIntVariable()

void ufo::anonymous_namespace{VariableAssignment.cc}::assignToIntVariable ( const ufo::Variable variable,
const AssignmentParameters params,
const std::vector< bool > &  apply,
const ObsFilterData data,
ioda::ObsSpace &  obsdb 
)

Retrieve the current values of an int-valued variable variable from obsdb (or if it doesn't already exist, fill it with missing values), assign new values to elements selected by the where clause and save the results to obsdb.

Definition at line 247 of file VariableAssignment.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ assignToNonnumericVariable()

template<typename VariableType >
void ufo::anonymous_namespace{VariableAssignment.cc}::assignToNonnumericVariable ( const ufo::Variable variable,
const AssignmentParameters params,
const std::vector< bool > &  apply,
const ObsFilterData data,
ioda::ObsSpace &  obsdb 
)

Retrieve the current values of a non-numeric variable variable from obsdb (or if it doesn't already exist, fill it with missing values), assign new values to elements selected by the where clause and save the results to obsdb.

Definition at line 278 of file VariableAssignment.cc.

Here is the call graph for this function:

◆ assignToVariable()

void ufo::anonymous_namespace{VariableAssignment.cc}::assignToVariable ( const ufo::Variable variable,
ioda::ObsDtype  dtype,
const AssignmentParameters params,
const std::vector< bool > &  apply,
const ObsFilterData data,
ioda::ObsSpace &  obsdb,
ioda::ObsDataVector< int > &  qcflags 
)

Delegate work to an appropriate function depending on whether dtype is a numeric or non-numeric type.

Definition at line 290 of file VariableAssignment.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ assignValue()

template<typename VariableType >
void ufo::anonymous_namespace{VariableAssignment.cc}::assignValue ( const std::string &  valueAsString,
const std::vector< bool > &  apply,
ioda::ObsDataVector< VariableType > &  values 
)

Convert valueAsString to VariableType and for each vector in values assign that value at locations selected by the where statement.

Definition at line 56 of file VariableAssignment.cc.

Here is the caller graph for this function:

◆ assignVariable()

template<typename SourceVariableType , typename DestinationVariableType >
void ufo::anonymous_namespace{VariableAssignment.cc}::assignVariable ( const ufo::Variable variable,
const std::vector< bool > &  apply,
const ObsFilterData data,
ioda::ObsDataVector< DestinationVariableType > &  values 
)

Retrieve the variable variable of type SourceVariableType and assign its components (channels) to successive vectors in values (only at locations selected by the where statement).

Definition at line 124 of file VariableAssignment.cc.

Here is the call graph for this function:

◆ getCurrentValues()

template<typename VariableType >
ioda::ObsDataVector<VariableType> ufo::anonymous_namespace{VariableAssignment.cc}::getCurrentValues ( const ufo::Variable variable,
ioda::ObsSpace &  obsdb 
)

Retrieve and return the current values of the variable variable from obsdb (as vectors). Variables that aren't currently stored in obsdb are treated as if they consisted entirely of missing values.

Definition at line 200 of file VariableAssignment.cc.

Here is the call graph for this function:

◆ getDataType()

ioda::ObsDtype ufo::anonymous_namespace{VariableAssignment.cc}::getDataType ( boost::optional< ioda::ObsDtype >  dtypeParam,
const ufo::Variable variable,
const ioda::ObsSpace &  obsdb 
)

Return the data type of the variable to which new values will be assigned.

Definition at line 327 of file VariableAssignment.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getVariable()

ufo::Variable ufo::anonymous_namespace{VariableAssignment.cc}::getVariable ( const AssignmentParameters params)

Return the variable to which new values will be assigned.

Definition at line 316 of file VariableAssignment.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ safeCast() [1/2]

int ufo::anonymous_namespace{VariableAssignment.cc}::safeCast ( float  x,
float  missingIn,
int  missingOut 
)

Convert a float x to an int by rounding. If is equal to missingIn, return missingOut. If the value to be returned is too large to be represented by an int, throw an exception.

Definition at line 39 of file VariableAssignment.cc.

◆ safeCast() [2/2]

float ufo::anonymous_namespace{VariableAssignment.cc}::safeCast ( int  x,
int  missingIn,
float  missingOut 
)

Cast an int x to a float. If is equal to missingIn, return missingOut.

Definition at line 47 of file VariableAssignment.cc.

Here is the caller graph for this function:

◆ saveValues()

template<typename VariableType >
void ufo::anonymous_namespace{VariableAssignment.cc}::saveValues ( const ufo::Variable variable,
const ioda::ObsDataVector< VariableType > &  values,
ioda::ObsSpace &  obsdb 
)

Save the values values of variable variable to obsdb.

Definition at line 218 of file VariableAssignment.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateQCFlags()

void ufo::anonymous_namespace{VariableAssignment.cc}::updateQCFlags ( const ioda::ObsDataVector< float > &  obsvalues,
ioda::ObsDataVector< int > &  qcflags 
)

Change the QC flag from miss to pass if the obs value is no longer missing or from pass to miss if the obs value is now missing.

Definition at line 227 of file VariableAssignment.cc.

Here is the caller graph for this function: