12 #ifndef OOPS_INTERFACE_OBSSPACE_H_
13 #define OOPS_INTERFACE_OBSSPACE_H_
19 #include "eckit/geometry/Point2.h"
20 #include "eckit/system/ResourceUsage.h"
25 #include "oops/util/Logger.h"
26 #include "oops/util/ObjectCounter.h"
27 #include "oops/util/Printable.h"
28 #include "oops/util/Timer.h"
42 template <
typename OBS>
44 private util::ObjectCounter<ObsSpace<OBS> > {
51 static const std::string
classname() {
return "oops::ObsSpace";}
54 const util::DateTime &,
const util::DateTime &,
83 void print(std::ostream &)
const;
91 template <
typename OBS>
93 const eckit::mpi::Comm & comm,
94 const util::DateTime & bgn,
95 const util::DateTime & end,
96 const eckit::mpi::Comm & time) : obsdb_(), time_(time) {
97 Log::trace() <<
"ObsSpace<OBS>::ObsSpace starting" << std::endl;
98 util::Timer timer(
classname(),
"ObsSpace");
99 size_t init = eckit::system::ResourceUsage().maxResidentSetSize();
101 size_t current = eckit::system::ResourceUsage().maxResidentSetSize();
102 this->setObjectSize(current - init);
103 Log::trace() <<
"ObsSpace<OBS>::ObsSpace done" << std::endl;
108 template <
typename OBS>
110 Log::trace() <<
"ObsSpace<OBS>::~ObsSpace starting" << std::endl;
111 util::Timer timer(classname(),
"~ObsSpace");
113 Log::trace() <<
"ObsSpace<OBS>::~ObsSpace done" << std::endl;
118 template <
typename OBS>
120 Log::trace() <<
"ObsSpace<OBS>::save starting" << std::endl;
121 util::Timer timer(classname(),
"save");
123 Log::trace() <<
"ObsSpace<OBS>::save done" << std::endl;
128 template <
typename OBS>
130 Log::trace() <<
"ObsSpace<OBS>::print starting" << std::endl;
131 util::Timer timer(classname(),
"print");
133 Log::trace() <<
"ObsSpace<OBS>::print done" << std::endl;
138 template <
typename OBS>
140 Log::trace() <<
"ObsSpace<OBS>::obsvariables starting" << std::endl;
141 util::Timer timer(classname(),
"obsvariables");
142 return obsdb_->obsvariables();
147 template <
typename OBS>
149 Log::trace() <<
"ObsSpace<OBS>::begin starting" << std::endl;
150 util::Timer timer(classname(),
"begin");
151 Log::trace() <<
"ObsSpace<OBS>::begin done" << std::endl;
157 template <
typename OBS>
159 Log::trace() <<
"ObsSpace<OBS>::end starting" << std::endl;
160 util::Timer timer(classname(),
"end");
161 Log::trace() <<
"ObsSpace<OBS>::end done" << std::endl;
std::unique_ptr< ObsSpace_ > obsdb_
void print(std::ostream &) const
ObsIterator_ end() const
Iterator to the past-the-end observation (after last)
ObsSpace(const ObsSpace &)=delete
ObsSpace_::Parameters_ Parameters_
ObsIterator_ begin() const
Iterator to the first observation.
ObsSpace(const Parameters_ &, const eckit::mpi::Comm &, const util::DateTime &, const util::DateTime &, const eckit::mpi::Comm &time=oops::mpi::myself())
ObsSpace_ & obsspace() const
Interfacing.
static const std::string classname()
const eckit::mpi::Comm & time_
const std::string & obsname() const
const util::DateTime & windowStart() const
Assimilation window.
const eckit::mpi::Comm & timeComm() const
const Variables & obsvariables() const
GeometryIterator< OBS > ObsIterator_
const util::DateTime & windowEnd() const
const eckit::mpi::Comm & myself()
Default communicator with each MPI task by itself.
The namespace for the main oops code.