TECA
The Toolkit for Extreme Climate Analysis
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 /// GFDL tropical storms detection algorithm.
14 /**
15  * For more information see
16  * "Seasonal forecasting of tropical storms using coupled GCM integrations"
17  *
18  * --- INPUT
19  * Gwind - wind speed at 850 mb
20  * Gvort - vorticity_850mb at 850 mb
21  * Gtbar - mean core_temperature for warm core layer
22  * Gpsl - sea level sea_level_pressure
23  * Gthick - thickness of 200 to 1000 mb layer
24  * Grlon - longitudes
25  * Grlat - latitudes
26  * iyear - year
27  * imon - month
28  * iday - day of month
29  * ihour - hour
30  * iucy - unit for output
31  *
32  * --- OUTPUT
33  * --- record # 1
34  * num0 - day
35  * imon0 - month
36  * iyear - year
37  * number - number of cyclones found
38  * --- records # 2...number+1
39  * idex, jdex - (i,j) index of cyclone
40  * svort_max - max vorticity_850mb
41  * swind_max - max wind
42  * spsl_min - min sea level sea_level_pressure
43  * svort_lon, svort_lat - longitude & latitude of max vorticity_850mb
44  * spsl_lon, spsl_lat - longitude & latitude of min slp
45  * stemperature_lon, stemperature_lat - longitude & latitude of warm
46  * core
47  * sthick_lon, sthick_lat - longitude & latitude of max thickness
48  */
50 {
51 public:
52  TECA_ALGORITHM_STATIC_NEW(teca_tc_candidates)
53  TECA_ALGORITHM_DELETE_COPY_ASSIGN(teca_tc_candidates)
54  TECA_ALGORITHM_CLASS_NAME(teca_tc_candidates)
56 
57  // report/initialize to/from Boost program options
58  // objects.
59  TECA_GET_ALGORITHM_PROPERTIES_DESCRIPTION()
60  TECA_SET_ALGORITHM_PROPERTIES()
61 
62  // set/get the name of input variables
63  TECA_ALGORITHM_PROPERTY(std::string, surface_wind_speed_variable)
64  TECA_ALGORITHM_PROPERTY(std::string, vorticity_850mb_variable)
65  TECA_ALGORITHM_PROPERTY(std::string, sea_level_pressure_variable)
66  TECA_ALGORITHM_PROPERTY(std::string, core_temperature_variable)
67  TECA_ALGORITHM_PROPERTY(std::string, thickness_variable)
68 
69  // a candidate is defined as having:
70  // 1) a local maximum in vorticity above vorticty_850mb_threshold,
71  // centered on a window of vorticty_850mb_window degrees
72  // 2) a local minimum in pressure within max_core_radius degrees
73  // 3) having max pressure delta within max_pressure_radius at
74  // that location
75  TECA_ALGORITHM_PROPERTY(double, max_core_radius)
76  TECA_ALGORITHM_PROPERTY(double, min_vorticity_850mb)
77  TECA_ALGORITHM_PROPERTY(double, vorticity_850mb_window)
78  TECA_ALGORITHM_PROPERTY(double, max_pressure_delta)
79  TECA_ALGORITHM_PROPERTY(double, max_pressure_radius)
80 
81  // these criteria are recorded here but only used in the trajectory
82  // stitching stage.
83  TECA_ALGORITHM_PROPERTY(double, max_core_temperature_delta)
84  TECA_ALGORITHM_PROPERTY(double, max_core_temperature_radius)
85  TECA_ALGORITHM_PROPERTY(double, max_thickness_delta)
86  TECA_ALGORITHM_PROPERTY(double, max_thickness_radius)
87 
88  // set/get the bounding box to search for storms
89  // in units of degrees lat,lon
90  TECA_ALGORITHM_PROPERTY(double, search_lat_low)
91  TECA_ALGORITHM_PROPERTY(double, search_lat_high)
92  TECA_ALGORITHM_PROPERTY(double, search_lon_low)
93  TECA_ALGORITHM_PROPERTY(double, search_lon_high)
94 
95  // set/get the number of iterations to search for the
96  // storm local minimum. raising this parameter might increase
97  // detections but the detector will run slower. default is
98  // 50.
99  TECA_ALGORITHM_PROPERTY(int, minimizer_iterations)
100 
101  // send human readable representation to the
102  // stream
103  virtual void to_stream(std::ostream &os) const override;
104 
105 protected:
107 
108  // helper that computes the output extent
109  int get_active_extent(
112  std::vector<unsigned long> &extent) const;
113 
114 private:
115  virtual
116  teca_metadata get_output_metadata(
117  unsigned int port,
118  const std::vector<teca_metadata> &input_md) override;
119 
120  virtual
121  std::vector<teca_metadata> get_upstream_request(
122  unsigned int port,
123  const std::vector<teca_metadata> &input_md,
124  const teca_metadata &request) override;
125 
126  virtual
127  const_p_teca_dataset execute(
128  unsigned int port,
129  const std::vector<const_p_teca_dataset> &input_data,
130  const teca_metadata &request) override;
131 
132 private:
133  std::string surface_wind_speed_variable;
134  std::string vorticity_850mb_variable;
135  std::string sea_level_pressure_variable;
136  std::string core_temperature_variable;
137  std::string thickness_variable;
138 
139  double max_core_radius;
140  double min_vorticity_850mb;
141  double vorticity_850mb_window;
142  double max_pressure_delta;
143  double max_pressure_radius;
144  double max_core_temperature_delta;
145  double max_core_temperature_radius;
146  double max_thickness_delta;
147  double max_thickness_radius;
148 
149  double search_lat_low;
150  double search_lat_high;
151  double search_lon_low;
152  double search_lon_high;
153 
154  int minimizer_iterations;
155 };
156 
157 #endif
teca_metadata
A generic container for meta data in the form of name=value pairs.
Definition: teca_metadata.h:18
teca_shared_object.h
p_teca_variant_array
std::shared_ptr< teca_variant_array > p_teca_variant_array
Definition: teca_variant_array.h:22
teca_tc_candidates
GFDL tropical storms detection algorithm.
Definition: teca_tc_candidates.h:49
teca_algorithm
The interface to TECA pipeline architecture.
Definition: teca_algorithm.h:237