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::allocate(const int nlev, const oops::Variables & vars) {
38  gdiags_.allocate(nlev, vars);
39 }
40 
41 // -----------------------------------------------------------------------------
42 
43 void ObsDiagnostics::save(const std::vector<double> & vals,
44  const std::string & var,
45  const int lev) {
46  gdiags_.putAtLevel(vals, var, lev);
47 }
48 
49 // -----------------------------------------------------------------------------
50 
51 size_t ObsDiagnostics::nlevs(const std::string & var) const {
52  return gdiags_.nlevs(var);
53 }
54 
55 // -----------------------------------------------------------------------------
56 
57 void ObsDiagnostics::get(std::vector<float> & vals, const std::string & var) const {
58  gdiags_.get(vals, var);
59 }
60 
61 // -----------------------------------------------------------------------------
62 
63 void ObsDiagnostics::get(std::vector<float> & vals, const std::string & var,
64  const int lev) const {
65  gdiags_.getAtLevel(vals, var, lev);
66 }
67 
68 // -----------------------------------------------------------------------------
69 
70 void ObsDiagnostics::print(std::ostream & os) const {
71  os << "ObsDiagnostics not printing yet.";
72 }
73 
74 // -----------------------------------------------------------------------------
75 
76 } // namespace ufo
size_t nlevs(const std::string &var) const
Return number of levels for a specified variable.
Definition: GeoVaLs.cc:310
void getAtLevel(std::vector< double > &, const std::string &, const int) const
Get GeoVaLs at a specified level.
Definition: GeoVaLs.cc:330
void allocate(const int &nlev, const oops::Variables &vars)
Deprecated method. Allocates GeoVaLs for vars variables with nlev number of levels.
Definition: GeoVaLs.cc:128
void get(std::vector< double > &, const std::string &var) const
Get 2D GeoVaLs for variable var (fails for 3D GeoVaLs)
Definition: GeoVaLs.cc:359
void putAtLevel(const std::vector< double > &vals, const std::string &var, const int lev) const
Put GeoVaLs for double variable var at level lev.
Definition: GeoVaLs.cc:414
Locations class to handle simple lat-lon-time locations.
void get(std::vector< float > &, const std::string &) const
void allocate(const int nlev, const oops::Variables &vars)
Allocate diagnostics for variables vars with nlev number of levels.
void print(std::ostream &) const
size_t nlevs(const std::string &) const
ObsDiagnostics(const ioda::ObsSpace &, const Locations &, const oops::Variables &)
void save(const std::vector< double > &, const std::string &, const int)
Definition: RunCRTM.h:27