11 #ifndef OOPS_BASE_OBSSPACES_H_
12 #define OOPS_BASE_OBSSPACES_H_
21 #include "eckit/config/LocalConfiguration.h"
22 #include "eckit/exception/Exceptions.h"
23 #include "eckit/geometry/Point2.h"
27 #include "oops/util/DateTime.h"
28 #include "oops/util/Logger.h"
29 #include "oops/util/ObjectCounter.h"
30 #include "oops/util/Printable.h"
31 #include "oops/util/Timer.h"
39 template <
typename OBS>
41 private util::ObjectCounter<ObsSpaces<OBS> > {
46 static const std::string
classname() {
return "oops::ObsSpaces";}
48 ObsSpaces(
const eckit::Configuration &,
const eckit::mpi::Comm &,
49 const util::DateTime &,
const util::DateTime &,
51 ObsSpaces(
const ObsSpaces &,
const eckit::geometry::Point2 &,
const eckit::Configuration &);
53 explicit ObsSpaces(
const std::shared_ptr<ObsSpace_> &);
69 void print(std::ostream &)
const;
71 std::vector<std::shared_ptr<ObsSpace_> >
spaces_;
78 template <
typename OBS>
80 const util::DateTime & bgn,
const util::DateTime & end,
81 const eckit::mpi::Comm & time)
82 : spaces_(0), wbgn_(bgn), wend_(end)
84 const int seed_member = conf.getInt(
"obs perturbations seed", 0);
85 std::vector<eckit::LocalConfiguration> typeconfs;
86 conf.get(
"observations", typeconfs);
87 for (std::size_t jj = 0; jj < typeconfs.size(); ++jj) {
88 eckit::LocalConfiguration obsconf(typeconfs[jj],
"obs space");
89 obsconf.set(
"obs perturbations seed", seed_member);
90 Log::debug() <<
"ObsSpaces::ObsSpaces : conf " << obsconf << std::endl;
91 std::shared_ptr<ObsSpace_> tmp(
new ObsSpace_(obsconf, comm, bgn, end, time));
99 template <
typename OBS>
101 const eckit::Configuration & conf)
102 : spaces_(0), wbgn_(obss.wbgn_), wend_(obss.wend_)
104 std::vector<eckit::LocalConfiguration> typeconfs;
105 conf.get(
"observations", typeconfs);
106 for (std::size_t jj = 0; jj < obss.
size(); ++jj) {
107 eckit::LocalConfiguration locconf(typeconfs[jj],
"obs error.localization");
108 std::shared_ptr<ObsSpace_> tmp(
new ObsSpace_(obss[jj], center, locconf));
116 template <
typename OBS>
118 : spaces_(obss), wbgn_(obss->windowStart()), wend_(obss->windowEnd())
123 template <
typename OBS>
128 template <
typename OBS>
130 for (std::size_t jj = 0; jj < spaces_.size(); ++jj) {
137 template <
typename OBS>
139 for (std::size_t jj = 0; jj < spaces_.size(); ++jj) {
140 spaces_[jj]->printJo(dy[jj], grad[jj]);
148 #endif // OOPS_BASE_OBSSPACES_H_