UFO
BennartzScatIndex.h
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2019 Met Office UK
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_BENNARTZSCATINDEX_H_
9 #define UFO_FILTERS_OBSFUNCTIONS_BENNARTZSCATINDEX_H_
10 
11 #include <string>
12 #include <vector>
13 
14 #include "oops/util/parameters/NumericConstraints.h"
15 #include "oops/util/parameters/Parameter.h"
16 #include "oops/util/parameters/Parameters.h"
17 #include "oops/util/parameters/RequiredParameter.h"
18 
21 #include "ufo/filters/Variable.h"
22 #include "ufo/filters/Variables.h"
24 
25 namespace ufo {
26 
27 ///
28 /// \brief Options for calculating scattering index from 89 GHz and 150 GHz channels.
29 ///
30 class BennartzScatIndexParameters : public oops::Parameters {
31  OOPS_CONCRETE_PARAMETERS(BennartzScatIndexParameters, Parameters)
32 
33  public:
34  /// \brief Channel number corresponding to 89 GHz
35  /// (or nearby frequency depending on sensor channel specification)
36  ///
37  /// Example: MHS channel 1 at 89 GHz
38  ///
39  /// channel_89ghz: 1
40  oops::RequiredParameter<int> ch89{"channel_89ghz", this, {oops::minConstraint(1)}};
41 
42  /// \brief Channel number corresponding to 150 GHz
43  /// (or nearby frequency depending on sensor channel specification)
44  ///
45  /// Example: MHS channel 2 at 157 GHz
46  ///
47  /// channel_150ghz: 2
48  oops::RequiredParameter<int> ch150{"channel_150ghz", this, {oops::minConstraint(1)}};
49 
50  /// \brief First coefficient used to compute scattering index
51  ///
52  /// Offset term is calculated as coeff1 + coeff2*sensor_zenith_angle
53  oops::RequiredParameter<float> coeff1{"bennartz_coeff_1", this};
54 
55  /// \brief Second coefficient used to compute scattering index
56  ///
57  /// Offset term is calculated as coeff1 + coeff2*sensor_zenith_angle
58  oops::RequiredParameter<float> coeff2{"bennartz_coeff_2", this};
59 
60  /// \brief Name of the bias correction group used to apply correction to ObsValue.
61  ///
62  /// Default (missing optional parameter) applies no bias
63  ///
64  /// Example: use ObsBias correction values
65  ///
66  /// apply_bias: ObsBias
67  oops::Parameter<std::string> applyBias{"apply_bias", "", this};
68 };
69 
70 ///
71 /// \brief Calculate scattering index from 89 GHz and 150 GHz channels.
72 ///
73 /// Reference: R. Bennartz (2002)
74 /// Precipitation analysis using the Advanced Microwave Sounding Unit in
75 /// support of nowcasting applications
76 /// Meteorol. Appl. 9, 177-189 (2002) DOI:10.1017/S1350482702002037
77 
78 class BennartzScatIndex : public ObsFunctionBase<float> {
79  public:
80  explicit BennartzScatIndex(const eckit::LocalConfiguration &
81  = eckit::LocalConfiguration());
82  void compute(const ObsFilterData &,
84  const ufo::Variables & requiredVariables() const;
85  private:
88  std::vector<int> channels_ = {0, 0};
89 };
90 
91 // -----------------------------------------------------------------------------
92 
93 } // namespace ufo
94 
95 #endif // UFO_FILTERS_OBSFUNCTIONS_BENNARTZSCATINDEX_H_
Calculate scattering index from 89 GHz and 150 GHz channels.
BennartzScatIndexParameters options_
void compute(const ObsFilterData &, ioda::ObsDataVector< float > &) const
compute the result of the function
std::vector< int > channels_
BennartzScatIndex(const eckit::LocalConfiguration &=eckit::LocalConfiguration())
const ufo::Variables & requiredVariables() const
geovals required to compute the function
Options for calculating scattering index from 89 GHz and 150 GHz channels.
oops::RequiredParameter< int > ch89
Channel number corresponding to 89 GHz (or nearby frequency depending on sensor channel specification...
oops::RequiredParameter< float > coeff1
First coefficient used to compute scattering index.
oops::Parameter< std::string > applyBias
Name of the bias correction group used to apply correction to ObsValue.
oops::RequiredParameter< float > coeff2
Second coefficient used to compute scattering index.
oops::RequiredParameter< int > ch150
Channel number corresponding to 150 GHz (or nearby frequency depending on sensor channel specificatio...
ObsFilterData provides access to all data related to an ObsFilter.
Definition: RunCRTM.h:27