UFO
InflateError.h
Go to the documentation of this file.
1 /*
2  * (C) Copyright 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_ACTIONS_INFLATEERROR_H_
9 #define UFO_FILTERS_ACTIONS_INFLATEERROR_H_
10 
11 #include <string>
12 #include <vector>
13 
14 #include "ioda/ObsDataVector.h"
15 #include "oops/util/parameters/OptionalParameter.h"
17 #include "ufo/filters/Variable.h"
18 #include "ufo/filters/Variables.h"
20 
21 namespace ufo {
22 
23 class ObsFilterData;
24 
25 // -----------------------------------------------------------------------------
26 
29 
30  public:
31  oops::OptionalParameter<float> inflationFactor{"inflation factor", this};
32  oops::OptionalParameter<Variable> inflationVariable{"inflation variable", this};
33 
34  /// This function is overridden to check that either `inflation factor` or `inflation variable`
35  /// is specified, but not both.
36  void deserialize(util::CompositePath &path, const eckit::Configuration &config) override;
37 };
38 
39 // -----------------------------------------------------------------------------
40 /// \brief Observation error inflation action.
41 /// \details Inflates Observation error for filter variables by:
42 /// - constant (if "inflation factor" is specified in yaml)
43 /// - spatially varying filter data (if "inflation variable" is specified in yaml).
44 /// If inflation variable is the same size as filter variables, inflation is done
45 /// variable by variable (e.g. inflation variable 1 is used to inflate filter
46 /// variable 1; inflation variable 2 is used to inflate filter variable 2, etc).
47 /// If inflation variable is of size 1, the same inflation variable is used for
48 /// updating all filter variables.
50  public:
51  /// The type of parameters accepted by the constructor of this action.
52  /// This typedef is used by the FilterActionFactory.
54 
55  explicit InflateError(const Parameters_ &);
56 
57  void apply(const Variables &, const std::vector<std::vector<bool>> &,
58  const ObsFilterData &, int,
60 
61  const ufo::Variables & requiredVariables() const override {return allvars_;}
62 
63  private:
64  Variables allvars_; /// variables required to compute inflation
66 };
67 
68 // -----------------------------------------------------------------------------
69 
70 } // namespace ufo
71 
72 #endif // UFO_FILTERS_ACTIONS_INFLATEERROR_H_
Parameters controlling a filter action.
Observation error inflation action.
Definition: InflateError.h:49
Variables allvars_
Definition: InflateError.h:64
const ufo::Variables & requiredVariables() const override
Definition: InflateError.h:61
InflateError(const Parameters_ &)
Definition: InflateError.cc:41
void apply(const Variables &, const std::vector< std::vector< bool >> &, const ObsFilterData &, int, ioda::ObsDataVector< int > &, ioda::ObsDataVector< float > &) const override
Definition: InflateError.cc:58
InflateErrorParameters Parameters_
Definition: InflateError.h:53
Parameters_ parameters_
variables required to compute inflation
Definition: InflateError.h:65
oops::OptionalParameter< Variable > inflationVariable
Definition: InflateError.h:32
void deserialize(util::CompositePath &path, const eckit::Configuration &config) override
Definition: InflateError.cc:26
oops::OptionalParameter< float > inflationFactor
Definition: InflateError.h:31
OOPS_CONCRETE_PARAMETERS(InflateErrorParameters, FilterActionParametersBase)
ObsFilterData provides access to all data related to an ObsFilter.
Definition: RunCRTM.h:27