TECA
teca_apply_binary_mask.h
1 #ifndef teca_apply_binary_mask_h
2 #define teca_apply_binary_mask_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_apply_binary_mask)
12 
13 
20 {
21 public:
22  TECA_ALGORITHM_STATIC_NEW(teca_apply_binary_mask)
23  TECA_ALGORITHM_DELETE_COPY_ASSIGN(teca_apply_binary_mask)
24  TECA_ALGORITHM_CLASS_NAME(teca_apply_binary_mask)
26 
27  // set the name of the output array
28  TECA_ALGORITHM_PROPERTY(std::string, mask_variable)
29 
30  // set the arrays to mask. if empty no arrays will be
31  // requested, but all present will be masked
32  TECA_ALGORITHM_VECTOR_PROPERTY(std::string, mask_array)
33 
34 protected:
36 
37 private:
38  //teca_metadata get_output_metadata(unsigned int port,
39  // const std::vector<teca_metadata> &input_md) override;
40 
41  std::vector<teca_metadata> get_upstream_request(
42  unsigned int port, const std::vector<teca_metadata> &input_md,
43  const teca_metadata &request) override;
44 
45  const_p_teca_dataset execute(unsigned int port,
46  const std::vector<const_p_teca_dataset> &input_data,
47  const teca_metadata &request) override;
48 
49 private:
50  std::string mask_variable;
51  std::vector<std::string> mask_arrays;
52 };
53 
54 #endif
teca_metadata
Definition: teca_metadata.h:17
teca_apply_binary_mask
an algorithm that applies a binary mask multiplicatively
Definition: teca_apply_binary_mask.h:20
teca_algorithm
Definition: teca_algorithm.h:25