OOPS
BackgroundCheck.h
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2020-2020 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 LORENZ95_BACKGROUNDCHECK_H_
9 #define LORENZ95_BACKGROUNDCHECK_H_
10 
11 #include <memory>
12 #include <ostream>
13 
14 #include "eckit/config/LocalConfiguration.h"
15 
16 #include "oops/base/Variables.h"
17 #include "oops/util/parameters/OptionalParameter.h"
18 #include "oops/util/parameters/Parameters.h"
19 #include "oops/util/parameters/RequiredParameter.h"
20 #include "oops/util/Printable.h"
21 
22 namespace lorenz95 {
23  class GomL95;
24  template <typename DATATYPE> class ObsData1D;
25  class ObsTableView;
26  class ObsDiags1D;
27  class ObsVec1D;
28 
29 /// Parameters for L95 BackgroundCheck
30 /// background check: all obs for which {|y-H(x)| < threshold} pass QC
31 class BackgroundCheckParameters : public oops::Parameters {
32  OOPS_CONCRETE_PARAMETERS(BackgroundCheckParameters, Parameters)
33 
34  public:
35  /// threshold for background check
36  oops::RequiredParameter<double> threshold{"threshold", this};
37 
38  /// optional inflation factor: if this parameter is present, obs error stddev
39  /// for obs that don't pass the check is multiplied by the specified factor.
40  /// Otherwise, obs that don't pass the check are rejected.
41  oops::OptionalParameter<double> inflation{"inflate obs error", this};
42 };
43 
44 /// Simple background check: all obs for which {|y-H(x)| < threshold} pass QC
45 class BackgroundCheck : public util::Printable {
46  public:
47  BackgroundCheck(const ObsTableView &, const eckit::Configuration &,
48  std::shared_ptr<ObsData1D<int> >, std::shared_ptr<ObsData1D<float> >);
49 
50  void preProcess() const {}
51  void priorFilter(const GomL95 &) const {}
52  void postFilter(const ObsVec1D &, const ObsDiags1D &) const;
53 
56 
57  private:
58  void print(std::ostream & os) const;
59 
62  std::shared_ptr<ObsData1D<int> > qcflags_; // QC flags
63  std::shared_ptr<ObsData1D<float> > obserr_; // obs error stddev
65 };
66 
67 } // namespace lorenz95
68 
69 #endif // LORENZ95_BACKGROUNDCHECK_H_
lorenz95::BackgroundCheck::priorFilter
void priorFilter(const GomL95 &) const
Definition: BackgroundCheck.h:51
lorenz95::BackgroundCheck::novars_
const oops::Variables novars_
Definition: BackgroundCheck.h:64
lorenz95::BackgroundCheckParameters
Definition: BackgroundCheck.h:31
lorenz95::BackgroundCheck::requiredVars
oops::Variables requiredVars() const
Definition: BackgroundCheck.h:54
lorenz95::BackgroundCheckParameters::threshold
oops::RequiredParameter< double > threshold
threshold for background check
Definition: BackgroundCheck.h:36
lorenz95::ObsVec1D
Vector in observation space.
Definition: ObsVec1D.h:34
lorenz95::BackgroundCheck::requiredHdiagnostics
oops::Variables requiredHdiagnostics() const
Definition: BackgroundCheck.h:55
lorenz95::BackgroundCheck::postFilter
void postFilter(const ObsVec1D &, const ObsDiags1D &) const
Definition: BackgroundCheck.cc:30
lorenz95::BackgroundCheck::BackgroundCheck
BackgroundCheck(const ObsTableView &, const eckit::Configuration &, std::shared_ptr< ObsData1D< int > >, std::shared_ptr< ObsData1D< float > >)
Definition: BackgroundCheck.cc:22
lorenz95::BackgroundCheck::qcflags_
std::shared_ptr< ObsData1D< int > > qcflags_
Definition: BackgroundCheck.h:62
lorenz95::BackgroundCheck::preProcess
void preProcess() const
Definition: BackgroundCheck.h:50
lorenz95::BackgroundCheck::obsdb_
const ObsTableView & obsdb_
Definition: BackgroundCheck.h:60
lorenz95::ObsDiags1D
Definition: ObsDiags1D.h:24
lorenz95::GomL95
GomL95 class to handle locations for L95 model.
Definition: GomL95.h:33
lorenz95::BackgroundCheck
Simple background check: all obs for which {|y-H(x)| < threshold} pass QC.
Definition: BackgroundCheck.h:45
lorenz95::ObsData1D
Data in observation space.
Definition: BackgroundCheck.h:24
lorenz95::ObsTableView
A Simple Observation Data Handler.
Definition: ObsTableView.h:38
lorenz95::BackgroundCheckParameters::inflation
oops::OptionalParameter< double > inflation
Definition: BackgroundCheck.h:41
oops::Variables
Definition: oops/base/Variables.h:23
lorenz95::BackgroundCheck::print
void print(std::ostream &os) const
Definition: BackgroundCheck.cc:47
lorenz95
The namespace for the L95 model.
Definition: l95/src/lorenz95/AnalyticInit.cc:17
Variables.h
lorenz95::BackgroundCheck::obserr_
std::shared_ptr< ObsData1D< float > > obserr_
Definition: BackgroundCheck.h:63
lorenz95::BackgroundCheck::options_
BackgroundCheckParameters options_
Definition: BackgroundCheck.h:61