13 #include "eckit/config/Configuration.h"
15 #include "ioda/ObsDataVector.h"
16 #include "ioda/ObsSpace.h"
18 #include "oops/util/Logger.h"
27 :
FilterBase(obsdb, parameters, flags, obserr),
28 parameters_(parameters)
30 oops::Log::trace() <<
"DifferenceCheck contructor starting" << std::endl;
38 oops::Log::trace() <<
"DifferenceCheck destructed" << std::endl;
45 std::vector<std::vector<bool>> & flagged)
const {
46 oops::Log::trace() <<
"DifferenceCheck priorFilter" << std::endl;
63 std::vector<float> ref, val;
66 ASSERT(ref.size() == val.size());
69 for (
size_t jobs = 0; jobs <
nlocs; ++jobs) {
73 for (
size_t jv = 0; jv < filtervars.
nvars(); ++jv) {
74 flagged[jv][jobs] =
true;
78 float diff = val[jobs] - ref[jobs];
79 for (
size_t jv = 0; jv < filtervars.
nvars(); ++jv) {
80 if (vmin !=
missing && diff < vmin) flagged[jv][jobs] =
true;
81 if (vmax !=
missing && diff > vmax) flagged[jv][jobs] =
true;
91 os <<
"DifferenceCheck::print not yet implemented ";
void print(std::ostream &) const override
DifferenceCheck(ioda::ObsSpace &, const Parameters_ &, std::shared_ptr< ioda::ObsDataVector< int > >, std::shared_ptr< ioda::ObsDataVector< float > >)
void applyFilter(const std::vector< bool > &, const Variables &, std::vector< std::vector< bool >> &) const override
Parameters controlling the operation of the DifferenceCheck filter.
oops::RequiredParameter< Variable > ref
Name of the reference variable.
oops::OptionalParameter< float > maxvalue
oops::RequiredParameter< Variable > val
Name of the test variable.
oops::OptionalParameter< float > minvalue
Base class for UFO QC filters.
const eckit::LocalConfiguration config_
void get(const Variable &varname, std::vector< float > &values) const
Fills a std::vector with values of the specified variable.
size_t nvars() const
Return the number of constituent "primitive" (single-channel) variables.
integer function nlocs(this)
Return the number of observational locations in this Locations object.