UFO
ProfileBackgroundCheck.h
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2017-2018 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_PROFILEBACKGROUNDCHECK_H_
9 #define UFO_FILTERS_PROFILEBACKGROUNDCHECK_H_
10 
11 #include <memory>
12 #include <ostream>
13 #include <string>
14 #include <vector>
15 
16 #include "oops/util/ObjectCounter.h"
17 #include "oops/util/parameters/OptionalParameter.h"
18 #include "oops/util/Printable.h"
19 #include "ufo/filters/FilterBase.h"
20 #include "ufo/filters/QCflags.h"
21 #include "ufo/filters/Variable.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 ProfileBackgroundCheck filter.
38 
39  public:
40  /// The filter will flag observations whose bias-corrected value differs from its model equivalent
41  /// by more than `relative threshold` times the current estimate of the observation error.
42  ///
43  /// `relative threshold` can be a real number or the name of a variable.
44  oops::OptionalParameter<std::string> relativeThreshold{"relative threshold", this};
45 
46  /// The filter will flag observations whose bias-corrected value differs from its model equivalent
47  /// by more than `absolute threshold`
48  ///
49  /// `absolute threshold` can be a real number or the name of a variable.
50  oops::OptionalParameter<std::string> absoluteThreshold{"absolute threshold", this};
51 };
52 
53 /// ProfileBackgroundCheck: check observation closeness to background over a profile
54 ///
55 /// See the cc file for more details.
56 
58  private util::ObjectCounter<ProfileBackgroundCheck> {
59  public:
60  /// The type of parameters accepted by the constructor of this filter.
61  /// This typedef is used by the FilterFactory.
63 
64  static const std::string classname() {return "ufo::ProfileBackgroundCheck";}
65 
66  ProfileBackgroundCheck(ioda::ObsSpace &, const Parameters_ &,
67  std::shared_ptr<ioda::ObsDataVector<int> >,
68  std::shared_ptr<ioda::ObsDataVector<float> >);
70 
71  private:
72  void print(std::ostream &) const override;
73  void applyFilter(const std::vector<bool> &, const Variables &,
74  std::vector<std::vector<bool>> &) const override;
75  int qcFlag() const override {return QCflags::fguess;}
77 };
78 
79 } // namespace ufo
80 
81 #endif // UFO_FILTERS_PROFILEBACKGROUNDCHECK_H_
Base class for UFO QC filters.
Definition: FilterBase.h:45
Parameters shared by all filters having a default action (typically "reject").
ProfileBackgroundCheckParameters Parameters_
ProfileBackgroundCheck(ioda::ObsSpace &, const Parameters_ &, std::shared_ptr< ioda::ObsDataVector< int > >, std::shared_ptr< ioda::ObsDataVector< float > >)
void print(std::ostream &) const override
void applyFilter(const std::vector< bool > &, const Variables &, std::vector< std::vector< bool >> &) const override
Apply the profile background check filter.
static const std::string classname()
Parameters controlling the operation of the ProfileBackgroundCheck filter.
oops::OptionalParameter< std::string > relativeThreshold
oops::OptionalParameter< std::string > absoluteThreshold
Forward declarations.
Definition: ObsAodExt.h:21
Forward declarations.
Definition: ObsAodExt.h:25
constexpr int fguess
Definition: QCflags.h:29
Definition: RunCRTM.h:27