UFO
IodaGroupIndices.h
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2021 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 #ifndef UFO_UTILS_IODAGROUPINDICES_H_
9 #define UFO_UTILS_IODAGROUPINDICES_H_
10 
11 #include <string>
12 #include <vector>
13 
14 namespace ioda {
15  class ObsGroup;
16 }
17 
18 namespace oops {
19  class Variables;
20 }
21 
22 namespace ufo {
23 
24 /// Return the vector of indices of all elements in the range
25 /// [\p elements_to_look_for_begin, \p elements_to_look_for_end) in the \p varname ioda::Variable
26 /// from \p obsgroup ioda::ObsGroup, in the same order that the former are in.
27 /// Throws an exception if at least one of elements looked for is missing.
28 std::vector<int> getRequiredVariableIndices(const ioda::ObsGroup &obsgroup,
29  const std::string &varname,
30  typename std::vector<std::string>::const_iterator elements_to_look_for_begin,
31  typename std::vector<std::string>::const_iterator elements_to_look_for_end);
32 
33 /// Return the vector of indices of variables or channels \p vars_to_look_for in the
34 /// "variables" or "channels" ioda::Variable from \p obsgroup ioda::ObsGroup
35 std::vector<int> getRequiredVarOrChannelIndices(const ioda::ObsGroup &obsgroup,
36  const oops::Variables &vars_to_look_for);
37 
38 } // namespace ufo
39 
40 #endif // UFO_UTILS_IODAGROUPINDICES_H_
Forward declarations.
Definition: ObsAodExt.h:25
Definition: RunCRTM.h:27
std::vector< int > getRequiredVariableIndices(const ioda::ObsGroup &obsgroup, const std::string &varname, typename std::vector< std::string >::const_iterator elements_to_look_for_begin, typename std::vector< std::string >::const_iterator elements_to_look_for_end)
std::vector< int > getRequiredVarOrChannelIndices(const ioda::ObsGroup &obsgroup, const oops::Variables &vars_to_look_for)