UFO
Legendre.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_LEGENDRE_H_
9 #define UFO_PREDICTORS_LEGENDRE_H_
10 
11 #include <vector>
12 
13 #include "oops/util/parameters/OptionalParameter.h"
14 #include "oops/util/parameters/Parameter.h"
15 #include "oops/util/parameters/Parameters.h"
16 #include "oops/util/parameters/RequiredParameter.h"
17 
19 
20 namespace ioda {
21  class ObsSpace;
22 }
23 
24 namespace ufo {
25 
26 // -----------------------------------------------------------------------------
27 
28 /// Configuration parameters of the Legendre predictor.
31 
32  public:
33  /// Number of scan positions.
34  oops::RequiredParameter<int> numScanPositions{"number of scan positions", this};
35 
36  /// Order of the Legendre polynomial. By default, 1.
37  ///
38  /// \note If this option is set, a suffix containing its value (even if it's equal to 1) will be
39  /// appended to the predictor name.
40  oops::OptionalParameter<int> order{"order", this};
41 };
42 
43 // -----------------------------------------------------------------------------
44 /**
45  *This Legendre predictor is for fitting residual errors between the ends of the
46  *scan extremes; thus, the scan position is rescaled between -1 and 1 (xscan variable).
47  *Legendre polynomials are calculated with recurrence relations. Polynomials can be
48  *produced for an order (as addressed by input parameter of that name). The data must
49  *contain scan positions in the variable "scan_position@MetaData" and the number of scan
50  *positons in"sensor_numb_scan_position@MetaData". Both of these are vectors with length
51  *nlocs in the current implementation.
52  */
53 
54 
55 class Legendre : public PredictorBase {
56  public:
57  /// The type of parameters accepted by the constructor of this predictor.
58  /// This typedef is used by the PredictorFactory.
60 
61  Legendre(const Parameters_ &, const oops::Variables &);
62  ~Legendre() {}
63 
64  void compute(const ioda::ObsSpace &,
65  const GeoVaLs &,
66  const ObsDiagnostics &,
67  ioda::ObsVector &) const override;
68 
69  private:
70  int order_;
71  int nscan_;
72 };
73 
74 // -----------------------------------------------------------------------------
75 
76 } // namespace ufo
77 
78 #endif // UFO_PREDICTORS_LEGENDRE_H_
GeoVaLs: geophysical values at locations.
Legendre(const Parameters_ &, const oops::Variables &)
Definition: Legendre.cc:20
void compute(const ioda::ObsSpace &, const GeoVaLs &, const ObsDiagnostics &, ioda::ObsVector &) const override
compute the predictor
Definition: Legendre.cc:32
LegendreParameters Parameters_
Definition: Legendre.h:59
Configuration parameters of the Legendre predictor.
Definition: Legendre.h:29
oops::OptionalParameter< int > order
Definition: Legendre.h:40
OOPS_CONCRETE_PARAMETERS(LegendreParameters, PredictorParametersBase)
oops::RequiredParameter< int > numScanPositions
Number of scan positions.
Definition: Legendre.h:34
Base class for predictor parameters.
Definition: PredictorBase.h:37
Forward declarations.
Definition: ObsAodExt.h:25
Definition: RunCRTM.h:27