UFO
ufo::ProfileDataHandler Class Reference

Retrieve and store data for individual profiles. To do this, first the vector of values in the entire data sample is retrieved then the relevant data corresponding to this profile are extracted. More...

#include <ProfileDataHandler.h>

Collaboration diagram for ufo::ProfileDataHandler:

Public Member Functions

 ProfileDataHandler (ioda::ObsSpace &obsdb, const DataHandlerParameters &options, EntireSampleDataHandler &entireSampleDataHandler, const ProfileIndices &profileIndices)
 
template<typename T >
std::vector< T > & get (const std::string &fullname)
 
template<typename T >
void set (const std::string &fullname, std::vector< T > &&vec_in)
 
void reset ()
 
template<typename T >
void updateValueIfPresent (const std::vector< T > &vecIn, const size_t &idxIn, std::vector< T > &vecOut, const size_t &idxOut)
 Transfer values from one vector to another (as long as neither is empty). More...
 
void updateEntireSampleData ()
 
void setFinalReportFlags ()
 Set final report flags based on the NumAnyErrors counter. More...
 
void setFlagged (const size_t nvars, std::vector< std::vector< bool >> &flagged)
 
void getProfileIndicesInEntireSample (const std::string &groupname)
 Get indices in entire sample corresponding to current profile. More...
 
ioda::ObsSpace & getObsdb ()
 Return obsdb. More...
 

Private Attributes

std::unordered_map< std::string, boost::variant< std::vector< int >, std::vector< float >, std::vector< std::string > > > profileData_
 Container of each variable in the current profile. More...
 
ioda::ObsSpace & obsdb_
 Observation database. More...
 
const DataHandlerParametersoptions_
 Configurable parameters. More...
 
EntireSampleDataHandlerentireSampleDataHandler_
 Class that handles the entire data sample. More...
 
const ProfileIndicesprofileIndices_
 Class that handles profile indices. More...
 
std::vector< size_t > profileIndicesInEntireSample_
 Indices in the entire data sample that correspond to the current profile. More...
 

Detailed Description

Retrieve and store data for individual profiles. To do this, first the vector of values in the entire data sample is retrieved then the relevant data corresponding to this profile are extracted.

Definition at line 40 of file ProfileDataHandler.h.

Constructor & Destructor Documentation

◆ ProfileDataHandler()

ufo::ProfileDataHandler::ProfileDataHandler ( ioda::ObsSpace &  obsdb,
const DataHandlerParameters options,
EntireSampleDataHandler entireSampleDataHandler,
const ProfileIndices profileIndices 
)

Definition at line 12 of file ProfileDataHandler.cc.

Member Function Documentation

◆ get()

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

Retrieve a vector containing the requested variable for the current profile.

  1. If the variable has previously been placed in a vector, return the vector.
  2. Otherwise obtain the vector from the entire data sample, as long as the entire sample is not empty. Also store the name of the variable, enabling it to be retrieved later.

Definition at line 53 of file ProfileDataHandler.h.

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

◆ getObsdb()

ioda::ObsSpace& ufo::ProfileDataHandler::getObsdb ( )
inline

Return obsdb.

Definition at line 136 of file ProfileDataHandler.h.

Here is the caller graph for this function:

◆ getProfileIndicesInEntireSample()

void ufo::ProfileDataHandler::getProfileIndicesInEntireSample ( const std::string &  groupname)

Get indices in entire sample corresponding to current profile.

Definition at line 27 of file ProfileDataHandler.cc.

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

◆ reset()

void ufo::ProfileDataHandler::reset ( )

Reset profile information (vectors and corresponding names). This should be called every time a new profile will be retrieved.

Definition at line 22 of file ProfileDataHandler.cc.

Here is the caller graph for this function:

◆ set()

template<typename T >
void ufo::ProfileDataHandler::set ( const std::string &  fullname,
std::vector< T > &&  vec_in 
)
inline

Directly set a vector for the current profile. Typically used to store variables that are used locally in checks (e.g. intermediate values).

Definition at line 92 of file ProfileDataHandler.h.

Here is the caller graph for this function:

◆ setFinalReportFlags()

void ufo::ProfileDataHandler::setFinalReportFlags ( )

Set final report flags based on the NumAnyErrors counter.

Definition at line 74 of file ProfileDataHandler.cc.

Here is the caller graph for this function:

◆ setFlagged()

void ufo::ProfileDataHandler::setFlagged ( const size_t  nvars,
std::vector< std::vector< bool >> &  flagged 
)

Update the 'flagged' vector based on any flags that may have changed during the checks. The QC flag group is hardocded but this could be changed to a configurable value if required.

Definition at line 87 of file ProfileDataHandler.cc.

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

◆ updateEntireSampleData()

void ufo::ProfileDataHandler::updateEntireSampleData ( )

If any variables in the current profile were modified by the checks, the equivalent variables in the entire sample are set to the modified values. The variables that are (potentially) modified are hardcoded but this could be changed to a configurable list if requred.

Definition at line 44 of file ProfileDataHandler.cc.

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

◆ updateValueIfPresent()

template<typename T >
void ufo::ProfileDataHandler::updateValueIfPresent ( const std::vector< T > &  vecIn,
const size_t &  idxIn,
std::vector< T > &  vecOut,
const size_t &  idxOut 
)
inline

Transfer values from one vector to another (as long as neither is empty).

Definition at line 110 of file ProfileDataHandler.h.

Here is the caller graph for this function:

Member Data Documentation

◆ entireSampleDataHandler_

EntireSampleDataHandler& ufo::ProfileDataHandler::entireSampleDataHandler_
private

Class that handles the entire data sample.

Definition at line 150 of file ProfileDataHandler.h.

◆ obsdb_

ioda::ObsSpace& ufo::ProfileDataHandler::obsdb_
private

Observation database.

Definition at line 144 of file ProfileDataHandler.h.

◆ options_

const DataHandlerParameters& ufo::ProfileDataHandler::options_
private

Configurable parameters.

Definition at line 147 of file ProfileDataHandler.h.

◆ profileData_

std::unordered_map<std::string, boost::variant <std::vector <int>, std::vector <float>, std::vector <std::string> > > ufo::ProfileDataHandler::profileData_
private

Container of each variable in the current profile.

Definition at line 141 of file ProfileDataHandler.h.

◆ profileIndices_

const ProfileIndices& ufo::ProfileDataHandler::profileIndices_
private

Class that handles profile indices.

Definition at line 153 of file ProfileDataHandler.h.

◆ profileIndicesInEntireSample_

std::vector<size_t> ufo::ProfileDataHandler::profileIndicesInEntireSample_
private

Indices in the entire data sample that correspond to the current profile.

Definition at line 156 of file ProfileDataHandler.h.


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