Enumerations | |
| enum | ProcessingLevel { raw = 1, filtered = 1 << 1, resampled = 1 << 2, generated = 1 << 3, num_of_levels = 1 << 4 } |
| enum | ThrowOptions { dothrow, nothrow } |
Functions | |
| double | bearing_to_angle (const double &bearing) |
| Converts a compass bearing to a trigonometric angle. More... | |
| double | angle_to_bearing (const double &angle) |
| Converts a trigonometric angle to a compass bearing. More... | |
| double | bearing (std::string bearing_str) |
| Converts a string bearing to a compass bearing. More... | |
| std::string | bearing (double bearing) |
| Converts a compass bearing to a string bearing. More... | |
| void | stripComments (std::string &str) |
| void | trim (std::string &s) |
| Removes trailing and leading whitespaces, tabs and newlines from a string. More... | |
| void | toUpper (std::string &str) |
| void | toLower (std::string &str) |
| std::string | strToUpper (std::string str) |
| std::string | strToLower (std::string str) |
| bool | isNumeric (std::string str, const unsigned int &nBase) |
| bool | readKeyValuePair (const std::string &in_line, const std::string &delimiter, std::string &key, std::string &value, const bool &setToUpperCase=false) |
| read a string line, parse it and save it into a map object, that is passed by reference More... | |
| std::string | getLogName () |
| Retrieve the user name This checks various environment variables (USERNAME, USER, LOGNAME). More... | |
| std::string | getHostName () |
| Retrieve the name of the computer running the binary. More... | |
| size_t | readLineToVec (const std::string &line_in, std::vector< double > &vec_data) |
| size_t | readLineToVec (const std::string &line_in, std::vector< std::string > &vecString) |
| size_t | readLineToVec (const std::string &line_in, std::vector< std::string > &vecString, const char &delim) |
| template<> | |
| bool | convertString< std::string > (std::string &t, const std::string &str, std::ios_base &(*f)(std::ios_base &)) |
| template<> | |
| bool | convertString< bool > (bool &t, const std::string &str, std::ios_base &(*f)(std::ios_base &)) |
| template<> | |
| bool | convertString< double > (double &t, const std::string &str, std::ios_base &(*f)(std::ios_base &)) |
| template<> | |
| bool | convertString< unsigned int > (unsigned int &t, const std::string &str, std::ios_base &(*f)(std::ios_base &)) |
| bool | convertString (Date &t, const std::string &str, const double &time_zone, std::ios_base &(*f)(std::ios_base &)) |
| template<> | |
| bool | convertString< Coords > (Coords &t, const std::string &str, std::ios_base &(*f)(std::ios_base &)) |
| void | getProjectionParameters (const Config &cfg, std::string &coordin, std::string &coordinparam, std::string &coordout, std::string &coordoutparam) |
| A function that parses a Config object for COORSYS, COORDPARAM keywords in [Input] and [Output] section and sets the respective strings to the values of those keywords. More... | |
| void | getTimeZoneParameters (const Config &cfg, double &tz_in, double &tz_out) |
| A function that parses a Config object for the time_zone keyword and returns the timezone. More... | |
| size_t | seek (const Date &soughtdate, const std::vector< MeteoData > &vecM, const bool &exactmatch=true) |
| Search for an element at a given date in a vector of MeteoData. The position of the matching date is returned or IOUtils::npos if not found. If exactmatch=false, the position of the first element after soughtdate is returned (or IOUtils::npos if this is not possible / relevant). More... | |
| void | getArraySliceParams (const size_t &dimx, const size_t &nbworkers, const size_t &wk, size_t &startx, size_t &nx) |
| Returns the parameters for splitting an array in several, balanced sub-arrays. This is mostly usefull for parallel calculations, where an array will be split and sent to different workers. More... | |
| double | unitsPrefix (const char &prefix) |
| Convert a textual representation of a unit prefix (like 'm' or 'G') to multiplying factor. More... | |
| double | unitsConversion (const double &val, std::string unitIn, std::string unitOut) |
| Performs simple unit conversion (supports temperature, prefixes and exponents) NOTE "composite" units such as 'K/m' or 'N/m2' are currently NOT supported. More... | |
| double | C_TO_K (const double &T) |
| double | K_TO_C (const double &T) |
| bool | checkEpsilonEquality (const double &val1, const double &val2, const double &epsilon) |
| Check whether two values are equal regarding a certain epsilon environment (within certain radius of each other) More... | |
| template<class T > | |
| bool | convertString (T &t, const std::string &str, std::ios_base &(*f)(std::ios_base &)=std::dec) |
| Convert a string to the requested type (template function). More... | |
| template<class T > | |
| void | getValueForKey (const std::map< std::string, std::string > &properties, const std::string &key, T &t, const ThrowOptions &options=IOUtils::dothrow) |
| Returns, with the requested type, the value associated to a key (template function). More... | |
| template<class T > | |
| void | getValueForKey (const std::map< std::string, std::string > &properties, const std::string &key, std::vector< T > &vecT, const ThrowOptions &options=IOUtils::dothrow) |
| Returns, with the requested type, the value associated to a key (template function). More... | |
| template<class T > | |
| T | standardizeNodata (const T &value, const double &plugin_nodata) |
| Standardize a given value to use MeteoIO's internal nodata value (if applicable) More... | |
Variables | |
| const char | ALPHANUM [] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" |
| const char | NUM [] = "0123456789" |
| const double | nodata = -999.0 |
| This is the internal nodata value. More... | |
| const unsigned int | unodata = static_cast<unsigned int>(-1) |
| const int | inodata = -999 |
| const short int | snodata = -999 |
| const size_t | npos = static_cast<size_t>(-1) |
| npos is the out-of-range value More... | |
| const double | grid_epsilon = 5. |
| What is an acceptable small distance on a grid, in meters. More... | |
| const double | lon_epsilon = grid_epsilon / Cst::earth_R0 * Cst::to_deg |
| in degrees. Small angle for longitudes, so sin(x)=x More... | |
| const double | lat_epsilon = lon_epsilon |
| in degrees. Small angle for latitudes. More... | |
| double mio::IOUtils::angle_to_bearing | ( | const double & | angle | ) |
Converts a trigonometric angle to a compass bearing.
| angle | trigonometric angle (0° on the right, counterclockwise, in [0, 2PI[) |
| double mio::IOUtils::bearing | ( | std::string | bearing_str | ) |
Converts a string bearing to a compass bearing.
| bearing_str | as N, NE, SSW, etc |
| std::string mio::IOUtils::bearing | ( | double | bearing | ) |
Converts a compass bearing to a string bearing.
| bearing | (0° on top, clockwise, in [0°, 360°[) |
| double mio::IOUtils::bearing_to_angle | ( | const double & | bearing | ) |
Converts a compass bearing to a trigonometric angle.
| bearing | compass bearing (0° on top, clockwise, in [0°, 360°[) |
|
inline |
|
inline |
Check whether two values are equal regarding a certain epsilon environment (within certain radius of each other)
| val1 | |
| val2 | |
| epsilon | is a radius around val1 |
| bool mio::IOUtils::convertString | ( | T & | t, |
| const std::string & | str, | ||
| std::ios_base &(*)(std::ios_base &) | f = std::dec |
||
| ) |
Convert a string to the requested type (template function).
| T | [in] The type wanted for the return value (template type parameter). |
| t | [out] The value converted to the requested type. |
| str | [in] The input string to convert; trailling whitespaces are ignored, comment after non-string values are allowed, but multiple values are not allowed. |
| f | [in] The radix for reading numbers, such as std::dec or std::oct; default is std::dec. |
| bool mio::IOUtils::convertString | ( | Date & | t, |
| const std::string & | str, | ||
| const double & | time_zone, | ||
| std::ios_base &(*)(std::ios_base &) | f | ||
| ) |
| bool mio::IOUtils::convertString< bool > | ( | bool & | t, |
| const std::string & | str, | ||
| std::ios_base &(*)(std::ios_base &) | f | ||
| ) |
| bool mio::IOUtils::convertString< Coords > | ( | Coords & | t, |
| const std::string & | str, | ||
| std::ios_base &(*)(std::ios_base &) | f | ||
| ) |
| bool mio::IOUtils::convertString< double > | ( | double & | t, |
| const std::string & | str, | ||
| std::ios_base &(*)(std::ios_base &) | f | ||
| ) |
| bool mio::IOUtils::convertString< std::string > | ( | std::string & | t, |
| const std::string & | str, | ||
| std::ios_base &(*)(std::ios_base &) | f | ||
| ) |
| bool mio::IOUtils::convertString< unsigned int > | ( | unsigned int & | t, |
| const std::string & | str, | ||
| std::ios_base &(*)(std::ios_base &) | f | ||
| ) |
| void mio::IOUtils::getArraySliceParams | ( | const size_t & | dimx, |
| const size_t & | nbworkers, | ||
| const size_t & | wk, | ||
| size_t & | startx, | ||
| size_t & | nx | ||
| ) |
Returns the parameters for splitting an array in several, balanced sub-arrays. This is mostly usefull for parallel calculations, where an array will be split and sent to different workers.
| [in] | dimx | number of cells in the desired dimension |
| [in] | nbworkers | total number of slices |
| [in] | wk | current slice index (starting at 1) |
| [out] | startx | calculated start index for the current slice |
| [out] | nx | calculated number of cells (in the desired dimension) of the current slice |
| std::string mio::IOUtils::getHostName | ( | ) |
Retrieve the name of the computer running the binary.
| std::string mio::IOUtils::getLogName | ( | ) |
Retrieve the user name This checks various environment variables (USERNAME, USER, LOGNAME).
| void mio::IOUtils::getProjectionParameters | ( | const Config & | cfg, |
| std::string & | coordin, | ||
| std::string & | coordinparam, | ||
| std::string & | coordout, | ||
| std::string & | coordoutparam | ||
| ) |
A function that parses a Config object for COORSYS, COORDPARAM keywords in [Input] and [Output] section and sets the respective strings to the values of those keywords.
| [in] | cfg | A Config object |
| [out] | coordin | The coordinate system to be used for input data |
| [out] | coordinparam | The coordinate system parameters to be used for output data |
| [out] | coordout | The coordinate system to be used for output data |
| [out] | coordoutparam | The coordinate system parameters to be used for output data |
| void mio::IOUtils::getTimeZoneParameters | ( | const Config & | cfg, |
| double & | tz_in, | ||
| double & | tz_out | ||
| ) |
| void mio::IOUtils::getValueForKey | ( | const std::map< std::string, std::string > & | properties, |
| const std::string & | key, | ||
| T & | t, | ||
| const ThrowOptions & | options = IOUtils::dothrow |
||
| ) |
Returns, with the requested type, the value associated to a key (template function).
| T | [in] The type wanted for the return value (template type parameter). |
| [in] | properties | A map containing all the parameters. |
| [in] | key | The key of the parameter to retrieve. |
| [out] | t | The value associated to the key, converted to the requested type |
| [in] | options | Extra options, by default IOUtils::dothrow |
| void mio::IOUtils::getValueForKey | ( | const std::map< std::string, std::string > & | properties, |
| const std::string & | key, | ||
| std::vector< T > & | vecT, | ||
| const ThrowOptions & | options = IOUtils::dothrow |
||
| ) |
Returns, with the requested type, the value associated to a key (template function).
| T | [in] The type wanted for the return value (template type parameter). |
| [in] | properties | A map containing all the parameters. |
| [in] | key | The key of the parameter to retrieve. |
| [out] | vecT | The vector of values associated to the key, each value is converted to the requested type |
| [in] | options | Extra options, by default IOUtils::dothrow |
| bool mio::IOUtils::isNumeric | ( | std::string | str, |
| const unsigned int & | nBase | ||
| ) |
|
inline |
| bool mio::IOUtils::readKeyValuePair | ( | const std::string & | in_line, |
| const std::string & | delimiter, | ||
| std::string & | key, | ||
| std::string & | value, | ||
| const bool & | setToUpperCase = false |
||
| ) |
read a string line, parse it and save it into a map object, that is passed by reference
| in_line | (const string&) string to parse |
| delimiter | (const string&) delimiter to use for the parsing |
| setToUpperCase | If set to true the key will be put into upper case (for case insensitivity) |
| key | retrieved key |
| value | retrieved value |
| size_t mio::IOUtils::readLineToVec | ( | const std::string & | line_in, |
| std::vector< double > & | vec_data | ||
| ) |
| size_t mio::IOUtils::readLineToVec | ( | const std::string & | line_in, |
| std::vector< std::string > & | vecString | ||
| ) |
| size_t mio::IOUtils::readLineToVec | ( | const std::string & | line_in, |
| std::vector< std::string > & | vecString, | ||
| const char & | delim | ||
| ) |
| size_t mio::IOUtils::seek | ( | const Date & | soughtdate, |
| const std::vector< MeteoData > & | vecM, | ||
| const bool & | exactmatch = true |
||
| ) |
Search for an element at a given date in a vector of MeteoData. The position of the matching date is returned or IOUtils::npos if not found. If exactmatch=false, the position of the first element after soughtdate is returned (or IOUtils::npos if this is not possible / relevant).
| [in] | soughtdate | date that should be found |
| [in] | vecM | vector that should contain the data |
| [in] | exactmatch | if the exact requested date is not found, return npos |
| T mio::IOUtils::standardizeNodata | ( | const T & | value, |
| const double & | plugin_nodata | ||
| ) |
Standardize a given value to use MeteoIO's internal nodata value (if applicable)
| T[in] | The type wanted for the return value (template type parameter). |
| [in] | value | the value to check/convert |
| [in] | plugin_nodata | plugin-specific nodata value |
| void mio::IOUtils::stripComments | ( | std::string & | str | ) |
| std::string mio::IOUtils::strToLower | ( | std::string | str | ) |
| std::string mio::IOUtils::strToUpper | ( | std::string | str | ) |
| void mio::IOUtils::toLower | ( | std::string & | str | ) |
| void mio::IOUtils::toUpper | ( | std::string & | str | ) |
| void mio::IOUtils::trim | ( | std::string & | s | ) |
Removes trailing and leading whitespaces, tabs and newlines from a string.
| s | The reference of the string to trim (in/out parameter) |
| double mio::IOUtils::unitsConversion | ( | const double & | val, |
| std::string | unitIn, | ||
| std::string | unitOut | ||
| ) |
Performs simple unit conversion (supports temperature, prefixes and exponents) NOTE "composite" units such as 'K/m' or 'N/m2' are currently NOT supported.
| val | value to convert |
| unitIn | units of the input |
| unitOut | units to convert to return value, expressed in unitOut |
| double mio::IOUtils::unitsPrefix | ( | const char & | prefix | ) |
Convert a textual representation of a unit prefix (like 'm' or 'G') to multiplying factor.
| prefix | unit prefix return multiplying factor |
| const char mio::IOUtils::ALPHANUM[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" |
| const double mio::IOUtils::grid_epsilon = 5. |
What is an acceptable small distance on a grid, in meters.
| const int mio::IOUtils::inodata = -999 |
| const double mio::IOUtils::lat_epsilon = lon_epsilon |
in degrees. Small angle for latitudes.
| const double mio::IOUtils::lon_epsilon = grid_epsilon / Cst::earth_R0 * Cst::to_deg |
in degrees. Small angle for longitudes, so sin(x)=x
| const double mio::IOUtils::nodata = -999.0 |
This is the internal nodata value.
| const size_t mio::IOUtils::npos = static_cast<size_t>(-1) |
npos is the out-of-range value
| const char mio::IOUtils::NUM[] = "0123456789" |
| const short int mio::IOUtils::snodata = -999 |
| const unsigned int mio::IOUtils::unodata = static_cast<unsigned int>(-1) |