UFO
ProbabilityOfGrossError.h
Go to the documentation of this file.
1 /*
2  * (C) Crown copyright 2020, 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_PROBABILITYOFGROSSERROR_H_
9 #define UFO_UTILS_PROBABILITYOFGROSSERROR_H_
10 
11 #include <algorithm>
12 #include <string>
13 #include <vector>
14 
15 #include "oops/util/missingValues.h"
16 
19 
20 namespace ufo {
21  /// \brief Bayesian update of probability of gross error (PGE) for
22  /// scalar (1D) or vector (2D) observables.
23  /// This routine can process both single observations and observations on profile levels.
24  /// In the vector case, the variance is assumed to be isotropic
25  /// and obsErr and bkgErr give the error in a single vector component.
26  ///
27  /// \param[in] options: Configurable parameters that govern the operation of this routine.
28  /// \param[in] obsVal: Observation values.
29  /// \param[in] obsErr: Observation errors.
30  /// \param[in] bkgVal: Background values.
31  /// \param[in] bkgErr: Background errors.
32  /// \param[in] PdBad: Probability density for 'bad' observations.
33  /// \param[in] ModelLevels: Have the data been averaged onto model levels?
34  /// \param[inout] flags: QC flags.
35  /// \param[inout] PGE: Probability of gross error.
36  /// \param[inout] PGEBd: PGE for input to buddy check.
37  /// \param[in] ErrVarMax: (Optional) Maximum error variance.
38  /// \param[in] obsVal2: (Optional) Second component of 2D observation values.
39  /// \param[in] bkgVal2: (Optional) Second component of 2D background values.
40  void BayesianPGEUpdate(const ProbabilityOfGrossErrorParameters &options,
41  const std::vector<float> &obsVal,
42  const std::vector<float> &obsErr,
43  const std::vector<float> &bkgVal,
44  const std::vector<float> &bkgErr,
45  const std::vector<float> &PdBad,
46  const bool ModelLevels,
47  std::vector<int> &flags,
48  std::vector<float> &PGE,
49  std::vector<float> &PGEBd,
50  float ErrVarMax = -1,
51  const std::vector<float> *obsVal2 = nullptr,
52  const std::vector<float> *bkgVal2 = nullptr);
53 } // namespace ufo
54 
55 #endif // UFO_UTILS_PROBABILITYOFGROSSERROR_H_
MetOfficeQCFlags.h
ufo::BayesianPGEUpdate
void BayesianPGEUpdate(const ProbabilityOfGrossErrorParameters &options, const std::vector< float > &obsVal, const std::vector< float > &obsErr, const std::vector< float > &bkgVal, const std::vector< float > &bkgErr, const std::vector< float > &PdBad, const bool ModelLevels, std::vector< int > &flags, std::vector< float > &PGE, std::vector< float > &PGEBd, float ErrVarMax, const std::vector< float > *obsVal2, const std::vector< float > *bkgVal2)
Bayesian update of probability of gross error (PGE) for scalar (1D) or vector (2D) observables....
Definition: ProbabilityOfGrossError.cc:11
ufo
Definition: RunCRTM.h:27
ProbabilityOfGrossErrorParameters.h