UFO
MWCLWCheck.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_MWCLWCHECK_H_
9 #define UFO_FILTERS_MWCLWCHECK_H_
10 
11 #include <memory>
12 #include <ostream>
13 #include <string>
14 #include <vector>
15 
16 #include "oops/base/ParameterTraitsVariables.h"
17 #include "oops/base/Variables.h"
18 #include "oops/util/ObjectCounter.h"
19 #include "oops/util/parameters/NumericConstraints.h"
20 #include "oops/util/parameters/RequiredParameter.h"
21 #include "ufo/filters/FilterBase.h"
22 #include "ufo/filters/QCflags.h"
23 
24 namespace eckit {
25  class Configuration;
26 }
27 
28 namespace ioda {
29  template <typename DATATYPE> class ObsDataVector;
30  class ObsSpace;
31 }
32 
33 namespace ufo {
34 
35 /// Parameters controlling the operation of the MWCLWCheck filter.
37  OOPS_CONCRETE_PARAMETERS(MWCLWCheckParameters, FilterParametersBase)
38 
39  public:
40  oops::RequiredParameter<oops::Variables> clwVariables{"clw variables", this};
41 
42  oops::RequiredParameter<std::vector<float>> clwThresholds{"clw_thresholds", this};
43 
44  /// Controls how the clw is calculated:
45  ///
46  /// 1. Use observed BTs.
47  /// 2. Use calculated BTs.
48  /// 3. Symmetric calculation.
49  oops::RequiredParameter<int> clwOption{"clw_option", this, {oops::minConstraint<int>(1),
50  oops::maxConstraint<int>(3)}};
51 };
52 
53 class MWCLWCheck : public FilterBase,
54  private util::ObjectCounter<MWCLWCheck> {
55  public:
56  /// The type of parameters accepted by the constructor of this filter.
57  /// This typedef is used by the FilterFactory.
59 
60  static const std::string classname() {return "ufo::MWCLWCheck";}
61 
62  MWCLWCheck(ioda::ObsSpace &, const Parameters_ &,
63  std::shared_ptr<ioda::ObsDataVector<int> >,
64  std::shared_ptr<ioda::ObsDataVector<float> >);
65  ~MWCLWCheck();
66 
67  private:
68  void print(std::ostream &) const override;
69  void applyFilter(const std::vector<bool> &, const Variables &,
70  std::vector<std::vector<bool>> &) const override;
71  int qcFlag() const override {return QCflags::clw;}
72 
74 };
75 
76 } // namespace ufo
77 
78 #endif // UFO_FILTERS_MWCLWCHECK_H_
Base class for UFO QC filters.
Definition: FilterBase.h:45
Parameters shared by all filters having a default action (typically "reject").
MWCLWCheck(ioda::ObsSpace &, const Parameters_ &, std::shared_ptr< ioda::ObsDataVector< int > >, std::shared_ptr< ioda::ObsDataVector< float > >)
Definition: MWCLWCheck.cc:28
int qcFlag() const override
Definition: MWCLWCheck.h:71
void print(std::ostream &) const override
Definition: MWCLWCheck.cc:155
Parameters_ parameters_
Definition: MWCLWCheck.h:73
static const std::string classname()
Definition: MWCLWCheck.h:60
MWCLWCheckParameters Parameters_
Definition: MWCLWCheck.h:58
void applyFilter(const std::vector< bool > &, const Variables &, std::vector< std::vector< bool >> &) const override
Definition: MWCLWCheck.cc:48
Parameters controlling the operation of the MWCLWCheck filter.
Definition: MWCLWCheck.h:36
oops::RequiredParameter< std::vector< float > > clwThresholds
Definition: MWCLWCheck.h:42
oops::RequiredParameter< oops::Variables > clwVariables
Definition: MWCLWCheck.h:40
oops::RequiredParameter< int > clwOption
Definition: MWCLWCheck.h:49
Forward declarations.
Definition: ObsAodExt.h:21
Forward declarations.
Definition: ObsAodExt.h:25
constexpr int clw
Definition: QCflags.h:28
Definition: RunCRTM.h:27