UFO
OrbitalAngle.h
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2021 Met Office
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_PREDICTORS_ORBITALANGLE_H_
9 #define UFO_PREDICTORS_ORBITALANGLE_H_
10 
11 #include <string>
12 #include <vector>
13 
14 #include "oops/util/parameters/Parameters.h"
15 #include "oops/util/parameters/ParameterTraits.h"
16 #include "oops/util/parameters/RequiredParameter.h"
17 
19 
20 namespace ioda {
21  class ObsSpace;
22 }
23 
24 namespace ufo {
25 
26 enum class FourierTermType {
27  SIN, COS
28 };
29 
32  static constexpr char enumTypeName[] = "FourierTermType";
33  static constexpr util::NamedEnumerator<FourierTermType> namedValues[] = {
34  { FourierTermType::SIN, "sin" },
35  { FourierTermType::COS, "cos" }
36  };
37 };
38 
39 } // namespace ufo
40 
41 namespace oops {
42 
43 template <>
44 struct ParameterTraits<ufo::FourierTermType> :
45  public EnumParameterTraits<ufo::FourierTermTypeParameterTraitsHelper>
46 {};
47 
48 } // namespace oops
49 
50 namespace ufo {
51 
52 // -----------------------------------------------------------------------------
53 
54 /// Configuration parameters of the OrbitalAngle predictor.
57 
58  public:
59  /// Order of the Fourier term.
60  oops::RequiredParameter<int> order{"order", this};
61  /// Type of the Fourier term (either `sin` or `cos`).
62  oops::RequiredParameter<FourierTermType> component{"component", this};
63 };
64 
65 // -----------------------------------------------------------------------------
66 /**
67  *This orbital angle predictor is used to fit residual errors as a function of satellite
68  *orbital angle using a Fourier series. The data must contain this orbital angle time
69  *series in the variable "satellite_orbital_angle@MetaData". Two member variables are
70  *used to store the order of the term in the series being calculated (order_) and the
71  *Fourier component (cos or sin), respectively. These are read from the yaml configuration
72  *file.
73  */
74 
75 class OrbitalAngle : public PredictorBase {
76  public:
77  /// The type of parameters accepted by the constructor of this predictor.
78  /// This typedef is used by the PredictorFactory.
80 
81  OrbitalAngle(const Parameters_ &, const oops::Variables &);
82 
83  void compute(const ioda::ObsSpace &,
84  const GeoVaLs &,
85  const ObsDiagnostics &,
86  ioda::ObsVector &) const override;
87 
88  private:
89  int order_;
91 };
92 
93 // -----------------------------------------------------------------------------
94 
95 } // namespace ufo
96 
97 #endif // UFO_PREDICTORS_ORBITALANGLE_H_
GeoVaLs: geophysical values at locations.
OrbitalAngle(const Parameters_ &, const oops::Variables &)
Definition: OrbitalAngle.cc:25
OrbitalAngleParameters Parameters_
Definition: OrbitalAngle.h:79
void compute(const ioda::ObsSpace &, const GeoVaLs &, const ObsDiagnostics &, ioda::ObsVector &) const override
compute the predictor
Definition: OrbitalAngle.cc:37
FourierTermType component_
Definition: OrbitalAngle.h:90
Configuration parameters of the OrbitalAngle predictor.
Definition: OrbitalAngle.h:55
oops::RequiredParameter< FourierTermType > component
Type of the Fourier term (either sin or cos).
Definition: OrbitalAngle.h:62
OOPS_CONCRETE_PARAMETERS(OrbitalAngleParameters, PredictorParametersBase)
oops::RequiredParameter< int > order
Order of the Fourier term.
Definition: OrbitalAngle.h:60
Base class for predictor parameters.
Definition: PredictorBase.h:37
Forward declarations.
Definition: ObsAodExt.h:25
Definition: RunCRTM.h:27
FourierTermType
Definition: OrbitalAngle.h:26
static constexpr char enumTypeName[]
Definition: OrbitalAngle.h:32
static constexpr util::NamedEnumerator< FourierTermType > namedValues[]
Definition: OrbitalAngle.h:33