TECA
The Toolkit for Extreme Climate Analysis
teca_geography.h
Go to the documentation of this file.
1 #ifndef teca_geography_h
2 #define teca_geography_h
3 
4 /// @file
5 
6 #include <vector>
7 #include <string>
8 
9 /// Codes for dealing with geography
10 namespace teca_geography
11 {
12 /** get the number of cyclone basins. cyclone basin ids are
13  * in the range 0 to number of basins - 1.
14 */
15 unsigned long get_number_of_cyclone_basins();
16 
17 /**
18  * get the unique list of names describing available cyclone basins.
19  * the list can be indexed by the ids returned by the
20  * get_cyclone_basin/s functions.
21 */
22 void get_cyclone_basin_names(std::vector<std::string> &names,
23  std::vector<std::string> &long_names);
24 
25 /** load polygons describing the cyclone basins used by TECA
26  *
27  * upon return:
28  *
29  * sizes array has been appended with the size of each basin
30  * starts array has been appended with the starting index of
31  * each basin's coordinates
32  * x/y_coordinates have been appended with the coordinates
33  * ids array has been appended with the basin id
34  *
35  * some basins are comprised of multiple polygons because
36  * they split over the periodic boundary. hence the ids array
37  * is used to identify a basin.
38 */
39 void get_cyclone_basins(std::vector<unsigned long> &sizes,
40  std::vector<unsigned long> &starts, std::vector<double> &x_coordinates,
41  std::vector<double> &y_coordinates, std::vector<int> &ids,
42  std::vector<std::string> &names, std::vector<std::string> &long_names);
43 
44 /** load a cyclone basin by name. Either the short or long name
45  * can be used. see get_cyclone_basin_names.
46 */
47 int get_cyclone_basin(const std::string &rname,
48  std::vector<unsigned long> &sizes, std::vector<unsigned long> &starts,
49  std::vector<double> &x_coordinates, std::vector<double> &y_coordinates,
50  std::vector<int> &ids, std::vector<std::string> &names,
51  std::vector<std::string> &long_names);
52 
53 /** load a cyclone basin by it's region id. region ids must be in the range
54  * of 0 to get_number_of_cyclone_basins() - 1.
55 */
56 int get_cyclone_basin(unsigned int rid,
57  std::vector<unsigned long> &sizes, std::vector<unsigned long> &starts,
58  std::vector<double> &x_coordinates, std::vector<double> &y_coordinates,
59  std::vector<int> &ids, std::vector<std::string> &names,
60  std::vector<std::string> &long_names);
61 };
62 
63 #endif
teca_geography::get_cyclone_basins
void get_cyclone_basins(std::vector< unsigned long > &sizes, std::vector< unsigned long > &starts, std::vector< double > &x_coordinates, std::vector< double > &y_coordinates, std::vector< int > &ids, std::vector< std::string > &names, std::vector< std::string > &long_names)
teca_geography
Codes for dealing with geography.
Definition: teca_geography.h:10
teca_geography::get_cyclone_basin
int get_cyclone_basin(const std::string &rname, std::vector< unsigned long > &sizes, std::vector< unsigned long > &starts, std::vector< double > &x_coordinates, std::vector< double > &y_coordinates, std::vector< int > &ids, std::vector< std::string > &names, std::vector< std::string > &long_names)
teca_geography::get_cyclone_basin_names
void get_cyclone_basin_names(std::vector< std::string > &names, std::vector< std::string > &long_names)
teca_geography::get_number_of_cyclone_basins
unsigned long get_number_of_cyclone_basins()