UFO
BlackList.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_BLACKLIST_H_
9 #define UFO_FILTERS_BLACKLIST_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 eckit {
21  class Configuration;
22 }
23 
24 namespace ioda {
25  template <typename DATATYPE> class ObsDataVector;
26  class ObsSpace;
27 }
28 
29 namespace ufo {
30 
32  OOPS_CONCRETE_PARAMETERS(BlackListParameters, FilterParametersBase)
33 
34  // This filter doesn't take any extra parameters.
35 };
36 
37 /// \brief Generic black listing of observations.
38 ///
39 /// Filters observations out regardless of obs value
40 /// The same effect can be achieved with opposite criteria through the "Domain Check",
41 /// the choice is a matter of convenience or which seems more natural.
42 
43 class BlackList : public FilterBase,
44  private util::ObjectCounter<BlackList> {
45  public:
46  /// The type of parameters accepted by the constructor of this filter.
47  /// This typedef is used by the FilterFactory.
49 
50  static const std::string classname() {return "ufo::BlackList";}
51 
52  BlackList(ioda::ObsSpace &, const Parameters_ &,
53  std::shared_ptr<ioda::ObsDataVector<int> >,
54  std::shared_ptr<ioda::ObsDataVector<float> >);
55  ~BlackList();
56 
57  private:
58  void print(std::ostream &) const override;
59  void applyFilter(const std::vector<bool> &, const Variables &,
60  std::vector<std::vector<bool>> &) const override;
61  int qcFlag() const override {return QCflags::black;}
62 
64 };
65 
66 } // namespace ufo
67 
68 #endif // UFO_FILTERS_BLACKLIST_H_
Generic black listing of observations.
Definition: BlackList.h:44
Parameters_ parameters_
Definition: BlackList.h:63
void print(std::ostream &) const override
Definition: BlackList.cc:51
BlackListParameters Parameters_
Definition: BlackList.h:48
int qcFlag() const override
Definition: BlackList.h:61
static const std::string classname()
Definition: BlackList.h:50
BlackList(ioda::ObsSpace &, const Parameters_ &, std::shared_ptr< ioda::ObsDataVector< int > >, std::shared_ptr< ioda::ObsDataVector< float > >)
Definition: BlackList.cc:25
void applyFilter(const std::vector< bool > &, const Variables &, std::vector< std::vector< bool >> &) const override
Definition: BlackList.cc:39
Base class for UFO QC filters.
Definition: FilterBase.h:45
Parameters shared by all filters having a default action (typically "reject").
Forward declarations.
Definition: ObsAodExt.h:21
Forward declarations.
Definition: ObsAodExt.h:25
constexpr int black
Definition: QCflags.h:24
Definition: RunCRTM.h:27