11 #ifndef OOPS_BASE_OBSERVATIONS_H_ 12 #define OOPS_BASE_OBSERVATIONS_H_ 19 #include <boost/ptr_container/ptr_vector.hpp> 20 #include <boost/shared_ptr.hpp> 22 #include "eckit/config/Configuration.h" 29 #include "oops/util/abor1_cpp.h" 30 #include "oops/util/DateTime.h" 31 #include "oops/util/Logger.h" 32 #include "oops/util/Printable.h" 45 template <
typename MODEL>
class Observations :
public util::Printable {
69 void save(
const std::string &)
const;
70 void read(
const eckit::Configuration &);
73 void print(std::ostream &)
const;
75 boost::ptr_vector<ObsVector_>
obs_;
80 template <
typename MODEL>
83 for (std::size_t jj = 0; jj < obsdb.
size(); ++jj) {
86 Log::trace() <<
"Observations created" << std::endl;
89 template <
typename MODEL>
92 Log::trace() <<
"Observations copy-created" << std::endl;
95 template <
typename MODEL>
97 Log::trace() <<
"Observations destructed" << std::endl;
100 template <
typename MODEL>
102 for (std::size_t jj = 0; jj < obs_.size(); ++jj) {
103 obs_[jj] = rhs.
obs_[jj];
108 template <
typename MODEL>
109 std::vector<boost::shared_ptr<ObsVector<MODEL> > >
111 std::vector<boost::shared_ptr<ObsVector_> >
out;
112 for (std::size_t jj = 0; jj < obs_.size(); ++jj) {
113 boost::shared_ptr<ObsVector_> ovec(
new ObsVector_(obs_[jj],
true));
114 *ovec -= other.
obs_[jj];
120 template <
typename MODEL>
122 for (std::size_t jj = 0; jj < obs_.size(); ++jj) {
128 template <
typename MODEL>
130 for (std::size_t jj = 0; jj < obs_.size(); ++jj) {
135 template <
typename MODEL>
137 std::vector<eckit::LocalConfiguration>
conf;
138 config.get(
"ObsTypes",
conf);
139 for (std::size_t jj = 0; jj < obs_.size(); ++jj) {
140 const std::string
name =
conf[jj].getString(
"ObsData.obsvalue");
143 Log::trace() <<
"Observations:Observations have been read" << std::endl;
146 template <
typename MODEL>
148 for (std::size_t jj = 0; jj < obs_.size(); ++jj) os << obs_[jj];
153 #endif // OOPS_BASE_OBSERVATIONS_H_ std::size_t size() const
Access.
ObsVector< MODEL > ObsVector_
boost::ptr_vector< ObsVector_ > obs_
Difference between two observation vectors.
Departures< MODEL > Departures_
The namespace for the main oops code.
Observations & operator+=(const Departures_ &)
Observations & operator=(const Observations &)
ObsAuxControl< MODEL > ObsAuxCtrl_
void save(const std::string &) const
Save observations values.
ObsOperator< MODEL > ObsOperator_
ObsSpaces< MODEL > ObsSpace_
void read(const eckit::Configuration &)
GeoVaLs< MODEL > GeoVaLs_
std::vector< boost::shared_ptr< ObsVector_ > > operator-(const Observations &other) const
Interactions with Departures.
void print(std::ostream &) const
Observations(const ObsSpace_ &)
const ObsVector_ & operator[](const std::size_t ii) const
std::size_t size() const
Access.
ObsVector_ & operator[](const std::size_t ii)