UFO
ObsDomainCheck.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_OBSDOMAINCHECK_H_
9 #define UFO_FILTERS_OBSDOMAINCHECK_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(ObsDomainCheckParameters, FilterParametersBase)
33 
34  // This filter doesn't take any extra parameters.
35 };
36 
37 /// Domain check: generic check that obs are within domain
38 
39 // Domain is defined by metadata criteria regardless of obs value.
40 // If obs value is required, use ObsBoundsCheck.
41 
42 // The same effect can be achieved with opposite criteria through BlackList,
43 // the choice is a matter of convenience or which seems more natural.
44 
45 class ObsDomainCheck : public FilterBase,
46  private util::ObjectCounter<ObsDomainCheck> {
47  public:
48  /// The type of parameters accepted by the constructor of this filter.
49  /// This typedef is used by the FilterFactory.
51 
52  static const std::string classname() {return "ufo::ObsDomainCheck";}
53 
54  ObsDomainCheck(ioda::ObsSpace &, const Parameters_ &,
55  std::shared_ptr<ioda::ObsDataVector<int> >,
56  std::shared_ptr<ioda::ObsDataVector<float> >);
58 
59  private:
60  void print(std::ostream &) const override;
61  void applyFilter(const std::vector<bool> &, const Variables &,
62  std::vector<std::vector<bool>> &) const override;
63  int qcFlag() const override {return QCflags::domain;}
64 
66 };
67 
68 } // namespace ufo
69 
70 #endif // UFO_FILTERS_OBSDOMAINCHECK_H_
Base class for UFO QC filters.
Definition: FilterBase.h:45
Parameters shared by all filters having a default action (typically "reject").
Domain check: generic check that obs are within domain.
static const std::string classname()
void print(std::ostream &) const override
int qcFlag() const override
ObsDomainCheck(ioda::ObsSpace &, const Parameters_ &, std::shared_ptr< ioda::ObsDataVector< int > >, std::shared_ptr< ioda::ObsDataVector< float > >)
Parameters_ parameters_
ObsDomainCheckParameters Parameters_
void applyFilter(const std::vector< bool > &, const Variables &, std::vector< std::vector< bool >> &) const override
Forward declarations.
Definition: ObsAodExt.h:21
Forward declarations.
Definition: ObsAodExt.h:25
constexpr int domain
Definition: QCflags.h:23
Definition: RunCRTM.h:27