8 #ifndef MAINS_TIMEIODAIO_H_
9 #define MAINS_TIMEIODAIO_H_
14 #include "eckit/config/LocalConfiguration.h"
16 #include "oops/base/Observations.h"
17 #include "oops/base/ObsSpaces.h"
18 #include "oops/mpi/mpi.h"
19 #include "oops/runs/Application.h"
20 #include "oops/util/DateTime.h"
21 #include "oops/util/Duration.h"
22 #include "oops/util/Logger.h"
24 #include "ioda/core/IodaUtils.h"
38 template <
typename MODEL>
class TimeIodaIO :
public oops::Application {
43 explicit TimeIodaIO(
const eckit::mpi::Comm & comm = oops::mpi::world()) : Application(comm) {}
47 int execute(
const eckit::Configuration & fullConfig)
const {
49 const util::DateTime winbgn(fullConfig.getString(
"window begin"));
50 const util::DateTime winend(fullConfig.getString(
"window end"));
51 oops::Log::info() <<
"Observation window begin:" << winbgn << std::endl;
52 oops::Log::info() <<
"Observation window end:" << winend << std::endl;
55 eckit::LocalConfiguration obsconf(fullConfig,
"observations");
56 oops::Log::debug() <<
"Observations configuration is:" << obsconf << std::endl;
57 ObsSpaces_ obsdb(obsconf, this->getComm(), winbgn, winend);
59 for (std::size_t jj = 0; jj < obsdb.size(); ++jj) {
60 oops::Log::info() <<
"ObsSpace: " << obsdb[jj].obsname() << std::endl;
61 oops::Log::info() <<
" Number of locations: " << obsdb[jj].obsspace().nlocs()
63 oops::Log::info() <<
" Number of variables: " << obsdb[jj].obsspace().nvars()
65 oops::Log::info() <<
" Number of records: " << obsdb[jj].obsspace().nrecs()
69 obsdb[jj].obsspace().save();
int execute(const eckit::Configuration &fullConfig) const
std::string appname() const
TimeIodaIO(const eckit::mpi::Comm &comm=oops::mpi::world())
oops::ObsSpaces< MODEL > ObsSpaces_