8 #ifndef UFO_FILTERS_BAYESIANBACKGROUNDCHECK_H_
9 #define UFO_FILTERS_BAYESIANBACKGROUNDCHECK_H_
16 #include "oops/util/ObjectCounter.h"
17 #include "oops/util/parameters/NumericConstraints.h"
18 #include "oops/util/parameters/Parameters.h"
19 #include "oops/util/parameters/RequiredParameter.h"
20 #include "oops/util/Printable.h"
28 template <
typename DATATYPE>
class ObsDataVector;
42 oops::RequiredParameter<float>
PdBad{
"prob density bad obs",
this,
43 {oops::exclusiveMinConstraint(0.0f)}};
45 oops::RequiredParameter<float>
PGE{
"initial prob gross error",
this,
46 {oops::exclusiveMinConstraint(0.0f)}};
76 private util::ObjectCounter<BayesianBackgroundCheck> {
82 static const std::string
classname() {
return "ufo::BayesianBackgroundCheck";}
90 void print(std::ostream &)
const override;
94 std::vector<std::vector<bool>> & flagged)
const override;
108 std::vector<T>
reduceVector(
const std::vector<T> & vector_full,
109 const std::vector<size_t> & j_reduced)
const;
117 std::vector<T> & vector_full,
118 const std::vector<size_t> & j_reduced)
const;
BayesianBackgroundCheck: check observation closeness to background, accounting for probability of gro...
std::vector< T > reduceVector(const std::vector< T > &vector_full, const std::vector< size_t > &j_reduced) const
Reduce a vector to only the elements for which j_reduced=true.
void applyFilter(const std::vector< bool > &apply, const Variables &filtervars, std::vector< std::vector< bool >> &flagged) const override
Apply Bayesian background check filter. Return flagged=true for rejected obs.
BayesianBackgroundCheckParameters Parameters_
static const std::string classname()
void unreduceVector(const std::vector< T > &vector_reduced, std::vector< T > &vector_full, const std::vector< size_t > &j_reduced) const
Copy a reduced vector back into the correct indices of the full vector.
Variable backgrErrVariable(const Variable &filterVariable) const
Return the name of the variable containing the background error estimate of the specified filter vari...
void print(std::ostream &) const override
~BayesianBackgroundCheck()
int qcFlag() const override
Return bayesianQC flag for observations rejected by Bayesian BG check.
BayesianBackgroundCheck(ioda::ObsSpace &obsdb, const Parameters_ ¶meters, std::shared_ptr< ioda::ObsDataVector< int > > flags, std::shared_ptr< ioda::ObsDataVector< float > > obserr)
Parameters controlling the operation of the BayesianBackgroundCheck filter.
oops::RequiredParameter< float > PGE
ProbabilityOfGrossErrorParameters PGEParameters
Parameters related to PGE calculations.
oops::RequiredParameter< float > PdBad
Base class for UFO QC filters.
Parameters shared by all filters having a default action (typically "reject").
Options controlling the operation of the calculations involving probability of gross error.