TECA
teca_tc_candidates.h
1 #ifndef teca_tc_candidates_h
2 #define teca_tc_candidates_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_tc_candidates)
12 
13 
49 {
50 public:
51  TECA_ALGORITHM_STATIC_NEW(teca_tc_candidates)
52  TECA_ALGORITHM_DELETE_COPY_ASSIGN(teca_tc_candidates)
53  TECA_ALGORITHM_CLASS_NAME(teca_tc_candidates)
55 
56  // report/initialize to/from Boost program options
57  // objects.
58  TECA_GET_ALGORITHM_PROPERTIES_DESCRIPTION()
59  TECA_SET_ALGORITHM_PROPERTIES()
60 
61  // set/get the name of input variables
62  TECA_ALGORITHM_PROPERTY(std::string, surface_wind_speed_variable)
63  TECA_ALGORITHM_PROPERTY(std::string, vorticity_850mb_variable)
64  TECA_ALGORITHM_PROPERTY(std::string, sea_level_pressure_variable)
65  TECA_ALGORITHM_PROPERTY(std::string, core_temperature_variable)
66  TECA_ALGORITHM_PROPERTY(std::string, thickness_variable)
67 
68  // a candidate is defined as having:
69  // 1) a local maximum in vorticity above vorticty_850mb_threshold,
70  // centered on a window of vorticty_850mb_window degrees
71  // 2) a local minimum in pressure within max_core_radius degrees
72  // 3) having max pressure delta within max_pressure_radius at
73  // that location
74  TECA_ALGORITHM_PROPERTY(double, max_core_radius)
75  TECA_ALGORITHM_PROPERTY(double, min_vorticity_850mb)
76  TECA_ALGORITHM_PROPERTY(double, vorticity_850mb_window)
77  TECA_ALGORITHM_PROPERTY(double, max_pressure_delta)
78  TECA_ALGORITHM_PROPERTY(double, max_pressure_radius)
79 
80  // these criteria are recorded here but only used in the trajectory
81  // stitching stage.
82  TECA_ALGORITHM_PROPERTY(double, max_core_temperature_delta)
83  TECA_ALGORITHM_PROPERTY(double, max_core_temperature_radius)
84  TECA_ALGORITHM_PROPERTY(double, max_thickness_delta)
85  TECA_ALGORITHM_PROPERTY(double, max_thickness_radius)
86 
87  // set/get the bounding box to search for storms
88  // in units of degreees lat,lon
89  TECA_ALGORITHM_PROPERTY(double, search_lat_low)
90  TECA_ALGORITHM_PROPERTY(double, search_lat_high)
91  TECA_ALGORITHM_PROPERTY(double, search_lon_low)
92  TECA_ALGORITHM_PROPERTY(double, search_lon_high)
93 
94  // set/get the number of iterations to search for the
95  // storm local minimum. raising this paramter might increase
96  // detections but the detector will run slowerd. default is
97  // 50.
98  TECA_ALGORITHM_PROPERTY(int, minimizer_iterations)
99 
100  // send humand readable representation to the
101  // stream
102  virtual void to_stream(std::ostream &os) const override;
103 
104 protected:
106 
107  // helper that computes the output extent
108  int get_active_extent(
109  p_teca_variant_array lat,
110  p_teca_variant_array lon,
111  std::vector<unsigned long> &extent) const;
112 
113 private:
114  virtual
115  teca_metadata get_output_metadata(
116  unsigned int port,
117  const std::vector<teca_metadata> &input_md) override;
118 
119  virtual
120  std::vector<teca_metadata> get_upstream_request(
121  unsigned int port,
122  const std::vector<teca_metadata> &input_md,
123  const teca_metadata &request) override;
124 
125  virtual
126  const_p_teca_dataset execute(
127  unsigned int port,
128  const std::vector<const_p_teca_dataset> &input_data,
129  const teca_metadata &request) override;
130 
131 private:
132  std::string surface_wind_speed_variable;
133  std::string vorticity_850mb_variable;
134  std::string sea_level_pressure_variable;
135  std::string core_temperature_variable;
136  std::string thickness_variable;
137 
138  double max_core_radius;
139  double min_vorticity_850mb;
140  double vorticity_850mb_window;
141  double max_pressure_delta;
142  double max_pressure_radius;
143  double max_core_temperature_delta;
144  double max_core_temperature_radius;
145  double max_thickness_delta;
146  double max_thickness_radius;
147 
148  double search_lat_low;
149  double search_lat_high;
150  double search_lon_low;
151  double search_lon_high;
152 
153  int minimizer_iterations;
154 };
155 
156 #endif
teca_metadata
Definition: teca_metadata.h:17
teca_tc_candidates
Definition: teca_tc_candidates.h:49
teca_algorithm
Definition: teca_algorithm.h:25