UFO
QCmanager.h
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2018-2019 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_QCMANAGER_H_
9 #define UFO_FILTERS_QCMANAGER_H_
10 
11 #include <memory>
12 #include <ostream>
13 
14 #include "eckit/config/LocalConfiguration.h"
15 #include "ioda/ObsDataVector.h"
16 #include "ioda/ObsSpace.h"
17 #include "oops/base/Variables.h"
18 #include "oops/interface/ObsFilterBase.h"
19 #include "oops/util/Printable.h"
20 #include "ufo/ObsTraits.h"
21 
22 namespace ioda {
23  template <typename DATATYPE> class ObsDataVector;
24  class ObsVector;
25 }
26 
27 namespace ufo {
28 class GeoVaLs;
29 class ObsDiagnostics;
30 
31 /// \brief Always the first filter to be run.
32 ///
33 /// The constructor sets the QC flag to `missing` at all locations with missing obs values of QC
34 /// flags. The postFilter() function sets the QC flag to `Hfailed` if it was previously set to
35 /// `pass`, but the obs operator failed to produce a valid value.
36 class QCmanager : public oops::interface::ObsFilterBase<ObsTraits> {
37  public:
38  QCmanager(ioda::ObsSpace &, const eckit::Configuration &,
39  std::shared_ptr<ioda::ObsDataVector<int> >,
40  std::shared_ptr<ioda::ObsDataVector<float> >);
41  ~QCmanager();
42 
43  void preProcess() override {}
44  void priorFilter(const GeoVaLs &) override {}
45  void postFilter(const ioda::ObsVector &, const ioda::ObsVector &,
46  const ObsDiagnostics &) override;
47 
48  oops::Variables requiredVars() const override {return nogeovals_;}
49  oops::Variables requiredHdiagnostics() const override {return nodiags_;}
50 
51  private:
52  void print(std::ostream &) const override;
53 
54  ioda::ObsSpace & obsdb_;
55  const oops::Variables nogeovals_;
56  const oops::Variables nodiags_;
57  std::shared_ptr<ioda::ObsDataVector<int>> flags_;
58 };
59 
60 } // namespace ufo
61 
62 #endif // UFO_FILTERS_QCMANAGER_H_
GeoVaLs: geophysical values at locations.
Always the first filter to be run.
Definition: QCmanager.h:36
void preProcess() override
Definition: QCmanager.h:43
const oops::Variables nodiags_
Definition: QCmanager.h:56
oops::Variables requiredVars() const override
Definition: QCmanager.h:48
std::shared_ptr< ioda::ObsDataVector< int > > flags_
Definition: QCmanager.h:57
void postFilter(const ioda::ObsVector &, const ioda::ObsVector &, const ObsDiagnostics &) override
Definition: QCmanager.cc:97
const oops::Variables nogeovals_
Definition: QCmanager.h:55
QCmanager(ioda::ObsSpace &, const eckit::Configuration &, std::shared_ptr< ioda::ObsDataVector< int > >, std::shared_ptr< ioda::ObsDataVector< float > >)
Definition: QCmanager.cc:50
void priorFilter(const GeoVaLs &) override
Definition: QCmanager.h:44
void print(std::ostream &) const override
Definition: QCmanager.cc:126
oops::Variables requiredHdiagnostics() const override
Definition: QCmanager.h:49
ioda::ObsSpace & obsdb_
Definition: QCmanager.h:54
Forward declarations.
Definition: ObsAodExt.h:25
Definition: RunCRTM.h:27