UFO
ufo::ProfileDataHolder Class Reference

Profile data holder class. More...

#include <ProfileDataHolder.h>

Collaboration diagram for ufo::ProfileDataHolder:

Public Member Functions

 ProfileDataHolder (ProfileDataHandler &profileDataHandler)
 
void fill (const std::vector< std::string > &variableNamesInt, const std::vector< std::string > &variableNamesFloat, const std::vector< std::string > &variableNamesString, const std::vector< std::string > &variableNamesGeoVaLs, const std::vector< std::string > &variableNamesObsDiags)
 Fill profile with data. More...
 
template<typename T >
std::vector< T > & get (const std::string &fullname)
 Retrieve a vector if it is present. If not, throw an exception. More...
 
std::vector< float > & getGeoVaLVector (const std::string &fullname)
 Retrieve a GeoVaL vector if it is present. If not, throw an exception. More...
 
std::vector< float > & getObsDiagVector (const std::string &fullname)
 Retrieve an ObsDiag vector if it is present. If not, throw an exception. More...
 
template<typename T >
void set (const std::string &fullname, std::vector< T > &&vec_in)
 Set values in a vector. More...
 
int getNumProfileLevels () const
 Get number of profile levels for this profile. More...
 
void moveValuesToHandler ()
 Move all values to the associated ProfileDataHandler. More...
 
void checkObsSpaceSection (ufo::ObsSpaceSection section)
 Check this profile is in the expected ObsSpace section (original or extended). More...
 

Private Attributes

std::size_t numProfileLevels_
 Number of profile levels. More...
 
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...
 
std::unordered_map< std::string, std::vector< float > > profileGeoVaLs_
 Container of GeoVaLs in the current profile. More...
 
std::unordered_map< std::string, std::vector< float > > profileObsDiags_
 Container of ObsDiags in the current profile. More...
 
ProfileDataHandlerprofileDataHandler_
 Profile data handler. More...
 
std::vector< std::string > variableNamesInt_
 Names of int variables. More...
 
std::vector< std::string > variableNamesFloat_
 Names of float variables. More...
 
std::vector< std::string > variableNamesString_
 Names of string variables. More...
 
std::vector< std::string > variableNamesGeoVaLs_
 Names of GeoVaLs. More...
 
std::vector< std::string > variableNamesObsDiags_
 Names of ObsDiags. More...
 

Detailed Description

Profile data holder class.

Stores data for a single profile. Each profile is filled with a user-specified list of variables that are transferred from an associated ProfileDataHandler. A collection of ProfileDataHolders can be used in checks that act on the entire sample of profiles at once (unlike checks that act on each profile individually, in which case the ProfileDataHandler can be used). This class can also be used to modify the values in the associated ProfileDataHandler, which is necessary when updating values in the entire sample.

Definition at line 35 of file ProfileDataHolder.h.

Constructor & Destructor Documentation

◆ ProfileDataHolder()

ufo::ProfileDataHolder::ProfileDataHolder ( ProfileDataHandler profileDataHandler)
explicit

Definition at line 14 of file ProfileDataHolder.cc.

Here is the call graph for this function:

Member Function Documentation

◆ checkObsSpaceSection()

void ufo::ProfileDataHolder::checkObsSpaceSection ( ufo::ObsSpaceSection  section)

Check this profile is in the expected ObsSpace section (original or extended).

Definition at line 79 of file ProfileDataHolder.cc.

Here is the caller graph for this function:

◆ fill()

void ufo::ProfileDataHolder::fill ( const std::vector< std::string > &  variableNamesInt,
const std::vector< std::string > &  variableNamesFloat,
const std::vector< std::string > &  variableNamesString,
const std::vector< std::string > &  variableNamesGeoVaLs,
const std::vector< std::string > &  variableNamesObsDiags 
)

Fill profile with data.

Definition at line 20 of file ProfileDataHolder.cc.

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

◆ get()

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

Retrieve a vector if it is present. If not, throw an exception.

Definition at line 48 of file ProfileDataHolder.h.

Here is the caller graph for this function:

◆ getGeoVaLVector()

std::vector< float > & ufo::ProfileDataHolder::getGeoVaLVector ( const std::string &  fullname)

Retrieve a GeoVaL vector if it is present. If not, throw an exception.

Definition at line 44 of file ProfileDataHolder.cc.

Here is the caller graph for this function:

◆ getNumProfileLevels()

int ufo::ProfileDataHolder::getNumProfileLevels ( ) const
inline

Get number of profile levels for this profile.

Definition at line 89 of file ProfileDataHolder.h.

Here is the caller graph for this function:

◆ getObsDiagVector()

std::vector< float > & ufo::ProfileDataHolder::getObsDiagVector ( const std::string &  fullname)

Retrieve an ObsDiag vector if it is present. If not, throw an exception.

Definition at line 56 of file ProfileDataHolder.cc.

Here is the caller graph for this function:

◆ moveValuesToHandler()

void ufo::ProfileDataHolder::moveValuesToHandler ( )

Move all values to the associated ProfileDataHandler.

Definition at line 68 of file ProfileDataHolder.cc.

Here is the call graph for this function:

◆ set()

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

Set values in a vector.

Definition at line 75 of file ProfileDataHolder.h.

Here is the caller graph for this function:

Member Data Documentation

◆ numProfileLevels_

std::size_t ufo::ProfileDataHolder::numProfileLevels_
private

Number of profile levels.

Definition at line 99 of file ProfileDataHolder.h.

◆ profileData_

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

Container of each variable in the current profile.

Definition at line 103 of file ProfileDataHolder.h.

◆ profileDataHandler_

ProfileDataHandler& ufo::ProfileDataHolder::profileDataHandler_
private

Profile data handler.

Definition at line 112 of file ProfileDataHolder.h.

◆ profileGeoVaLs_

std::unordered_map<std::string, std::vector <float> > ufo::ProfileDataHolder::profileGeoVaLs_
private

Container of GeoVaLs in the current profile.

Definition at line 106 of file ProfileDataHolder.h.

◆ profileObsDiags_

std::unordered_map<std::string, std::vector <float> > ufo::ProfileDataHolder::profileObsDiags_
private

Container of ObsDiags in the current profile.

Definition at line 109 of file ProfileDataHolder.h.

◆ variableNamesFloat_

std::vector<std::string> ufo::ProfileDataHolder::variableNamesFloat_
private

Names of float variables.

Definition at line 118 of file ProfileDataHolder.h.

◆ variableNamesGeoVaLs_

std::vector<std::string> ufo::ProfileDataHolder::variableNamesGeoVaLs_
private

Names of GeoVaLs.

Definition at line 124 of file ProfileDataHolder.h.

◆ variableNamesInt_

std::vector<std::string> ufo::ProfileDataHolder::variableNamesInt_
private

Names of int variables.

Definition at line 115 of file ProfileDataHolder.h.

◆ variableNamesObsDiags_

std::vector<std::string> ufo::ProfileDataHolder::variableNamesObsDiags_
private

Names of ObsDiags.

Definition at line 127 of file ProfileDataHolder.h.

◆ variableNamesString_

std::vector<std::string> ufo::ProfileDataHolder::variableNamesString_
private

Names of string variables.

Definition at line 121 of file ProfileDataHolder.h.


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