IODA
|
Obs container class for IODA. More...
#include <ObsSpaceContainer.h>
Classes | |
struct | by_group |
struct | by_variable |
struct | VarRecord |
elemental struct of the obs container More... | |
Public Types | |
typedef boost::multi_index::index< VarRecord_set, by_variable >::type | VarIndex |
index by variable More... | |
typedef VarIndex::iterator | VarIter |
variable iterator More... | |
typedef VarRecord_set::iterator | DbIter |
container iterator More... | |
Public Member Functions | |
ObsSpaceContainer () | |
~ObsSpaceContainer () | |
VarIter | var_iter_begin () |
VarIter | var_iter_end () |
std::string | var_iter_vname (VarIter) |
std::string | var_iter_gname (VarIter) |
std::string | var_iter_mode (VarIter) |
std::size_t | var_iter_size (VarIter) |
std::vector< std::size_t > | var_iter_shape (VarIter) |
DbIter | find (const std::string &, const std::string &) const |
DbIter | begin () const |
DbIter | end () const |
const std::type_info & | dtype (const DbIter) const |
const std::type_info & | dtype (const std::string &, const std::string &) const |
bool | has (const std::string &group, const std::string &variable) const |
std::size_t | nlocs () const |
Return the number of uniqure observation locations on this PE. More... | |
std::size_t | nvars () const |
Return the number of observational variables. More... | |
void | LoadFromDb (const std::string &GroupName, const std::string &VarName, const std::vector< std::size_t > &VarShape, std::vector< ContType > &VarData, const std::size_t Start=0, const std::size_t Count=0) const |
load data from the obs container More... | |
void | StoreToDb (const std::string &GroupName, const std::string &VarName, const std::vector< std::size_t > &VarShape, const std::vector< ContType > &VarData, const bool Append=false) |
store data into the obs container More... | |
Private Types | |
using | VarRecord_set = multi_index_container< VarRecord, indexed_by< ordered_unique< composite_key< VarRecord, member< VarRecord, std::string, &VarRecord::group >, member< VarRecord, std::string, &VarRecord::variable > > >, ordered_non_unique< tag< by_group >, member< VarRecord, std::string, &VarRecord::group > >, ordered_non_unique< tag< by_variable >, member< VarRecord, std::string, &VarRecord::variable > > > > |
Multi Index container for obs data. More... | |
Private Member Functions | |
void | print (std::ostream &) const |
Print. More... | |
Static Private Member Functions | |
static std::size_t | SetSegmentEnd (std::size_t Start, std::size_t Count, std::size_t VarSize) |
set end of vector segment More... | |
Private Attributes | |
VarRecord_set | DataContainer |
obs container instance More... | |
std::size_t | nlocs_ |
number of locations on this PE More... | |
std::size_t | nvars_ |
number of observational variables More... | |
Obs container class for IODA.
This class provides a container to hold obs data in memory for use by the ObsSpace class. The container is a Boost Multi Index container (header-only implementation from Boost) which essentially creates indexing structures that point to a set of C structs. Each structure holds the keys that identify that structure and the data the are associated with those keys. There are two keys, group and variable, which identify each struct. The group corresponds to collections of variables such as "ObsValue", "ObsError", "PreQC" and "MetaData". The variables are individual quantities such as "air_temperature" and "brightness_temperature".
Definition at line 64 of file src/core/ObsSpaceContainer.h.
typedef VarRecord_set::iterator ioda::ObsSpaceContainer< ContType >::DbIter |
container iterator
This typedef defines an iterator that can walk through the obs container using the primary indexing (by group and variable).
Definition at line 185 of file src/core/ObsSpaceContainer.h.
typedef boost::multi_index::index<VarRecord_set, by_variable>::type ioda::ObsSpaceContainer< ContType >::VarIndex |
index by variable
This typedef defines the index mechanism that allows access to the obs container through the secondary indexing by variable.
Definition at line 169 of file src/core/ObsSpaceContainer.h.
typedef VarIndex::iterator ioda::ObsSpaceContainer< ContType >::VarIter |
variable iterator
This typedef defines an iterator that can walk through the obs container by variable. It utilizes the secondary indexing by variable.
Definition at line 177 of file src/core/ObsSpaceContainer.h.
|
private |
Multi Index container for obs data.
This typedef defines the indexing structure of the obs data container. The primary index is a composite key (tuple) consisting of the group and variable names. The iterator of the container itself uses this primary index, as well as the typical container methods such as find and insert. Two more secondary indexes are provided, one by group and the other by variable. These secondary indexes have their own iterators associated with them. See the boost::multiindex documentation for more details.
Definition at line 134 of file src/core/ObsSpaceContainer.h.
ioda::ObsSpaceContainer< ContType >::ObsSpaceContainer |
Definition at line 241 of file src/core/ObsSpaceContainer.h.
ioda::ObsSpaceContainer< ContType >::~ObsSpaceContainer |
Definition at line 248 of file src/core/ObsSpaceContainer.h.
ObsSpaceContainer< ContType >::DbIter ioda::ObsSpaceContainer< ContType >::begin |
This method returns the begin iterator for the obs container.
Definition at line 422 of file src/core/ObsSpaceContainer.h.
const std::type_info & ioda::ObsSpaceContainer< ContType >::dtype | ( | const DbIter | Idb | ) | const |
This method returns the data type associated with the obs container entry pointed to by Idb.
[in] | Idb | Iterator pointing to the current element of the obs container. |
Definition at line 446 of file src/core/ObsSpaceContainer.h.
const std::type_info & ioda::ObsSpaceContainer< ContType >::dtype | ( | const std::string & | group, |
const std::string & | variable | ||
) | const |
This method returns the data type associated with the obs container entry defined by the given group and variable. If the entry does not exist, the typeid for void is returned.
[in] | group | Name of obs container group |
[in] | variable | Name of obs container variable |
Definition at line 461 of file src/core/ObsSpaceContainer.h.
ObsSpaceContainer< ContType >::DbIter ioda::ObsSpaceContainer< ContType >::end |
This method returns the end iterator for the obs container.
Definition at line 433 of file src/core/ObsSpaceContainer.h.
ObsSpaceContainer< ContType >::DbIter ioda::ObsSpaceContainer< ContType >::find | ( | const std::string & | group, |
const std::string & | variable | ||
) | const |
This method returns an obs container iterator that indicates if the given group, variable entry exists. If the entry exists, then the iterator value that is returned will point to that entry. Otherwise, the iterator is set to the end() value to indicate the entry does is not found.
[in] | group | Name of obs container group |
[in] | variable | Name of obs container variable |
Definition at line 409 of file src/core/ObsSpaceContainer.h.
bool ioda::ObsSpaceContainer< ContType >::has | ( | const std::string & | group, |
const std::string & | variable | ||
) | const |
This method returns a boolean that indicates if the given group, variable entry exists in the obs container. If the entry exists, then "true" is returned. Otherwise, "false" is returned.
[in] | group | Name of obs container group |
[in] | variable | Name of obs container variable |
Definition at line 553 of file src/core/ObsSpaceContainer.h.
void ioda::ObsSpaceContainer< ContType >::LoadFromDb | ( | const std::string & | GroupName, |
const std::string & | VarName, | ||
const std::vector< std::size_t > & | VarShape, | ||
std::vector< ContType > & | VarData, | ||
const std::size_t | Start = 0 , |
||
const std::size_t | Count = 0 |
||
) | const |
load data from the obs container
This method transfers data from the obs container to the caller's memory. The caller needs to allocate the memory that the VarData parameter points to. This method handles the lookup of the container group, variable entry, and checking that the data type in the container matches that of the VarData parameter.
[in] | GroupName | Name of container group (ObsValue, ObsError, MetaData, etc.) |
[in] | VarName | Name of container variable |
[in] | VarShape | Dimension sizes of variable |
[in] | VarData | Pointer to memory that will loaded from the container. |
Definition at line 317 of file src/core/ObsSpaceContainer.h.
|
inline |
Return the number of uniqure observation locations on this PE.
Definition at line 206 of file src/core/ObsSpaceContainer.h.
|
inline |
Return the number of observational variables.
Definition at line 209 of file src/core/ObsSpaceContainer.h.
|
private |
Print.
print method for Printable base class
This method provides a print routine so that the obs container can be used in an output stream. A list of all group, variable combinations present in the obs container is printed out.
Definition at line 568 of file src/core/ObsSpaceContainer.h.
|
staticprivate |
set end of vector segment
This method returns the ending index for the vector segment given the start and count values.
Definition at line 351 of file src/core/ObsSpaceContainer.h.
void ioda::ObsSpaceContainer< ContType >::StoreToDb | ( | const std::string & | GroupName, |
const std::string & | VarName, | ||
const std::vector< std::size_t > & | VarShape, | ||
const std::vector< ContType > & | VarData, | ||
const bool | Append = false |
||
) |
store data into the obs container
This method transfers data from the caller's memory into the obs conatiner. The caller needs to allocate and assign the memory that the VarData parameter points to. This method also handles checking that the varible has write permission if it already exists in the obs container.
[in] | GroupName | Name of container group (ObsValue, ObsError, MetaData, etc.) |
[in] | VarName | Name of container variable |
[in] | VarShape | Dimension sizes of variable |
[in] | VarData | Pointer to memory that will be stored in the container |
Definition at line 268 of file src/core/ObsSpaceContainer.h.
ObsSpaceContainer< ContType >::VarIter ioda::ObsSpaceContainer< ContType >::var_iter_begin |
This method returns the begin iterator for access by variable in the obs container.
Definition at line 377 of file src/core/ObsSpaceContainer.h.
ObsSpaceContainer< ContType >::VarIter ioda::ObsSpaceContainer< ContType >::var_iter_end |
This method returns the end iterator for access by variable in the obs container.
Definition at line 390 of file src/core/ObsSpaceContainer.h.
std::string ioda::ObsSpaceContainer< ContType >::var_iter_gname | ( | VarIter | ) |
This method returns the group name associated with the obs container entry pointed to by var_iter.
[in] | var_iter | Iterator of the indexing by variable type. |
Definition at line 494 of file src/core/ObsSpaceContainer.h.
std::string ioda::ObsSpaceContainer< ContType >::var_iter_mode | ( | VarIter | ) |
This method returns the access mode associated with the obs container entry pointed to by var_iter.
[in] | var_iter | Iterator of the indexing by variable type. |
Definition at line 508 of file src/core/ObsSpaceContainer.h.
std::vector< std::size_t > ioda::ObsSpaceContainer< ContType >::var_iter_shape | ( | VarIter | ) |
This method returns the data shape associated with the obs container entry pointed to by var_iter.
[in] | var_iter | Iterator of the indexing by variable type. |
Definition at line 536 of file src/core/ObsSpaceContainer.h.
std::size_t ioda::ObsSpaceContainer< ContType >::var_iter_size | ( | VarIter | ) |
This method returns the data size associated with the obs container entry pointed to by var_iter.
[in] | var_iter | Iterator of the indexing by variable type. |
Definition at line 522 of file src/core/ObsSpaceContainer.h.
std::string ioda::ObsSpaceContainer< ContType >::var_iter_vname | ( | VarIter | ) |
This method returns the variable name associated with the obs container entry pointed to by var_iter.
[in] | var_iter | Iterator of the indexing by variable type. |
Definition at line 480 of file src/core/ObsSpaceContainer.h.
|
private |
obs container instance
Definition at line 226 of file src/core/ObsSpaceContainer.h.
|
private |
number of locations on this PE
Definition at line 229 of file src/core/ObsSpaceContainer.h.
|
private |
number of observational variables
Definition at line 232 of file src/core/ObsSpaceContainer.h.