TECA
teca_bayesian_ar_detect.h
1 #ifndef teca_bayesian_ar_detect_h
2 #define teca_bayesian_ar_detect_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_bayesian_ar_detect)
12 
13 
40 {
41 public:
42  TECA_ALGORITHM_STATIC_NEW(teca_bayesian_ar_detect)
43  TECA_ALGORITHM_DELETE_COPY_ASSIGN(teca_bayesian_ar_detect)
44  TECA_ALGORITHM_CLASS_NAME(teca_bayesian_ar_detect)
46 
47  // report/initialize to/from Boost program options
48  // objects.
49  TECA_GET_ALGORITHM_PROPERTIES_DESCRIPTION()
50  TECA_SET_ALGORITHM_PROPERTIES()
51 
52  // set the name of the input array
53  TECA_ALGORITHM_PROPERTY(std::string, ivt_variable)
54 
55  // set the names of columns in the parameter table.
56  TECA_ALGORITHM_PROPERTY(std::string, min_ivt_variable)
57  TECA_ALGORITHM_PROPERTY(std::string, min_component_area_variable)
58  TECA_ALGORITHM_PROPERTY(std::string, hwhm_latitude_variable)
59 
60  // flag indicating verbose terminal output is desired.
61  // default is 0
62  TECA_ALGORITHM_PROPERTY(int, verbose)
63 
64  // set/get the number of threads in the pool. setting
65  // to -1 results in a thread per core factoring in all MPI
66  // ranks running on the node. the default is -1.
67  void set_thread_pool_size(int n_threads);
68  unsigned int get_thread_pool_size() const noexcept;
69 
70  // override the input connections because we are going to
71  // take the first input and use it to generate metadata.
72  // the second input then becomes the only one the pipeline
73  // knows about.
74  void set_input_connection(unsigned int id,
75  const teca_algorithm_output_port &port) override;
76 
77 protected:
79 
80  std::string get_label_variable(const teca_metadata &request);
81 
82 private:
83  teca_metadata get_output_metadata(unsigned int port,
84  const std::vector<teca_metadata> &input_md) override;
85 
86  std::vector<teca_metadata> get_upstream_request(
87  unsigned int port, const std::vector<teca_metadata> &input_md,
88  const teca_metadata &request) override;
89 
90  const_p_teca_dataset execute(unsigned int port,
91  const std::vector<const_p_teca_dataset> &input_data,
92  const teca_metadata &request) override;
93 
94  void set_modified() override;
95 
96 private:
97  std::string ivt_variable;
98  std::string min_component_area_variable;
99  std::string min_ivt_variable;
100  std::string hwhm_latitude_variable;
101  int thread_pool_size;
102  int verbose;
103 
104  struct internals_t;
105  internals_t *internals;
106 };
107 
108 #endif
teca_metadata
Definition: teca_metadata.h:17
teca_bayesian_ar_detect
CASCADE BARD atmospheric river detector.
Definition: teca_bayesian_ar_detect.h:40
teca_bayesian_ar_detect::internals_t
Definition: teca_bayesian_ar_detect.cxx:580
teca_algorithm
Definition: teca_algorithm.h:25