13 static ProfileCheckMaker<ProfileCheckInterpolation>
28 const std::vector <float> &pressures =
30 const std::vector <float> &tObs =
32 const std::vector <float> &tBkg =
34 std::vector <int> &tFlags =
36 std::vector <int> &NumAnyErrors =
38 std::vector <int> &NumInterpErrors =
40 std::vector <int> &NumInterpErrObs =
42 const std::vector <float> &tObsCorrection =
45 if (!oops::allVectorsSameNonZeroSize(pressures, tObs, tBkg, tFlags,
47 oops::Log::warning() <<
"At least one vector is the wrong size. "
48 <<
"Check will not be performed." << std::endl;
49 oops::Log::warning() <<
"Vector sizes: "
50 << oops::listOfVectorSizes(pressures, tObs, tBkg, tFlags,
56 std::vector <float> tObsFinal;
59 calcStdLevels(numProfileLevels, pressures, tObsFinal, tFlags);
66 for (
int jlevstd = 0; jlevstd <
NumStd_; ++jlevstd) {
72 float PStd = pressures[jlev];
73 int IPStd = std::round(pressures[jlev] * 0.01);
87 if (SigB == -1 || SigA == -1)
continue;
89 if (pressures[SigB] - PStd > BigGap ||
90 PStd - pressures[SigA] > BigGap ||
96 tInterp_[jlev] = tObsFinal[SigB] + (tObsFinal[SigA] - tObsFinal[SigB]) * Ratio;
105 NumInterpErrors[0]++;
118 <<
" (central), " << SigB <<
" (lower) and "
119 << SigA <<
" (upper)" << std::endl;
121 <<
"P = " << pressures[jlev] * 0.01 <<
"hPa, tObs = "
125 <<
"C, tInterp - tObs = " <<
tInterp_[jlev] - tObsFinal[jlev]
128 <<
"P = " << pressures[SigB] * 0.01 <<
"hPa, tObs = "
132 <<
"P = " << pressures[SigA] * 0.01 <<
"hPa, tObs = "
137 if (NumErrors > 0) NumInterpErrObs[0]++;
Options controlling the operation of the ConventionalProfileProcessing filter.
oops::Parameter< float > ICheck_BigGapInit
Initial 'big gap' for interpolation check (hPa)
oops::Parameter< float > ICheck_TolRelax
T tolerance relaxation factor.
oops::Parameter< float > ICheck_TInterpTol
Tolerance for interpolation check (K)
oops::Parameter< float > ICheck_TolRelaxPThresh
Pressure threshold for T tolerance relaxation.
Profile QC checker base class.
const float missingValueFloat
Missing value (float)
const ConventionalProfileProcessingParameters & options_
Configurable parameters.
void correctVector(const std::vector< T > &v1, const std::vector< T > &v2, std::vector< T > &vout)
Apply correction to vector of values.
ProfileCheckInterpolation(const ConventionalProfileProcessingParameters &options)
void fillValidationData(ProfileDataHandler &profileDataHandler) override
Fill variables in validator.
std::vector< int > LevErrors_
Number of failed checks by level.
std::vector< float > tInterp_
Interpolated value of T.
void runCheck(ProfileDataHandler &profileDataHandler) override
Run check.
Retrieve and store data for individual profiles. To do this, first the vector of values in the entire...
std::vector< T > & get(const std::string &fullname)
void set(const std::string &fullname, std::vector< T > &&vec_in)
int getNumProfileLevels() const
Return number of levels to which QC checks should be applied.
Calculate standard levels.
std::vector< float > BigGaps_
Big gaps (hPa) used in interpolation check.
std::vector< int > StdLev_
Index of standard levels.
void calcStdLevels(const int numProfileLevels, const std::vector< float > &pressures, const std::vector< float > &tObs, const std::vector< int > &tFlags)
Calculate standard levels.
std::vector< float > StandardLevels_
Standard levels (hPa)
std::vector< float > LogP_
Log(Pressure) - used for vertical interpolation.
int NumStd_
Number of standard levels.
std::vector< int > IndStd_
Indices of standard levels.
std::vector< int > SigBelow_
Significant level below standard level.
std::vector< int > SigAbove_
Significant level above standard level.
int NumSig_
Number of significant levels.
@ InterpolationFlag
Interpolation check flag.
@ SurfaceLevelFlag
Surface Level.
static ProfileCheckMaker< ProfileCheckInterpolation > makerProfileCheckInterpolation_("Interpolation")
util::Duration abs(const util::Duration &duration)
static constexpr double t0c
static constexpr const char *const tInterp
static constexpr const char *const hofx_air_temperature
static constexpr const char *const LogP
static constexpr const char *const obs_air_temperature
static constexpr const char *const counter_NumInterpErrObs
static constexpr const char *const LevErrors
static constexpr const char *const counter_NumInterpErrors
static constexpr const char *const counter_NumAnyErrors
static constexpr const char *const NumSig
static constexpr const char *const NumStd
static constexpr const char *const SigBelow
static constexpr const char *const StdLev
static constexpr const char *const obs_air_pressure
static constexpr const char *const qcflags_air_temperature
static constexpr const char *const obscorrection_air_temperature
static constexpr const char *const SigAbove
static constexpr const char *const IndStd