UFO
ufo::EntireSampleDataHandler Class Reference

Retrieve and store data for entire sample. This class uses lazy loading; vectors of variables are retrieved once requested and cached after that. Variables in certain groups are optional, meaning that if they are not present on the obsdb they will be filled with a default value if requested. More...

#include <EntireSampleDataHandler.h>

Collaboration diagram for ufo::EntireSampleDataHandler:

Public Member Functions

 EntireSampleDataHandler (ioda::ObsSpace &obsdb, const DataHandlerParameters &options)
 
template<typename T >
std::vector< T > & get (const std::string &fullname)
 
void writeQuantitiesToObsdb ()
 
template<typename T >
void initialiseVector (const std::string fullname)
 

Private Member Functions

template<typename T >
void putDataVector (const std::string &fullname, const std::vector< T > &datavec)
 Put entire data vector on obsdb. More...
 
int defaultValue (const std::vector< int > &vec, const std::string &groupname)
 Default value used to fill vector of integers. More...
 
float defaultValue (const std::vector< float > &vec, const std::string &groupname)
 Default value used to fill vector of floats. More...
 
std::string defaultValue (const std::vector< std::string > &vec, const std::string &groupname)
 Default value used to fill vector of strings. More...
 

Private Attributes

ioda::ObsSpace & obsdb_
 Observation database. More...
 
const DataHandlerParametersoptions_
 Configurable parameters. More...
 
std::unordered_map< std::string, boost::variant< std::vector< int >, std::vector< float >, std::vector< std::string > > > entireSampleData_
 Container of each variable in the entire data set. More...
 
const int missingValueInt = util::missingValue(missingValueInt)
 Missing value (int) More...
 
const float missingValueFloat = util::missingValue(missingValueFloat)
 Missing value (float) More...
 
const std::string missingValueString = util::missingValue(missingValueString)
 Missing value (string) More...
 

Detailed Description

Retrieve and store data for entire sample. This class uses lazy loading; vectors of variables are retrieved once requested and cached after that. Variables in certain groups are optional, meaning that if they are not present on the obsdb they will be filled with a default value if requested.

Definition at line 44 of file EntireSampleDataHandler.h.

Constructor & Destructor Documentation

◆ EntireSampleDataHandler()

ufo::EntireSampleDataHandler::EntireSampleDataHandler ( ioda::ObsSpace &  obsdb,
const DataHandlerParameters options 
)

Definition at line 14 of file EntireSampleDataHandler.cc.

Member Function Documentation

◆ defaultValue() [1/3]

float ufo::EntireSampleDataHandler::defaultValue ( const std::vector< float > &  vec,
const std::string &  groupname 
)
private

Default value used to fill vector of floats.

Definition at line 55 of file EntireSampleDataHandler.cc.

◆ defaultValue() [2/3]

int ufo::EntireSampleDataHandler::defaultValue ( const std::vector< int > &  vec,
const std::string &  groupname 
)
private

Default value used to fill vector of integers.

Definition at line 46 of file EntireSampleDataHandler.cc.

Here is the caller graph for this function:

◆ defaultValue() [3/3]

std::string ufo::EntireSampleDataHandler::defaultValue ( const std::vector< std::string > &  vec,
const std::string &  groupname 
)
private

Default value used to fill vector of strings.

Definition at line 64 of file EntireSampleDataHandler.cc.

◆ get()

template<typename T >
std::vector<T>& ufo::EntireSampleDataHandler::get ( const std::string &  fullname)
inline

Retrieve a vector containing the requested variable for the entire data sample.

  1. If the variable has previously been placed in a vector, return the vector.
  2. If the variable is present in the input data set, fill the vector with those values.
  3. If the variable is not present in the input data set, and 'optional' is true, fill the vector with zeros.
  4. If the variable is not present in the input data set, and 'optional' is false, do not fill the vector. Also store the name of the variable, enabling it to be retrieved later.

Definition at line 58 of file EntireSampleDataHandler.h.

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

◆ initialiseVector()

template<typename T >
void ufo::EntireSampleDataHandler::initialiseVector ( const std::string  fullname)
inline

Initialise vector in the entire sample for a variable that is not currently stored. Fill the vector with the default value for the data type.

Definition at line 103 of file EntireSampleDataHandler.h.

Here is the call graph for this function:

◆ putDataVector()

template<typename T >
void ufo::EntireSampleDataHandler::putDataVector ( const std::string &  fullname,
const std::vector< T > &  datavec 
)
inlineprivate

Put entire data vector on obsdb.

Definition at line 127 of file EntireSampleDataHandler.h.

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

◆ writeQuantitiesToObsdb()

void ufo::EntireSampleDataHandler::writeQuantitiesToObsdb ( )

Write various quantities to the obsdb so they can be used in future QC checks. The particular variables written out are hardcoded but this could be changed to a configurable list if requred.

Definition at line 20 of file EntireSampleDataHandler.cc.

Here is the call graph for this function:

Member Data Documentation

◆ entireSampleData_

std::unordered_map<std::string, boost::variant <std::vector <int>, std::vector <float>, std::vector <std::string> > > ufo::EntireSampleDataHandler::entireSampleData_
private

Container of each variable in the entire data set.

Definition at line 157 of file EntireSampleDataHandler.h.

◆ missingValueFloat

const float ufo::EntireSampleDataHandler::missingValueFloat = util::missingValue(missingValueFloat)
private

Missing value (float)

Definition at line 163 of file EntireSampleDataHandler.h.

◆ missingValueInt

const int ufo::EntireSampleDataHandler::missingValueInt = util::missingValue(missingValueInt)
private

Missing value (int)

Definition at line 160 of file EntireSampleDataHandler.h.

◆ missingValueString

const std::string ufo::EntireSampleDataHandler::missingValueString = util::missingValue(missingValueString)
private

Missing value (string)

Definition at line 166 of file EntireSampleDataHandler.h.

◆ obsdb_

ioda::ObsSpace& ufo::EntireSampleDataHandler::obsdb_
private

Observation database.

Definition at line 141 of file EntireSampleDataHandler.h.

◆ options_

const DataHandlerParameters& ufo::EntireSampleDataHandler::options_
private

Configurable parameters.

Definition at line 144 of file EntireSampleDataHandler.h.


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