UFO
PreQC.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_PREQC_H_
9 #define UFO_FILTERS_PREQC_H_
10 
11 #include <memory>
12 #include <ostream>
13 #include <string>
14 #include <vector>
15 
16 #include "oops/util/ObjectCounter.h"
17 #include "ufo/filters/FilterBase.h"
18 #include "ufo/filters/QCflags.h"
19 
20 namespace ioda {
21  template <typename DATATYPE> class ObsDataVector;
22  class ObsSpace;
23 }
24 
25 namespace ufo {
26 
28  OOPS_CONCRETE_PARAMETERS(PreQCParameters, FilterParametersBase)
29 
30  public:
31  /// The ObsSpace group holding PreQC flags. By default, 'PreQC'.
32  oops::Parameter<std::string> inputQC{"inputQC", "PreQC", this};
33  /// Minimum PreQC flag denoting "pass". By default, zero.
34  oops::Parameter<int> minvalue{"minvalue", 0, this};
35  /// Maximum PreQC flag denoting "pass". By default, zero.
36  oops::Parameter<int> maxvalue{"maxvalue", 0, this};
37 };
38 
39 class PreQC : public FilterBase, private util::ObjectCounter<PreQC> {
40  public:
41  /// The type of parameters accepted by the constructor of this filter.
42  /// This typedef is used by the FilterFactory.
44 
45  static const std::string classname() {return "ufo::PreQC";}
46 
47  PreQC(ioda::ObsSpace &, const Parameters_ &,
48  std::shared_ptr<ioda::ObsDataVector<int> >,
49  std::shared_ptr<ioda::ObsDataVector<float> >);
50 
51  private:
52  void print(std::ostream &) const override;
53  void applyFilter(const std::vector<bool> &, const Variables &,
54  std::vector<std::vector<bool>> &) const override;
55  int qcFlag() const override {return QCflags::preQC;}
56 
58 };
59 
60 } // namespace ufo
61 
62 #endif // UFO_FILTERS_PREQC_H_
Base class for UFO QC filters.
Definition: FilterBase.h:45
Parameters shared by all filters having a default action (typically "reject").
PreQCParameters Parameters_
Definition: PreQC.h:43
PreQC(ioda::ObsSpace &, const Parameters_ &, std::shared_ptr< ioda::ObsDataVector< int > >, std::shared_ptr< ioda::ObsDataVector< float > >)
Definition: PreQC.cc:19
void applyFilter(const std::vector< bool > &, const Variables &, std::vector< std::vector< bool >> &) const override
Definition: PreQC.cc:29
void print(std::ostream &) const override
Definition: PreQC.cc:64
Parameters_ parameters_
Definition: PreQC.h:57
static const std::string classname()
Definition: PreQC.h:45
int qcFlag() const override
Definition: PreQC.h:55
oops::Parameter< int > minvalue
Minimum PreQC flag denoting "pass". By default, zero.
Definition: PreQC.h:34
oops::Parameter< int > maxvalue
Maximum PreQC flag denoting "pass". By default, zero.
Definition: PreQC.h:36
oops::Parameter< std::string > inputQC
The ObsSpace group holding PreQC flags. By default, 'PreQC'.
Definition: PreQC.h:32
Forward declarations.
Definition: ObsAodExt.h:25
constexpr int preQC
Definition: QCflags.h:21
Definition: RunCRTM.h:27