UFO
ObsProfileAverageData.h
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2021 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_PROFILE_OBSPROFILEAVERAGEDATA_H_
9 #define UFO_PROFILE_OBSPROFILEAVERAGEDATA_H_
10 
11 #include <memory>
12 #include <ostream>
13 #include <string>
14 #include <vector>
15 
16 #include "ioda/ObsSpace.h"
17 
18 #include "oops/base/Variables.h"
19 
20 #include "ufo/GeoVaLs.h"
22 
23 namespace eckit {
24  class Configuration;
25 }
26 
27 namespace ufo {
28 
29  /// \brief Data handling class for the ProfileAverage observation operator and TL/AD code.
31  public:
32  ObsProfileAverageData(const ioda::ObsSpace & odb,
33  const eckit::Configuration & config);
34 
35  /// Return required variables for the operator.
36  const oops::Variables & requiredVars() const;
37 
38  /// Return simulated variables for the operator.
39  const oops::Variables & simulatedVars() const;
40 
41  /// Return operator variable indices for the operator.
42  const std::vector<int> & operatorVarIndices() const;
43 
44  /// Cache the initial values of the GeoVaLs.
45  void cacheGeoVaLs(const GeoVaLs & gv) const;
46 
47  /// Get slant path locations. This determines, for each model level, the location that
48  /// corresponds to the intersection of the observed profile with that level.
49  std::vector<std::size_t> getSlantPathLocations
50  (const std::vector<std::size_t> & locsOriginal,
51  const std::vector<std::size_t> & locsExtended) const;
52 
53  /// Print operator configuration options.
54  void print(std::ostream & os) const;
55 
56  private:
57  /// Set up auxiliary reference variables that are used for comparison with OPS.
58  /// These reference variables are called MetOfficeHofX/slant_path_location and
59  /// MetOfficeHofX/slant_pressure. If a comparison with OPS is to be performed
60  /// then these variables must be present in the input data set.
62 
63  /// Compare auxiliary reference variables with those obtained in OPS.
64  void compareAuxiliaryReferenceVariables(const std::vector<std::size_t> & locsExtended,
65  const std::vector<std::size_t> & slant_path_location,
66  const std::vector<float> & slant_pressure) const;
67 
68  private:
69  /// ObsSpace.
70  const ioda::ObsSpace & odb_;
71 
72  /// Options for this observation operator.
74 
75  /// Name of model vertical coordinate.
76  std::string modelVerticalCoord_;
77 
78  /// Required variables.
79  oops::Variables requiredVars_;
80 
81  /// Operator variables.
82  oops::Variables operatorVars_;
83 
84  /// Indices of operator variables.
85  std::vector<int> operatorVarIndices_;
86 
87  /// Cached GeoVaLs.
88  mutable std::unique_ptr<GeoVaLs> cachedGeoVaLs_;
89 
90  /// Reference values of slant path locations.
91  std::vector<int> slant_path_location_ref_;
92 
93  /// Reference values of slant path pressures.
94  std::vector<float> slant_pressure_ref_;
95  };
96 } // namespace ufo
97 
98 #endif // UFO_PROFILE_OBSPROFILEAVERAGEDATA_H_
GeoVaLs: geophysical values at locations.
Data handling class for the ProfileAverage observation operator and TL/AD code.
std::string modelVerticalCoord_
Name of model vertical coordinate.
void compareAuxiliaryReferenceVariables(const std::vector< std::size_t > &locsExtended, const std::vector< std::size_t > &slant_path_location, const std::vector< float > &slant_pressure) const
Compare auxiliary reference variables with those obtained in OPS.
std::vector< std::size_t > getSlantPathLocations(const std::vector< std::size_t > &locsOriginal, const std::vector< std::size_t > &locsExtended) const
oops::Variables requiredVars_
Required variables.
ObsProfileAverageData(const ioda::ObsSpace &odb, const eckit::Configuration &config)
std::vector< int > operatorVarIndices_
Indices of operator variables.
std::unique_ptr< GeoVaLs > cachedGeoVaLs_
Cached GeoVaLs.
ObsProfileAverageParameters options_
Options for this observation operator.
const oops::Variables & requiredVars() const
Return required variables for the operator.
void cacheGeoVaLs(const GeoVaLs &gv) const
Cache the initial values of the GeoVaLs.
const oops::Variables & simulatedVars() const
Return simulated variables for the operator.
const std::vector< int > & operatorVarIndices() const
Return operator variable indices for the operator.
void print(std::ostream &os) const
Print operator configuration options.
std::vector< float > slant_pressure_ref_
Reference values of slant path pressures.
std::vector< int > slant_path_location_ref_
Reference values of slant path locations.
oops::Variables operatorVars_
Operator variables.
const ioda::ObsSpace & odb_
ObsSpace.
Configuration options recognized by the average profile operator.
Forward declarations.
Definition: ObsAodExt.h:21
Definition: RunCRTM.h:27