FV3 Bundle
src/ioda/ObsSpace.h
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2017 UCAR
3  *
4  * This software is licensed under the terms of the Apache Licence Version 2.0
5  * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
6  */
7 
8 #ifndef IODA_OBSSPACE_H_
9 #define IODA_OBSSPACE_H_
10 
11 #include <map>
12 #include <ostream>
13 #include <string>
14 #include <vector>
15 
16 #include "eckit/mpi/Comm.h"
18 #include "oops/util/DateTime.h"
19 #include "oops/util/Logger.h"
20 #include "oops/util/Printable.h"
21 
22 #include "Fortran.h"
23 
24 // Forward declarations
25 namespace eckit {
26  class Configuration;
27 }
28 
29 namespace ioda {
30  class Locations;
31  class ObsVector;
32 
33 /// Wrapper around ObsHelpQG, mostly to hide the factory
34 class ObsSpace : public oops::ObsSpaceBase {
35  public:
36  ObsSpace(const eckit::Configuration &, const util::DateTime &, const util::DateTime &);
37  ObsSpace(const ObsSpace &);
38  ~ObsSpace();
39 
40  void getObsVector(const std::string &, std::vector<double> &) const;
41  void putObsVector(const std::string &, const std::vector<double> &) const;
42 
43  Locations * locations(const util::DateTime &, const util::DateTime &) const; // to be removed
44 
45  void generateDistribution(const eckit::Configuration &);
46 
47  const std::string & obsname() const {return obsname_;}
48  const util::DateTime & windowStart() const {return winbgn_;}
49  const util::DateTime & windowEnd() const {return winend_;}
50 
51  int nobs() const;
52  int nlocs() const;
53 
54  void get_db(const std::string &, const std::string &, const std::size_t &, int[]) const;
55  void get_db(const std::string &, const std::string &, const std::size_t &, double[]) const;
56  void put_db(const std::string &, const std::string &, const std::size_t &, const int[]) const;
57  void put_db(const std::string &, const std::string &, const std::size_t &, const double[]) const;
58 
59  const eckit::mpi::Comm & comm() const {return commMPI_;}
60  void printJo(const ObsVector &, const ObsVector &);
61 
62  private:
63  void print(std::ostream &) const;
64 
65  ObsSpace & operator= (const ObsSpace &);
66  std::string obsname_;
67  const util::DateTime winbgn_;
68  const util::DateTime winend_;
70  const eckit::mpi::Comm & commMPI_;
71 
72  static std::map < std::string, int > theObsFileCount_;
73 };
74 
75 } // namespace ioda
76 
77 #endif // IODA_OBSSPACE_H_
void get_db(const std::string &, const std::string &, const std::size_t &, int[]) const
Definition: ObsSpace.cc:57
ObsSpace & operator=(const ObsSpace &)
ObsVector class to handle vectors in observation space for IODA.
const std::string & obsname() const
int nlocs() const
Definition: ObsSpace.cc:98
const eckit::mpi::Comm & comm() const
ObsSpace(const eckit::Configuration &, const util::DateTime &, const util::DateTime &)
Definition: ObsSpace.cc:25
const eckit::mpi::Comm & commMPI_
void print(std::ostream &) const
Definition: ObsSpace.cc:116
Wrapper around ObsHelpQG, mostly to hide the factory.
void printJo(const ObsVector &, const ObsVector &)
Definition: ObsSpace.cc:122
void getObsVector(const std::string &, std::vector< double > &) const
Definition: ObsSpace.cc:46
int nobs() const
Definition: ObsSpace.cc:89
Base class for observation spaces.
Definition: ObsSpaceBase.h:25
const util::DateTime & windowEnd() const
const util::DateTime winend_
void putObsVector(const std::string &, const std::vector< double > &) const
Definition: ObsSpace.cc:52
Locations class to handle locations for IODA.
void put_db(const std::string &, const std::string &, const std::size_t &, const int[]) const
Definition: ObsSpace.cc:67
std::string obsname_
Locations * locations(const util::DateTime &, const util::DateTime &) const
Definition: ObsSpace.cc:78
void generateDistribution(const eckit::Configuration &)
Pure virtual methods.
Definition: ObsSpace.cc:106
const util::DateTime winbgn_
static std::map< std::string, int > theObsFileCount_
const util::DateTime & windowStart() const