UFO
ObsDomainCheck.cc
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2018-2019 UCAR
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 
9 
10 #include <string>
11 #include <vector>
12 
13 #include "eckit/config/Configuration.h"
14 
15 #include "ioda/ObsDataVector.h"
16 #include "ioda/ObsSpace.h"
17 #include "oops/util/Logger.h"
18 
19 namespace ufo {
20 
21 // -----------------------------------------------------------------------------
22 
23 ObsDomainCheck::ObsDomainCheck(ioda::ObsSpace & obsdb, const Parameters_ & parameters,
24  std::shared_ptr<ioda::ObsDataVector<int> > flags,
25  std::shared_ptr<ioda::ObsDataVector<float> > obserr)
26  : FilterBase(obsdb, parameters, flags, obserr), parameters_(parameters)
27 {
28  oops::Log::debug() << "ObsDomainCheck: config = " << parameters_ << std::endl;
29 }
30 
31 // -----------------------------------------------------------------------------
32 
34 
35 // -----------------------------------------------------------------------------
36 
37 void ObsDomainCheck::applyFilter(const std::vector<bool> & inside,
38  const Variables & filtervars,
39  std::vector<std::vector<bool>> & flagged) const {
40  for (size_t jv = 0; jv < filtervars.nvars(); ++jv) {
41  for (size_t jobs = 0; jobs < obsdb_.nlocs(); ++jobs) {
42  flagged[jv][jobs] = !inside[jobs];
43  }
44  }
45 }
46 
47 // -----------------------------------------------------------------------------
48 
49 void ObsDomainCheck::print(std::ostream & os) const {
50  os << "ObsDomainCheck: config = " << parameters_ << std::endl;
51 }
52 
53 // -----------------------------------------------------------------------------
54 
55 } // namespace ufo
Base class for UFO QC filters.
Definition: FilterBase.h:45
void print(std::ostream &) const override
ObsDomainCheck(ioda::ObsSpace &, const Parameters_ &, std::shared_ptr< ioda::ObsDataVector< int > >, std::shared_ptr< ioda::ObsDataVector< float > >)
Parameters_ parameters_
void applyFilter(const std::vector< bool > &, const Variables &, std::vector< std::vector< bool >> &) const override
ioda::ObsSpace & obsdb_
size_t nvars() const
Return the number of constituent "primitive" (single-channel) variables.
Definition: Variables.cc:104
Definition: RunCRTM.h:27