UFO
Thinning.h
Go to the documentation of this file.
1 /*
2  * (C) Copyright 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_THINNING_H_
9 #define UFO_FILTERS_THINNING_H_
10 
11 #include <memory>
12 #include <ostream>
13 #include <string>
14 #include <vector>
15 
16 #include "ioda/ObsDataVector.h"
17 #include "oops/util/ObjectCounter.h"
18 #include "ufo/filters/FilterBase.h"
19 #include "ufo/filters/QCflags.h"
20 
21 namespace eckit {
22  class Configuration;
23 }
24 
25 namespace ioda {
26  template <typename DATATYPE> class ObsDataVector;
27  class ObsSpace;
28 }
29 
30 namespace ufo {
31 
32 /// Thinning: randomly thin a given percentage of observations
33 
34 class Thinning : public FilterBase,
35  private util::ObjectCounter<Thinning> {
36  public:
37  static const std::string classname() {return "ufo::Thinning";}
38 
39  Thinning(ioda::ObsSpace &, const eckit::Configuration &,
40  std::shared_ptr<ioda::ObsDataVector<int> >,
41  std::shared_ptr<ioda::ObsDataVector<float> >);
42  ~Thinning();
43 
44  private:
45  void print(std::ostream &) const override;
46  void applyFilter(const std::vector<bool> &, const Variables &,
47  std::vector<std::vector<bool>> &) const override;
48  int qcFlag() const override {return QCflags::thinned;}
49 };
50 
51 } // namespace ufo
52 
53 #endif // UFO_FILTERS_THINNING_H_
FilterBase.h
ufo::Thinning::qcFlag
int qcFlag() const override
Definition: Thinning.h:48
ufo::Thinning
Thinning: randomly thin a given percentage of observations.
Definition: Thinning.h:35
ufo::Variables
Definition: src/ufo/filters/Variables.h:24
ufo::FilterBase
FilterBase: Base class for UFO QC filters.
Definition: FilterBase.h:42
ufo::Thinning::print
void print(std::ostream &) const override
Definition: Thinning.cc:67
ioda
Definition: ObsAtmSfcInterp.h:24
ufo
Definition: RunCRTM.h:27
eckit
Forward declarations.
Definition: ObsAtmSfcInterp.h:20
QCflags.h
ufo::Thinning::~Thinning
~Thinning()
Definition: Thinning.cc:35
ufo::QCflags::thinned
constexpr int thinned
Definition: QCflags.h:21
ioda::ObsDataVector< int >
ufo::Thinning::applyFilter
void applyFilter(const std::vector< bool > &, const Variables &, std::vector< std::vector< bool >> &) const override
Definition: Thinning.cc:39
ufo::Thinning::Thinning
Thinning(ioda::ObsSpace &, const eckit::Configuration &, std::shared_ptr< ioda::ObsDataVector< int > >, std::shared_ptr< ioda::ObsDataVector< float > >)
Definition: Thinning.cc:25
ufo::Thinning::classname
static const std::string classname()
Definition: Thinning.h:37