UFO
ObsComposite.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_COMPOSITEOPER_OBSCOMPOSITE_H_
9 #define UFO_COMPOSITEOPER_OBSCOMPOSITE_H_
10 
11 #include <memory>
12 #include <ostream>
13 #include <string>
14 #include <vector>
15 
16 #include "oops/base/Variables.h"
17 #include "oops/util/ObjectCounter.h"
18 
20 #include "ufo/ObsOperatorBase.h"
21 
22 /// Forward declarations
23 namespace ioda {
24  class ObsSpace;
25  class ObsVector;
26 }
27 
28 namespace ufo {
29  class GeoVaLs;
30  class Locations;
31  class ObsDiagnostics;
32 
33 /// \brief A collection of observation operators used to simulate different variables.
34 ///
35 /// Use this operator to split the list of simulated variables in the ObsSpace into groups,
36 /// each of which should be simulated with a different operator. For example, if the list of
37 /// simulated variables contains some upper-air variables that need to be vertically interpolated
38 /// and some surface variables that don't, you can arrange the `obs operator` section in the input
39 /// YAML file as in the following example:
40 ///
41 /// obs operator:
42 /// name: Composite
43 /// components:
44 /// - name: VertInterp
45 /// variables:
46 /// - name: relative_humidity
47 /// name: northward_wind
48 /// name: eastward_wind
49 /// - name: Identity
50 /// variables:
51 /// - name: surface_pressure
52 ///
53 /// \note Only some operators (currently VertInterp and Identity) currently support the `variables`
54 /// option and thus can be used to simulate only a subset of variables.
56  private util::ObjectCounter<ObsComposite> {
57  public:
58  /// The type of parameters accepted by the constructor of this operator.
59  /// This typedef is used by the ObsOperatorFactory.
61 
62  static const std::string classname() {return "ufo::ObsComposite";}
63 
64  ObsComposite(const ioda::ObsSpace &, const Parameters_ &);
65  ~ObsComposite() override;
66 
67  void simulateObs(const GeoVaLs &, ioda::ObsVector &, ObsDiagnostics &) const override;
68 
69  const oops::Variables & requiredVars() const override { return requiredVars_; }
70 
71  oops::Variables simulatedVars() const override;
72 
73  private:
74  void print(std::ostream &) const override;
75 
76  private:
77  const ioda::ObsSpace& odb_;
78  std::vector<std::unique_ptr<ObsOperatorBase>> components_;
79  oops::Variables requiredVars_;
80 };
81 
82 // -----------------------------------------------------------------------------
83 
84 } // namespace ufo
85 #endif // UFO_COMPOSITEOPER_OBSCOMPOSITE_H_
GeoVaLs: geophysical values at locations.
A collection of observation operators used to simulate different variables.
Definition: ObsComposite.h:56
const oops::Variables & requiredVars() const override
Operator input required from Model.
Definition: ObsComposite.h:69
void simulateObs(const GeoVaLs &, ioda::ObsVector &, ObsDiagnostics &) const override
Obs Operator.
Definition: ObsComposite.cc:56
ObsCompositeParameters Parameters_
Definition: ObsComposite.h:60
~ObsComposite() override
Definition: ObsComposite.cc:50
oops::Variables requiredVars_
Definition: ObsComposite.h:79
std::vector< std::unique_ptr< ObsOperatorBase > > components_
Definition: ObsComposite.h:78
const ioda::ObsSpace & odb_
Definition: ObsComposite.h:77
static const std::string classname()
Definition: ObsComposite.h:62
ObsComposite(const ioda::ObsSpace &, const Parameters_ &)
Definition: ObsComposite.cc:31
oops::Variables simulatedVars() const override
List of variables simulated by this operator.
Definition: ObsComposite.cc:68
void print(std::ostream &) const override
Definition: ObsComposite.cc:87
Configuration options recognized by the Composite operator.
Forward declarations.
Definition: ObsAodExt.h:25
Definition: RunCRTM.h:27