UFO
MetOfficeBMatrixStatic.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_UTILS_METOFFICE_METOFFICEBMATRIXSTATIC_H_
9 #define UFO_UTILS_METOFFICE_METOFFICEBMATRIXSTATIC_H_
10 
11 #include <Eigen/Dense>
12 
13 #include <algorithm>
14 #include <string>
15 #include <vector>
16 
17 #include "oops/base/Variables.h"
18 #include "oops/util/ObjectCounter.h"
19 #include "oops/util/Printable.h"
21 
22 namespace eckit {
23  class Configuration;
24 }
25 
26 namespace ufo {
27 
28 // -----------------------------------------------------------------------------
29 /// MetOfficeBMatrixStatic: Met Office static model covariance
30 /// This class provides access to the static b matrix used for radiance
31 /// processing by the Met Office. The objects main method is to multiply
32 /// an eigen matrix by the bmatrix
33 // -----------------------------------------------------------------------------
34 
35 class MetOfficeBMatrixStatic : public util::Printable,
36  private util::ObjectCounter<MetOfficeBMatrixStatic> {
37  public:
38  static const std::string classname() {return "ufo::MetOfficeBMatrixStatic";}
39 
40  explicit MetOfficeBMatrixStatic(const eckit::Configuration &);
41 
42  size_t getindex(const float) const;
43  size_t getsize(void) const;
44  void multiply(const float, const Eigen::MatrixXf &, Eigen::MatrixXf &) const;
45 
46  private:
47  void print(std::ostream &) const override;
48  F90obfilter keyMetOfficeBMatrixStatic_; // key to Fortran for B
49  size_t nbands_; // number of latitude bands for B
50  size_t nelements_; // number of elements in each dimension of B
51  std::vector<float> southlimits_; // southern latitude limit per band
52  std::vector<float> northlimits_; // northern latitude limit per band
53  std::vector<Eigen::MatrixXf> elements_; // container for B contents
54 };
55 
56 } // namespace ufo
57 
58 #endif // UFO_UTILS_METOFFICE_METOFFICEBMATRIXSTATIC_H_
static const std::string classname()
size_t getsize(void) const
Return bmatrix size (number of rows or columns of square matrix)
void print(std::ostream &) const override
Print.
size_t getindex(const float) const
Find bmatrix band index for a given latitude.
std::vector< Eigen::MatrixXf > elements_
void multiply(const float, const Eigen::MatrixXf &, Eigen::MatrixXf &) const
Multiply input matrix by bmatrix array based on latitude.
MetOfficeBMatrixStatic(const eckit::Configuration &)
Constructor.
Forward declarations.
Definition: ObsAodExt.h:21
Definition: RunCRTM.h:27
int F90obfilter
Definition: Fortran.h:22