UFO
SatWindsSPDBCheck.h
Go to the documentation of this file.
1 /*
2  * (C) Copyright 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 UFO_FILTERS_OBSFUNCTIONS_SATWINDSSPDBCHECK_H_
9 #define UFO_FILTERS_OBSFUNCTIONS_SATWINDSSPDBCHECK_H_
10 
11 #include <string>
12 
13 #include "oops/util/parameters/Parameter.h"
14 #include "oops/util/parameters/RequiredParameter.h"
15 
18 #include "ufo/filters/Variables.h"
19 
20 namespace ufo {
21 
22 ///
23 /// \brief Two options are required for this function: error_min and error_max,
24 /// which are bounding the ObsError variable following a GSI fix file.
25 /// The specification of group name for ObsError is optional but assigned
26 /// ObsErrorData by default. The HofX group name is also optional to override
27 /// using test_hofx for testing purposes (set to GsiHofX, for example).
28 ///
29 class SatWindsSPDBCheckParameters : public oops::Parameters {
30  OOPS_CONCRETE_PARAMETERS(SatWindsSPDBCheckParameters, Parameters)
31 
32  public:
33  /// the existence of min,max error values are required
34  oops::RequiredParameter<float> error_min{"error_min", this};
35  oops::RequiredParameter<float> error_max{"error_max", this};
36  /// Name of the HofX group used to replace the default (HofX) group
37  oops::Parameter<std::string> test_hofx{"test_hofx", "HofX", this};
38  /// Name of the ObsError group used to replace the default (ObsErrorData) group
39  oops::Parameter<std::string> original_obserr{"original_obserr", "ObsErrorData", this};
40 };
41 
42 // -----------------------------------------------------------------------------
43 
44 /// \brief Compute the speed background difference (SPDB) of observation-model
45 /// SatWinds. If the SPDB is less than zero, then compute a final value
46 /// of residual over ObsError. That calculation is then used versus a
47 /// threshold value in Bounds Check filter to flag obs locations as bad.
48 /// In regular usage, the test_hofx option would be omitted in order than HofX
49 /// values are used for model wind components. Also, an optional group
50 /// name for the ObsError variable can be supplied if different from ObsErrorData,
51 /// and its value is bounded by parameters error_min and error_max.
52 ///
53 /// ~~~
54 ///
55 /// ### Sample YAML configuration
56 /// - filter: Bounds Check
57 /// filter variables:
58 /// - name: eastward_wind
59 /// - name: northward_wind
60 /// test variables:
61 /// - name: SatWindsSPDBCheck@ObsFunction
62 /// options:
63 /// error_min: 1.4
64 /// error_max: 20.0
65 /// maxvalue: 1.75 # gross error * 0.7
66 ///
67 class SatWindsSPDBCheck : public ObsFunctionBase<float> {
68  public:
69  static const std::string classname() {return "SatWindsSPDBCheck";}
70 
71  explicit SatWindsSPDBCheck(const eckit::LocalConfiguration &
72  = eckit::LocalConfiguration());
73  ~SatWindsSPDBCheck();
74 
75  void compute(const ObsFilterData &, ioda::ObsDataVector<float> &) const;
76  const ufo::Variables & requiredVariables() const;
77  private:
78  ufo::Variables invars_;
79  SatWindsSPDBCheckParameters options_;
80 };
81 
82 // -----------------------------------------------------------------------------
83 
84 } // namespace ufo
85 
86 #endif // UFO_FILTERS_OBSFUNCTIONS_SATWINDSSPDBCHECK_H_
Two options are required for this function: error_min and error_max, which are bounding the ObsError ...
oops::RequiredParameter< float > error_min
the existence of min,max error values are required
oops::Parameter< std::string > test_hofx
Name of the HofX group used to replace the default (HofX) group.
oops::Parameter< std::string > original_obserr
Name of the ObsError group used to replace the default (ObsErrorData) group.
oops::RequiredParameter< float > error_max
Definition: RunCRTM.h:27