UFO
|
Profile data holder class. More...
#include <ProfileDataHolder.h>
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... | |
ProfileDataHandler & | profileDataHandler_ |
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... | |
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.
|
explicit |
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.
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.
|
inline |
Retrieve a vector if it is present. If not, throw an exception.
Definition at line 48 of file ProfileDataHolder.h.
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.
|
inline |
Get number of profile levels for this profile.
Definition at line 89 of file ProfileDataHolder.h.
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.
void ufo::ProfileDataHolder::moveValuesToHandler | ( | ) |
Move all values to the associated ProfileDataHandler.
Definition at line 68 of file ProfileDataHolder.cc.
|
inline |
Set values in a vector.
Definition at line 75 of file ProfileDataHolder.h.
|
private |
Number of profile levels.
Definition at line 99 of file ProfileDataHolder.h.
|
private |
Container of each variable in the current profile.
Definition at line 103 of file ProfileDataHolder.h.
|
private |
Profile data handler.
Definition at line 112 of file ProfileDataHolder.h.
|
private |
Container of GeoVaLs in the current profile.
Definition at line 106 of file ProfileDataHolder.h.
|
private |
Container of ObsDiags in the current profile.
Definition at line 109 of file ProfileDataHolder.h.
|
private |
Names of float variables.
Definition at line 118 of file ProfileDataHolder.h.
|
private |
Names of GeoVaLs.
Definition at line 124 of file ProfileDataHolder.h.
|
private |
Names of int variables.
Definition at line 115 of file ProfileDataHolder.h.
|
private |
Names of ObsDiags.
Definition at line 127 of file ProfileDataHolder.h.
|
private |
Names of string variables.
Definition at line 121 of file ProfileDataHolder.h.