UFO
ObsIdentity.h
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2021 UK Met Office
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 UFO_IDENTITY_OBSIDENTITY_H_
9 #define UFO_IDENTITY_OBSIDENTITY_H_
10 
11 #include <ostream>
12 #include <string>
13 #include <vector>
14 
15 #include "oops/base/Variables.h"
16 #include "oops/util/ObjectCounter.h"
17 
18 #include "ufo/ObsOperatorBase.h"
19 
20 /// Forward declarations
21 namespace eckit {
22  class Configuration;
23 }
24 
25 namespace ioda {
26  class ObsSpace;
27  class ObsVector;
28 }
29 
30 namespace ufo {
31  class GeoVaLs;
32  class ObsDiagnostics;
33 
34 /// \brief Identity observation operator.
35 ///
36 /// This observation operator transfers model values directly to the H(x) vector, after horizontal
37 /// interpolation has been performed, with no further processing.
38 /// For GeoVaLs with more than one vertical level, only the first entry in the GeoVaL is processed
39 /// in this way.
40 ///
41 /// An example yaml configuration is:
42 ///
43 /// obs operator:
44 /// name: Identity
45 ///
46 /// This operator also accepts an optional `variables` parameter, which controls which ObsSpace
47 /// variables will be simulated. This option should only be set if this operator is used as a
48 /// component of the Composite operator. If `variables` is not set, the operator will simulate
49 /// all ObsSpace variables. Please see the documentation of the Composite operator for further
50 /// details.
52  private util::ObjectCounter<ObsIdentity> {
53  public:
54  static const std::string classname() {return "ufo::ObsIdentity";}
55 
56  ObsIdentity(const ioda::ObsSpace &, const eckit::Configuration &);
57  ~ObsIdentity() override;
58 
59  void simulateObs(const GeoVaLs &, ioda::ObsVector &, ObsDiagnostics &) const override;
60 
61  const oops::Variables & requiredVars() const override { return requiredVars_; }
62 
63  oops::Variables simulatedVars() const override { return operatorVars_; }
64 
65  private:
66  void print(std::ostream &) const override;
67 
68  private:
69  /// Required variables.
70  oops::Variables requiredVars_;
71 
72  /// Operator variables.
73  oops::Variables operatorVars_;
74 
75  /// Indices of operator variables.
76  std::vector<int> operatorVarIndices_;
77 };
78 
79 // -----------------------------------------------------------------------------
80 
81 } // namespace ufo
82 #endif // UFO_IDENTITY_OBSIDENTITY_H_
GeoVaLs: geophysical values at locations.
Identity observation operator.
Definition: ObsIdentity.h:52
ObsIdentity(const ioda::ObsSpace &, const eckit::Configuration &)
Definition: ObsIdentity.cc:27
const oops::Variables & requiredVars() const override
Operator input required from Model.
Definition: ObsIdentity.h:61
oops::Variables operatorVars_
Operator variables.
Definition: ObsIdentity.h:73
std::vector< int > operatorVarIndices_
Indices of operator variables.
Definition: ObsIdentity.h:76
oops::Variables requiredVars_
Required variables.
Definition: ObsIdentity.h:70
~ObsIdentity() override
Definition: ObsIdentity.cc:41
static const std::string classname()
Definition: ObsIdentity.h:54
void simulateObs(const GeoVaLs &, ioda::ObsVector &, ObsDiagnostics &) const override
Obs Operator.
Definition: ObsIdentity.cc:47
oops::Variables simulatedVars() const override
List of variables simulated by this operator.
Definition: ObsIdentity.h:63
void print(std::ostream &) const override
Definition: ObsIdentity.cc:67
Forward declarations.
Definition: ObsAodExt.h:21
Forward declarations.
Definition: ObsAodExt.h:25
Definition: RunCRTM.h:27