UFO
ObsProcessorBase.h
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2017-2021 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 UFO_FILTERS_OBSPROCESSORBASE_H_
9 #define UFO_FILTERS_OBSPROCESSORBASE_H_
10 
11 #include <memory>
12 
13 #include "ioda/ObsDataVector.h"
14 #include "oops/base/Variables.h"
15 #include "oops/interface/ObsFilterBase.h"
17 #include "ufo/filters/Variables.h"
18 #include "ufo/ObsTraits.h"
19 
20 namespace eckit {
21  class Configuration;
22 }
23 
24 namespace ioda {
25  template <typename DATATYPE> class ObsDataVector;
26  class ObsSpace;
27  class ObsVector;
28 }
29 
30 namespace ufo {
31  class GeoVaLs;
32  class ObsDiagnostics;
33 
34 /// \brief Base class for UFO observation processors (including QC filters).
35 ///
36 /// Observation processors only need to implement the constructor and the doFilter method;
37 /// the base class takes care of applying the processor at the pre, prior or post stage.
38 
39 class ObsProcessorBase : public oops::interface::ObsFilterBase<ObsTraits> {
40  public:
41  ObsProcessorBase(ioda::ObsSpace &, bool deferToPost,
42  std::shared_ptr<ioda::ObsDataVector<int> >,
43  std::shared_ptr<ioda::ObsDataVector<float> >);
45 
46  void preProcess() override;
47  void priorFilter(const GeoVaLs &) override;
48  void postFilter(const ioda::ObsVector &, const ioda::ObsVector &,
49  const ObsDiagnostics &) override;
50 
51  oops::Variables requiredVars() const override {
52  return allvars_.allFromGroup("GeoVaLs").toOopsVariables();}
53  oops::Variables requiredHdiagnostics() const override {
54  return allvars_.allFromGroup("ObsDiag").toOopsVariables();}
55 
56  protected:
57  ioda::ObsSpace & obsdb_;
58  std::shared_ptr<ioda::ObsDataVector<int>> flags_;
59  std::shared_ptr<ioda::ObsDataVector<float>> obserr_;
62 
63  private:
64  virtual void doFilter() const = 0;
65 
66  bool prior_;
67  bool post_;
68 
69  // Variables extracted from the filter parameters.
71 };
72 
73 } // namespace ufo
74 
75 #endif // UFO_FILTERS_OBSPROCESSORBASE_H_
GeoVaLs: geophysical values at locations.
ObsFilterData provides access to all data related to an ObsFilter.
Base class for UFO observation processors (including QC filters).
void priorFilter(const GeoVaLs &) override
virtual void doFilter() const =0
oops::Variables requiredHdiagnostics() const override
void postFilter(const ioda::ObsVector &, const ioda::ObsVector &, const ObsDiagnostics &) override
ufo::Variables allvars_
void preProcess() override
ObsProcessorBase(ioda::ObsSpace &, bool deferToPost, std::shared_ptr< ioda::ObsDataVector< int > >, std::shared_ptr< ioda::ObsDataVector< float > >)
std::shared_ptr< ioda::ObsDataVector< float > > obserr_
ioda::ObsSpace & obsdb_
std::shared_ptr< ioda::ObsDataVector< int > > flags_
oops::Variables requiredVars() const override
oops::Variables toOopsVariables() const
Definition: Variables.cc:156
Variables allFromGroup(const std::string &) const
Definition: Variables.cc:128
Forward declarations.
Definition: ObsAodExt.h:21
Forward declarations.
Definition: ObsAodExt.h:25
Definition: RunCRTM.h:27