TECA
teca_vertical_reduction.h
1 #ifndef teca_vertical_reduction_h
2 #define teca_vertical_reduction_h
3 
4 #include "teca_shared_object.h"
5 #include "teca_algorithm.h"
6 #include "teca_metadata.h"
7 #include "teca_array_attributes.h"
8 
9 #include <string>
10 #include <vector>
11 
12 TECA_SHARED_OBJECT_FORWARD_DECL(teca_vertical_reduction)
13 
14 
21 {
22 public:
23  TECA_ALGORITHM_STATIC_NEW(teca_vertical_reduction)
24  TECA_ALGORITHM_DELETE_COPY_ASSIGN(teca_vertical_reduction)
25  TECA_ALGORITHM_CLASS_NAME(teca_vertical_reduction)
27 
28  // report/initialize to/from Boost program options
29  // objects.
30  TECA_GET_ALGORITHM_PROPERTIES_DESCRIPTION()
31  TECA_SET_ALGORITHM_PROPERTIES()
32 
33  // set/get the list of variables that are needed to produce
34  // the derived quantity
35  TECA_ALGORITHM_VECTOR_PROPERTY(std::string, dependent_variable)
36 
37  // set/get the name of the variable that is produced
38  TECA_ALGORITHM_VECTOR_PROPERTY(std::string, derived_variable)
39 
40  // set/get the attributes of the variable that is produced
41  TECA_ALGORITHM_VECTOR_PROPERTY(teca_array_attributes,
42  derived_variable_attribute)
43 
44 protected:
46 
47  teca_metadata get_output_metadata(
48  unsigned int port,
49  const std::vector<teca_metadata> &input_md) override;
50 
51  std::vector<teca_metadata> get_upstream_request(
52  unsigned int port,
53  const std::vector<teca_metadata> &input_md,
54  const teca_metadata &request) override;
55 
56  const_p_teca_dataset execute(
57  unsigned int port,
58  const std::vector<const_p_teca_dataset> &input_data,
59  const teca_metadata &request) override;
60 
61 private:
62  std::vector<std::string> dependent_variables;
63  std::vector<std::string> derived_variables;
64  std::vector<teca_array_attributes> derived_variable_attributes;
65 };
66 
67 #endif
teca_metadata
Definition: teca_metadata.h:17
teca_array_attributes
Definition: teca_array_attributes.h:30
teca_vertical_reduction
base class for vertical reducitons
Definition: teca_vertical_reduction.h:21
teca_algorithm
Definition: teca_algorithm.h:25