11 #ifndef OOPS_BASE_OBSERRORS_H_
12 #define OOPS_BASE_OBSERRORS_H_
14 #include <Eigen/Dense>
19 #include <boost/noncopyable.hpp>
24 #include "oops/util/Logger.h"
25 #include "oops/util/Printable.h"
31 template <
typename OBS>
33 private boost::noncopyable {
40 static const std::string
classname() {
return "oops::ObsErrors";}
61 void print(std::ostream &)
const;
62 std::vector<std::unique_ptr<ObsError_> >
err_;
67 template <
typename OBS>
70 std::vector<eckit::LocalConfiguration> obsconf;
71 config.get(
"observations", obsconf);
72 for (
size_t jj = 0; jj < os.
size(); ++jj) {
73 eckit::LocalConfiguration conf(obsconf[jj],
"obs error");
80 template <
typename OBS>
82 for (
size_t jj = 0; jj < err_.size(); ++jj) {
83 err_[jj]->multiply(dy[jj]);
89 template <
typename OBS>
91 for (
size_t jj = 0; jj < err_.size(); ++jj) {
92 err_[jj]->inverseMultiply(dy[jj]);
98 template <
typename OBS>
100 for (
size_t jj = 0; jj < err_.size(); ++jj) {
101 err_[jj]->randomize(dy[jj]);
107 template <
typename OBS>
110 unsigned int nobs = 0;
111 for (
size_t iov = 0; iov < err_.size(); ++iov) {
112 const ObsVector_ & ov = err_[iov]->inverseVariance();
117 Eigen::VectorXd vec(nobs);
119 for (
size_t iov = 0; iov < err_.size(); ++iov) {
120 const ObsVector_ & ov = err_[iov]->inverseVariance();
130 template<
typename OBS>
132 for (
size_t jj = 0; jj < err_.size(); ++jj) os << *err_[jj];
139 #endif // OOPS_BASE_OBSERRORS_H_