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 "teca_config.h"
7 
8 #include <vector>
9 #include <string>
10 
11 /// Codes for dealing with geography
12 namespace teca_geography
13 {
14 /** get the number of cyclone basins. cyclone basin ids are
15  * in the range 0 to number of basins - 1.
16 */
19 
20 /**
21  * get the unique list of names describing available cyclone basins.
22  * the list can be indexed by the ids returned by the
23  * get_cyclone_basin/s functions.
24 */
26 void get_cyclone_basin_names(std::vector<std::string> &names,
27  std::vector<std::string> &long_names);
28 
29 /** load polygons describing the cyclone basins used by TECA
30  *
31  * upon return:
32  *
33  * sizes array has been appended with the size of each basin
34  * starts array has been appended with the starting index of
35  * each basin's coordinates
36  * x/y_coordinates have been appended with the coordinates
37  * ids array has been appended with the basin id
38  *
39  * some basins are comprised of multiple polygons because
40  * they split over the periodic boundary. hence the ids array
41  * is used to identify a basin.
42 */
44 void get_cyclone_basins(std::vector<unsigned long> &sizes,
45  std::vector<unsigned long> &starts, std::vector<double> &x_coordinates,
46  std::vector<double> &y_coordinates, std::vector<int> &ids,
47  std::vector<std::string> &names, std::vector<std::string> &long_names);
48 
49 /** load a cyclone basin by name. Either the short or long name
50  * can be used. see get_cyclone_basin_names.
51 */
53 int get_cyclone_basin(const std::string &rname,
54  std::vector<unsigned long> &sizes, std::vector<unsigned long> &starts,
55  std::vector<double> &x_coordinates, std::vector<double> &y_coordinates,
56  std::vector<int> &ids, std::vector<std::string> &names,
57  std::vector<std::string> &long_names);
58 
59 /** load a cyclone basin by it's region id. region ids must be in the range
60  * of 0 to get_number_of_cyclone_basins() - 1.
61 */
63 int get_cyclone_basin(unsigned int rid,
64  std::vector<unsigned long> &sizes, std::vector<unsigned long> &starts,
65  std::vector<double> &x_coordinates, std::vector<double> &y_coordinates,
66  std::vector<int> &ids, std::vector<std::string> &names,
67  std::vector<std::string> &long_names);
68 };
69 
70 #endif
p_teca_error_handler error_handler TECA_EXPORT
The global error handler instance.
Codes for dealing with geography.
Definition: teca_geography.h:13
TECA_EXPORT 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_EXPORT 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_EXPORT void get_cyclone_basin_names(std::vector< std::string > &names, std::vector< std::string > &long_names)
TECA_EXPORT unsigned long get_number_of_cyclone_basins()