8 #ifndef OOPS_BASE_OBSERVERS_H_
9 #define OOPS_BASE_OBSERVERS_H_
15 #include "eckit/config/LocalConfiguration.h"
27 #include "oops/util/Logger.h"
35 template <
typename MODEL,
typename OBS>
49 template <
typename DATA>
using ObsDataVec_ = std::vector<std::shared_ptr<ObsData_<DATA>>>;
59 PostProc_ &,
const eckit::Configuration & = eckit::LocalConfiguration());
65 static std::vector<ObserverParameters_>
convertToParameters(
const eckit::Configuration &config);
73 template <
typename MODEL,
typename OBS>
75 const std::vector<ObserverParameters_> ¶ms)
78 Log::trace() <<
"Observers<MODEL, OBS>::Observers start" << std::endl;
80 ASSERT(obspaces.
size() == params.size());
81 for (
size_t jj = 0; jj < obspaces.
size(); ++jj) {
85 Log::trace() <<
"Observers<MODEL, OBS>::Observers done" << std::endl;
90 template <
typename MODEL,
typename OBS>
92 :
Observers(obspaces, convertToParameters(config))
97 template <
typename MODEL,
typename OBS>
100 const eckit::Configuration & conf) {
101 Log::trace() <<
"Observers<MODEL, OBS>::initialize start" << std::endl;
104 for (
size_t jj = 0; jj < observers_.size(); ++jj) {
105 getvals->append(observers_[jj]->initialize(geom, obsaux[jj], Rmat[jj], conf));
109 Log::trace() <<
"Observers<MODEL, OBS>::initialize done" << std::endl;
114 template <
typename MODEL,
typename OBS>
116 oops::Log::trace() <<
"Observers<MODEL, OBS>::finalize start" << std::endl;
118 for (
size_t jj = 0; jj < observers_.size(); ++jj) {
119 observers_[jj]->finalize(yobs[jj]);
122 oops::Log::trace() <<
"Observers<MODEL, OBS>::finalize done" << std::endl;
127 template <
typename MODEL,
typename OBS>
129 const eckit::Configuration &config) {
130 oops::Log::trace() <<
"Observers<MODEL, OBS>::convertToParameters start" << std::endl;
132 std::vector<eckit::LocalConfiguration> subconfigs = config.getSubConfigurations();
133 std::vector<ObserverParameters<OBS>> parameters(subconfigs.size());
134 for (
size_t i = 0; i < subconfigs.size(); ++i) {
135 const eckit::LocalConfiguration &subconfig = subconfigs[i];
141 eckit::LocalConfiguration observerConfig;
144 observerConfig.set(
"obs operator", eckit::LocalConfiguration(subconfig,
"obs operator"));
147 std::vector<eckit::LocalConfiguration> filterConfigs;
148 if (subconfig.get(
"obs filters", filterConfigs))
149 observerConfig.set(
"obs filters", filterConfigs);
150 eckit::LocalConfiguration getValuesConfig;
151 if (subconfig.get(
"get values", getValuesConfig))
152 observerConfig.set(
"get values", getValuesConfig);
153 eckit::LocalConfiguration linearGetValuesConfig;
154 if (subconfig.get(
"linear get values", linearGetValuesConfig))
155 observerConfig.set(
"linear get values", linearGetValuesConfig);
157 parameters[i].validateAndDeserialize(observerConfig);
160 oops::Log::trace() <<
"Observers<MODEL, OBS>::convertToParameters start" << std::endl;
Geometry class used in oops; subclass of interface class interface::Geometry.
Fills GeoVaLs with requested variables at requested locations during model run.
Holds a vector of ObsAuxControl.
ObsDataVector is a vector templated on data type, in the observation space.
Container for ObsErrors for all observation types that are used in DA.
std::size_t size() const
Access.
ObsVector class used in oops; subclass of interface class interface::ObsVector.
Computes observation operator, applying bias correction and QC filters.
Computes observation operator (from GeoVaLs), applies bias correction and runs QC filters.
Geometry< MODEL > Geometry_
Observer< MODEL, OBS > Observer_
ObsErrors< OBS > ObsErrors_
ObserverParameters< OBS > ObserverParameters_
std::vector< std::shared_ptr< ObsData_< DATA > >> ObsDataVec_
ObsVector< OBS > ObsVector_
Observers(const ObsSpaces_ &, const std::vector< ObserverParameters_ > &)
Initializes ObsOperators, Locations, and QC data.
PostProcessor< State_ > PostProc_
ObsAuxControls< OBS > ObsAuxCtrls_
void initialize(const Geometry_ &, const ObsAuxCtrls_ &, ObsErrors_ &, PostProc_ &, const eckit::Configuration &=eckit::LocalConfiguration())
Initializes variables, obs bias, obs filters (could be different for different iterations.
ObsSpaces< OBS > ObsSpaces_
GetValuePosts< MODEL, OBS > GetValuePosts_
void finalize(Observations_ &)
Computes H(x) from the filled in GeoVaLs.
Observations< OBS > Observations_
static std::vector< ObserverParameters_ > convertToParameters(const eckit::Configuration &config)
std::vector< std::unique_ptr< Observer_ > > observers_
Control model post processing.
void enrollProcessor(PostBase_ *pp)
State class used in oops; subclass of interface class interface::State.
The namespace for the main oops code.