Go to the documentation of this file.
13 static ProfileCheckMaker<ProfileCheckInterpolation>
21 :
ProfileCheckBase(options, profileIndices, profileDataHandler, profileCheckValidator),
31 const std::vector <float> &pressures =
33 const std::vector <float> &tObs =
35 const std::vector <float> &tBkg =
37 std::vector <int> &tFlags =
39 std::vector <int> &NumAnyErrors =
41 std::vector <int> &NumInterpErrors =
43 std::vector <int> &NumInterpErrObs =
45 const std::vector <float> &tObsCorrection =
48 if (!oops::allVectorsSameNonZeroSize(pressures, tObs, tBkg, tFlags,
50 oops::Log::warning() <<
"At least one vector is the wrong size. "
51 <<
"Check will not be performed." << std::endl;
52 oops::Log::warning() <<
"Vector sizes: "
53 << oops::listOfVectorSizes(pressures, tObs, tBkg, tFlags,
59 std::vector <float> tObsFinal;
62 calcStdLevels(numLevelsToCheck, pressures, tObsFinal, tFlags);
69 for (
int jlevstd = 0; jlevstd <
NumStd_; ++jlevstd) {
75 float PStd = pressures[jlev];
76 int IPStd = std::round(pressures[jlev] * 0.01);
90 if (SigB == -1 || SigA == -1)
continue;
92 if (pressures[SigB] - PStd > BigGap ||
93 PStd - pressures[SigA] > BigGap ||
99 tInterp_[jlev] = tObsFinal[SigB] + (tObsFinal[SigA] - tObsFinal[SigB]) * Ratio;
102 float TolRelax = 1.0;
108 NumInterpErrors[0]++;
121 <<
" (central), " << SigB <<
" (lower) and "
122 << SigA <<
" (upper)" << std::endl;
124 <<
"P = " << pressures[jlev] * 0.01 <<
"hPa, tObs = "
128 <<
"C, tInterp - tObs = " <<
tInterp_[jlev] - tObsFinal[jlev]
131 <<
"P = " << pressures[SigB] * 0.01 <<
"hPa, tObs = "
135 <<
"P = " << pressures[SigA] * 0.01 <<
"hPa, tObs = "
140 if (NumErrors > 0) NumInterpErrObs[0]++;
static constexpr const char *const counter_NumAnyErrors
oops::Parameter< float > ICheck_TolRelax
T tolerance relaxation factor.
std::vector< float > LogP_
Log(Pressure) - used for vertical interpolation.
Retrieve and store data for individual profiles. To do this, first the vector of values in the entire...
const ProfileIndices & profileIndices_
Indices of profile's observations in the entire sample.
std::vector< int > StdLev_
Index of standard levels.
Determine indices of observations making up individual profiles. The indices are computed with respec...
ProfileDataHandler & profileDataHandler_
Profile data handler.
static constexpr const char *const StdLev
int getNumLevelsToCheck() const
Return number of levels to which QC checks should be applied.
static constexpr const char *const IndStd
static constexpr double t0c
Profile QC check validator.
Calculate standard levels.
void runCheck() override
Run check.
int NumSig_
Number of significant levels.
std::vector< int > IndStd_
Indices of standard levels.
oops::Parameter< float > ICheck_TInterpTol
Tolerance for interpolation check (K)
static constexpr const char *const LogP
void calcStdLevels(const int numLevelsToCheck, 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)
static constexpr const char *const LevErrors
Profile QC checker base class.
static constexpr const char *const SigBelow
const ProfileConsistencyCheckParameters & options_
Configurable parameters.
oops::Parameter< float > ICheck_TolRelaxPThresh
Pressure threshold for T tolerance relaxation.
int NumStd_
Number of standard levels.
ProfileCheckInterpolation(const ProfileConsistencyCheckParameters &options, const ProfileIndices &profileIndices, ProfileDataHandler &profileDataHandler, ProfileCheckValidator &profileCheckValidator)
static constexpr const char *const obs_air_pressure
const float missingValueFloat
Missing value (float)
void fillValidator() override
Fill variables in validator.
static constexpr const char *const hofx_air_temperature
util::Duration abs(const util::Duration &duration)
static constexpr const char *const tInterp
Options controlling the operation of the ProfileConsistencyChecks filter.
static constexpr const char *const counter_NumInterpErrObs
static constexpr const char *const counter_NumInterpErrors
std::vector< int > SigBelow_
Significant level below standard level.
void correctVector(const std::vector< T > &v1, const std::vector< T > &v2, std::vector< T > &vout)
Apply correction to vector of values.
static constexpr const char *const NumStd
static constexpr const char *const obscorrection_air_temperature
static ProfileCheckMaker< ProfileCheckInterpolation > makerProfileCheckInterpolation_("Interpolation")
std::vector< float > tInterp_
Interpolated value of T.
oops::Parameter< float > ICheck_BigGapInit
Initial 'big gap' for interpolation check (hPa)
static constexpr const char *const qcflags_air_temperature
std::vector< float > BigGaps_
Big gaps (hPa) used in interpolation check.
@ InterpolationFlag
Interpolation check flag.
std::vector< int > LevErrors_
Number of failed checks by level.
std::vector< int > SigAbove_
Significant level above standard level.
std::vector< T > & get(const std::string &fullname)
static constexpr const char *const obs_air_temperature
static constexpr const char *const SigAbove
void set(const std::string &fullname, std::vector< T > &&vec_in)
static constexpr const char *const NumSig
@ SurfaceLevelFlag
Surface Level.