TECA
teca_tc_classify.h
1 #ifndef teca_tc_classify_h
2 #define teca_tc_classify_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_classify)
12 
13 
23 {
24 public:
25  TECA_ALGORITHM_STATIC_NEW(teca_tc_classify)
26  TECA_ALGORITHM_DELETE_COPY_ASSIGN(teca_tc_classify)
27  TECA_ALGORITHM_CLASS_NAME(teca_tc_classify)
29 
30  // report/initialize to/from Boost program options
31  // objects.
32  TECA_GET_ALGORITHM_PROPERTIES_DESCRIPTION()
33  TECA_SET_ALGORITHM_PROPERTIES()
34 
35  // set the name pf the column containing track id.
36  // default is "track_id"
37  TECA_ALGORITHM_PROPERTY(std::string, track_id_column)
38 
39  // set the name of the column containing the time
40  // axis. default is "time"
41  TECA_ALGORITHM_PROPERTY(std::string, time_column)
42 
43  // set the name of the column containing surface wind speed
44  // for Saphire-Simpson scale. default is "surface_wind"
45  TECA_ALGORITHM_PROPERTY(std::string, surface_wind_column)
46 
47  // set the name of the column containing sea level pressure
48  // default is "sea_level_pressure"
49  TECA_ALGORITHM_PROPERTY(std::string, sea_level_pressure_column)
50 
51  // set the name of the columns to use as coordinates
52  // defaults are "lon" and "lat"
53  TECA_ALGORITHM_PROPERTY(std::string, x_coordinate_column)
54  TECA_ALGORITHM_PROPERTY(std::string, y_coordinate_column)
55 
56  // the following group of properties define a set of
57  // polygons describing arbitrary regions to count
58  // storms by. note: must explicitly include end point.
59  TECA_ALGORITHM_VECTOR_PROPERTY(unsigned long, region_size)
60  TECA_ALGORITHM_VECTOR_PROPERTY(unsigned long, region_start);
61  TECA_ALGORITHM_VECTOR_PROPERTY(double, region_x_coordinate);
62  TECA_ALGORITHM_VECTOR_PROPERTY(double, region_y_coordinate);
63  TECA_ALGORITHM_VECTOR_PROPERTY(int, region_id);
64  TECA_ALGORITHM_VECTOR_PROPERTY(std::string, region_name);
65  TECA_ALGORITHM_VECTOR_PROPERTY(std::string, region_long_name);
66 
67 protected:
69 
70 private:
71  const_p_teca_dataset execute(unsigned int port,
72  const std::vector<const_p_teca_dataset> &input_data,
73  const teca_metadata &request) override;
74 
75 private:
76  std::string track_id_column;
77  std::string time_column;
78  std::string x_coordinate_column;
79  std::string y_coordinate_column;
80  std::string surface_wind_column;
81  std::string sea_level_pressure_column;
82 
83  std::vector<unsigned long> region_sizes;
84  std::vector<unsigned long> region_starts;
85  std::vector<double> region_x_coordinates;
86  std::vector<double> region_y_coordinates;
87  std::vector<int> region_ids;
88  std::vector<std::string> region_names;
89  std::vector<std::string> region_long_names;
90 };
91 
92 #endif
teca_metadata
Definition: teca_metadata.h:17
teca_tc_classify
an algorithm that classifies storms using Saphire-Simpson scale
Definition: teca_tc_classify.h:23
teca_algorithm
Definition: teca_algorithm.h:25