UFO
ObsDiagnostics.cc
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2018 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 
8 #include "ufo/ObsDiagnostics.h"
9 
10 #include <ostream>
11 #include <string>
12 #include <vector>
13 
14 #include "oops/base/Variables.h"
15 #include "ufo/Locations.h"
16 
17 #include "ioda/ObsSpace.h"
18 
19 namespace ufo {
20 
21 // -----------------------------------------------------------------------------
22 
23 ObsDiagnostics::ObsDiagnostics(const ioda::ObsSpace & os, const Locations & locs,
24  const oops::Variables & vars)
25  : obsdb_(os), gdiags_(locs, vars)
26 {}
27 
28 // -----------------------------------------------------------------------------
29 
30 ObsDiagnostics::ObsDiagnostics(const eckit::Configuration & conf, const ioda::ObsSpace & os,
31  const oops::Variables & vars)
32  : obsdb_(os), gdiags_(conf, os, vars)
33 {}
34 
35 // -----------------------------------------------------------------------------
36 
37 void ObsDiagnostics::save(const std::vector<double> & vals,
38  const std::string & var,
39  const int lev) {
40  gdiags_.put(vals, var, lev);
41 }
42 
43 // -----------------------------------------------------------------------------
44 
45 size_t ObsDiagnostics::nlevs(const std::string & var) const {
46  return gdiags_.nlevs(var);
47 }
48 
49 // -----------------------------------------------------------------------------
50 
51 void ObsDiagnostics::get(std::vector<float> & vals, const std::string & var) const {
52  gdiags_.get(vals, var);
53 }
54 
55 // -----------------------------------------------------------------------------
56 
57 void ObsDiagnostics::get(std::vector<float> & vals, const std::string & var,
58  const int lev) const {
59  gdiags_.get(vals, var, lev);
60 }
61 
62 // -----------------------------------------------------------------------------
63 
64 void ObsDiagnostics::print(std::ostream & os) const {
65  os << "ObsDiagnostics not printing yet.";
66 }
67 
68 // -----------------------------------------------------------------------------
69 
70 } // namespace ufo
ufo::ObsDiagnostics::ObsDiagnostics
ObsDiagnostics(const ioda::ObsSpace &, const Locations &, const oops::Variables &)
Definition: ObsDiagnostics.cc:23
ufo::ObsDiagnostics::nlevs
size_t nlevs(const std::string &) const
Definition: ObsDiagnostics.cc:45
ufo::ObsDiagnostics::print
void print(std::ostream &) const
Definition: ObsDiagnostics.cc:64
ufo::Locations
Locations class to handle locations for UFO.
Definition: src/ufo/Locations.h:32
ufo
Definition: RunCRTM.h:27
ufo::GeoVaLs::get
void get(std::vector< float > &, const std::string &) const
Return all values for a specific 2D variable.
Definition: GeoVaLs.cc:268
ufo::GeoVaLs::put
void put(const std::vector< double > &, const std::string &, const int) const
Put values for a specific variable and level.
Definition: GeoVaLs.cc:298
ufo::ObsDiagnostics::save
void save(const std::vector< double > &, const std::string &, const int)
Definition: ObsDiagnostics.cc:37
ufo::ObsDiagnostics::get
void get(std::vector< float > &, const std::string &) const
Definition: ObsDiagnostics.cc:51
ufo::GeoVaLs::nlevs
size_t nlevs(const std::string &var) const
Return number of levels for a specified variable.
Definition: GeoVaLs.cc:259
ufo::ObsDiagnostics::gdiags_
GeoVaLs gdiags_
Definition: src/ufo/ObsDiagnostics.h:60
conf
Definition: conf.py:1