UFO
WindDirAngleDiff.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_WINDDIRANGLEDIFF_H_
9 #define UFO_FILTERS_OBSFUNCTIONS_WINDDIRANGLEDIFF_H_
10 
11 #include <string>
12 
13 #include "oops/util/parameters/Parameter.h"
14 
17 #include "ufo/filters/Variables.h"
18 
19 namespace ufo {
20 
21 ///
22 /// \brief An optional parameter to override the source of HofX wind components,
23 /// and an optional parameter for minimum wind components (default=0.5 m/s).
24 ///
25 class WindDirAngleDiffParameters : public oops::Parameters {
26  OOPS_CONCRETE_PARAMETERS(WindDirAngleDiffParameters, Parameters)
27 
28  public:
29  /// Name of the HofX group used to replace the default group (default is HofX)
30  oops::Parameter<std::string> test_hofx{"test_hofx", "HofX", this};
31  oops::Parameter<float> minimum_uv{"minimum_uv", 0.5, this};
32 };
33 
34 // -----------------------------------------------------------------------------
35 
36 /// \brief Compute the wind direction angle difference between observation and model.
37 /// For application in SatWinds QC, a difference larger than 50 degrees is
38 /// typically used to reject data. This threshold can be used as the max_value
39 /// in a Bounds Check filter.
40 ///
41 /// ~~~
42 ///
43 /// ### Sample YAML configuration
44 /// - filter: Bounds Check
45 /// filter variables:
46 /// - name: eastward_wind
47 /// - name: northward_wind
48 /// test variables:
49 /// - name: WindDirAngleDiff@ObsFunction
50 /// options:
51 /// test_hofx: GsiHofX
52 /// maxvalue: 50
53 ///
54 class WindDirAngleDiff : public ObsFunctionBase<float> {
55  public:
56  static const std::string classname() {return "WindDirAngleDiff";}
57 
58  explicit WindDirAngleDiff(const eckit::LocalConfiguration &
59  = eckit::LocalConfiguration());
60  ~WindDirAngleDiff();
61 
62  void compute(const ObsFilterData &, ioda::ObsDataVector<float> &) const;
63  const ufo::Variables & requiredVariables() const;
64  private:
65  ufo::Variables invars_;
66  WindDirAngleDiffParameters options_;
67 };
68 
69 // -----------------------------------------------------------------------------
70 
71 } // namespace ufo
72 
73 #endif // UFO_FILTERS_OBSFUNCTIONS_WINDDIRANGLEDIFF_H_
An optional parameter to override the source of HofX wind components, and an optional parameter for m...
oops::Parameter< std::string > test_hofx
Name of the HofX group used to replace the default group (default is HofX)
oops::Parameter< float > minimum_uv
Definition: RunCRTM.h:27