12 #ifndef OOPS_GENERIC_OBSERRORDIAG_H_
13 #define OOPS_GENERIC_OBSERRORDIAG_H_
18 #include "eckit/config/Configuration.h"
22 #include "oops/util/Logger.h"
23 #include "oops/util/parameters/Parameter.h"
24 #include "oops/util/parameters/Parameters.h"
33 Parameter<double>
pert{
"random amplitude", 1.0,
this};
38 template<
typename OBS>
63 void save(
const std::string &)
const override;
75 void print(std::ostream &)
const override;
83 template<
typename OBS>
85 : stddev_(obsgeom,
"ObsError"), inverseVariance_(obsgeom), options_(
options)
90 Log::trace() <<
"ObsErrorDiag:ObsErrorDiag constructed nobs = " <<
stddev_.
nobs() << std::endl;
95 template<
typename OBS>
98 inverseVariance_ = stddev_;
99 inverseVariance_ *= stddev_;
100 inverseVariance_.
invert();
101 Log::info() <<
"ObsErrorDiag covariance updated " << stddev_.nobs() << std::endl;
106 template<
typename OBS>
108 dy /= inverseVariance_;
113 template<
typename OBS>
115 dy *= inverseVariance_;
120 template<
typename OBS>
129 template<
typename OBS>
136 template<
typename OBS>
138 os <<
"Diagonal observation error covariance" << std::endl << stddev_;
Base class for generic implementations of observation error covariance matrices.
Diagonal observation error covariance matrix.
double getRMSE() const override
Get mean std deviation of errors for Jo table.
void save(const std::string &) const override
Save obs errors.
void print(std::ostream &) const override
ObsVector_ inverseVariance() const override
Get inverseVariance.
void inverseMultiply(ObsVector_ &) const override
Multiply a Departure by .
void multiply(ObsVector_ &) const override
Multiply a Departure by .
ObsVector_ inverseVariance_
ObsSpace< OBS > ObsSpace_
void randomize(ObsVector_ &) const override
Generate random perturbation.
ObsVector_ obserrors() const override
Get obs errors std deviation.
ObsErrorDiagParameters Parameters_
void update(const ObsVector_ &) override
Update after obs errors potentially changed.
ObsVector< OBS > ObsVector_
ObsErrorDiag(const Parameters_ &, const ObsSpace_ &)
Parameters for diagonal obs errors.
Parameter< double > pert
perturbation amplitude multiplier
Configuration parameters of an implementation of an observation error covariance matrix model.
ObsVector class used in oops; subclass of interface class interface::ObsVector.
unsigned int nobs() const
Number of non-masked out observations (across all MPI tasks)
double rms() const
Return this ObsVector rms.
void random()
Set each value in this ObsVector to a random value.
void invert()
Set each value in this ObsVector to its inverse.
The namespace for the main oops code.