TECA
teca_temporal_average.h
1 #ifndef teca_temporal_average_h
2 #define teca_temporal_average_h
3 
4 #include "teca_shared_object.h"
5 #include "teca_algorithm.h"
6 #include "teca_metadata.h"
7 
8 #include <string>
9 #include <vector>
10 
11 TECA_SHARED_OBJECT_FORWARD_DECL(teca_temporal_average)
12 
13 
20 {
21 public:
22  TECA_ALGORITHM_STATIC_NEW(teca_temporal_average)
23  TECA_ALGORITHM_DELETE_COPY_ASSIGN(teca_temporal_average)
24  TECA_ALGORITHM_CLASS_NAME(teca_temporal_average)
26 
27  // report/initialize to/from Boost program options
28  // objects.
29  TECA_GET_ALGORITHM_PROPERTIES_DESCRIPTION()
30  TECA_SET_ALGORITHM_PROPERTIES()
31 
32  // set the number of steps to average. should be odd.
33  TECA_ALGORITHM_PROPERTY(unsigned int, filter_width)
34 
35 
36  // select the filter stencil, default is backward
37  enum {
38  backward,
39  centered,
40  forward
41  };
42  TECA_ALGORITHM_PROPERTY(int, filter_type)
43 
44 protected:
46 
47 private:
48  std::vector<teca_metadata> get_upstream_request(
49  unsigned int port,
50  const std::vector<teca_metadata> &input_md,
51  const teca_metadata &request) override;
52 
53  const_p_teca_dataset execute(
54  unsigned int port,
55  const std::vector<const_p_teca_dataset> &input_data,
56  const teca_metadata &request) override;
57 
58 private:
59  unsigned int filter_width;
60  int filter_type;
61 };
62 
63 #endif
teca_metadata
Definition: teca_metadata.h:17
teca_temporal_average
an algorithm that averages data in time
Definition: teca_temporal_average.h:20
teca_algorithm
Definition: teca_algorithm.h:25