UFO
ParameterTraitsVariable.h
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2019 Met Office UK
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_PARAMETERS_PARAMETERTRAITSVARIABLE_H_
9 #define UFO_UTILS_PARAMETERS_PARAMETERTRAITSVARIABLE_H_
10 
11 #include <string>
12 
13 #include "oops/util/parameters/ParameterTraits.h"
14 #include "ufo/filters/Variable.h"
15 
16 /// \file ParameterTraitsVariable.h
17 /// This file needs to be included before any uses of Parameter<ufo::Variable> or
18 /// OptionalParameter<ufo::Variable>.
19 
20 namespace oops {
21 
22 /// Parameters representing variables can be set in YAML files in two ways:
23 ///
24 /// * by setting a key to the variable name (a string), e.g.
25 ///
26 /// selected variable: air_temperature@ObsValue
27 ///
28 /// * by setting a key to a dictionary containing a key "name" set to the variable name
29 /// and optionally extra keys called "channels" and "options", e.g.
30 ///
31 /// selected variable:
32 /// name: brightness_temperature@ObsValue
33 /// channels: 1,5,7-10,13
34 ///
35 /// or
36 ///
37 /// selected variable:
38 /// name: SCATRetMW@ObsFunction
39 /// options:
40 /// scatret_ch238: 1
41 /// scatret_ch314: 2
42 /// scatret_ch890: 15
43 /// scatret_types: [ObsValue]
44 template <>
45 struct ParameterTraits<ufo::Variable> {
46  static boost::optional<ufo::Variable> get(util::CompositePath &path,
47  const eckit::Configuration &config,
48  const std::string& name);
49 
50  static void set(eckit::LocalConfiguration &config,
51  const std::string &name,
52  const ufo::Variable &value);
53 
54  static ObjectJsonSchema jsonSchema(const std::string &name);
55 };
56 
57 } // namespace oops
58 
59 #endif // UFO_UTILS_PARAMETERS_PARAMETERTRAITSVARIABLE_H_
Definition: RunCRTM.h:27