8 #ifndef UFO_PROFILE_ENTIRESAMPLEDATAHANDLER_H_
9 #define UFO_PROFILE_ENTIRESAMPLEDATAHANDLER_H_
18 #include <unordered_map>
22 #include "boost/variant.hpp"
24 #include "ioda/ObsDataVector.h"
25 #include "ioda/ObsSpace.h"
56 std::vector<T>&
get(
const std::string &fullname)
60 std::string groupname;
65 std::vector <T> vec_all;
72 }
catch (boost::bad_get) {
73 throw eckit::BadParameter(
"Template parameter passed to boost::get "
74 "probably has the wrong type", Here());
76 }
else if (
obsdb_.has(groupname, varname) || optional) {
78 if (entriesPerProfile == 0) {
84 if (
obsdb_.has(groupname, varname))
obsdb_.get_db(groupname, varname, vec_all);
89 if (std::is_same<T, int>::value)
90 missingValue = util::missingValue(1);
91 else if (std::is_same<T, float>::value)
92 missingValue = util::missingValue(1.0f);
93 bool allMissing =
true;
94 for (
size_t idx = 0; allMissing && idx < vec_all.size(); ++idx)
95 allMissing = vec_all[idx] == missingValue;
97 oops::Log::debug() <<
"All elements of " << fullname <<
" are missing" << std::endl;
113 template <
typename T>
115 const std::vector <T> &datavec)
118 if (datavec.empty())
return;
121 std::string groupname;
123 obsdb_.put_db(groupname, varname, datavec);
139 std::string
defaultValue(
const std::vector <std::string> &vec) {
return "";}
142 std::unordered_map <std::string, boost::variant
147 #endif // UFO_PROFILE_ENTIRESAMPLEDATAHANDLER_H_