UFO
EntireSampleDataHandler.cc
Go to the documentation of this file.
1
/*
2
* (C) Crown copyright 2020, Met Office
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 <algorithm>
9
10
#include "
ufo/profile/EntireSampleDataHandler.h
"
11
#include "
ufo/profile/VariableNames.h
"
12
13
namespace
ufo
{
14
EntireSampleDataHandler::EntireSampleDataHandler
(ioda::ObsSpace &obsdb,
15
const
DataHandlerParameters
&options)
16
: obsdb_(obsdb),
17
options_(options)
18
{}
19
20
void
EntireSampleDataHandler::writeQuantitiesToObsdb
()
21
{
22
// Write out all variables in the QCFlags and Corrections groups.
23
for
(
const
auto
& it_data :
entireSampleData_
) {
24
std::string fullname = it_data.first;
25
std::string varname;
26
std::string groupname;
27
ufo::splitVarGroup
(fullname, varname, groupname);
28
29
if
(groupname ==
"QCFlags"
) {
30
putDataVector
(fullname, get<int>(fullname));
31
}
else
if
(groupname ==
"Corrections"
) {
32
putDataVector
(fullname, get<float>(fullname));
33
}
34
}
35
36
// Write out the NumAnyErrors counter, which is used in multiple QC checks.
37
const
std::vector <int> &NumAnyErrors =
38
get<int>(
ufo::VariableNames::counter_NumAnyErrors
);
39
putDataVector
(
ufo::VariableNames::counter_NumAnyErrors
, NumAnyErrors);
40
}
41
}
// namespace ufo
ufo::VariableNames::counter_NumAnyErrors
static constexpr const char *const counter_NumAnyErrors
Definition:
VariableNames.h:101
ufo::splitVarGroup
void splitVarGroup(const std::string &vargrp, std::string &var, std::string &grp)
Definition:
StringUtils.cc:19
ufo::EntireSampleDataHandler::EntireSampleDataHandler
EntireSampleDataHandler(ioda::ObsSpace &obsdb, const DataHandlerParameters &options)
Definition:
EntireSampleDataHandler.cc:14
ufo
Definition:
RunCRTM.h:27
ufo::DataHandlerParameters
Options controlling the operation of the EntireSampleDataHandler and ProfileDataHandler classes.
Definition:
DataHandlerParameters.h:25
EntireSampleDataHandler.h
ufo::EntireSampleDataHandler::writeQuantitiesToObsdb
void writeQuantitiesToObsdb()
Definition:
EntireSampleDataHandler.cc:20
ufo::EntireSampleDataHandler::entireSampleData_
std::unordered_map< std::string, boost::variant< std::vector< int >, std::vector< float >, std::vector< std::string > > > entireSampleData_
Container of each variable in the entire data set.
Definition:
EntireSampleDataHandler.h:143
VariableNames.h
ufo::EntireSampleDataHandler::putDataVector
void putDataVector(const std::string &fullname, const std::vector< T > &datavec)
Put entire data vector on obsdb.
Definition:
EntireSampleDataHandler.h:114
fv3-bundle
ufo
src
ufo
profile
EntireSampleDataHandler.cc
Generated on Sat Oct 24 2020 19:14:54 for UFO by
1.8.18