WSL/SLF GitLab Repository

Commit a6a170da authored by Mathias Bavay's avatar Mathias Bavay
Browse files

Improved the error message when subseting an array. Fixed documentation warnings.

parent 5c4cbda9
......@@ -298,7 +298,7 @@ template<class T> void Array2D<T>::subset(const Array2D<T>& i_array2D, const siz
{
if (((i_nx+i_ncols) > i_array2D.nx) || ((i_ny+i_nrows) > i_array2D.ny)) {
std::stringstream ss;
ss << "Trying to cut an array of size (" << nx << "," << ny << ") ";
ss << "Trying to cut an array of size (" << i_array2D.nx << "," << i_array2D.ny << ") ";
ss << "to size (" << i_ncols << "," << i_nrows << ") starting at (" << i_nx << "," << i_ny << ")";
throw IndexOutOfBoundsException(ss.str(), AT);
}
......
......@@ -325,7 +325,7 @@ template<class T> void Array3D<T>::subset(const Array3D<T>& i_array3D,
if (((i_nx+i_ncols) > i_array3D.nx) || ((i_ny+i_nrows) > i_array3D.ny) || ((i_nz+i_ndepth) > i_array3D.nz)) {
std::ostringstream ss;
ss << "Trying to cut an array of size (" << nx << "," << ny << "," << nz << ") ";
ss << "Trying to cut an array of size (" << i_array3D.nx << "," << i_array3D.ny << "," << i_array3D.nz << ") ";
ss << "to size (" << i_ncols << "," << i_nrows << "," << i_ndepth << ") ";
ss << "starting at (" << i_nx << "," << i_ny << "," << i_nz << ")";
throw IndexOutOfBoundsException(ss.str(), AT);
......
......@@ -267,7 +267,7 @@ template<class T> void Array4D<T>::subset(const Array4D<T>& i_array4D,
if (((i_nw+i_sizeW) > i_array4D.nw) || ((i_nx+i_sizeX) > i_array4D.nx) || ((i_ny+i_sizeY) > i_array4D.ny) || ((i_nz+i_sizeZ) > i_array4D.nz)) {
std::stringstream ss;
ss << "Trying to cut an array of size ("<< nw << "," << nx << "," << ny << "," << nz << ") ";
ss << "Trying to cut an array of size ("<< i_array4D.nw << "," << i_array4D.nx << "," << i_array4D.ny << "," << i_array4D.nz << ") ";
ss << "to size (" << i_sizeW << "," << i_sizeX << "," << i_sizeY << "," << i_sizeZ << ") ";
ss << "starting at ("<< i_nw << "," << i_nx << "," << i_ny << "," << i_nz << ")";
throw IndexOutOfBoundsException(ss.str(), AT);
......
......@@ -248,7 +248,10 @@ void CoordsAlgorithms::trueLatLonToRotated(const double& lat_N, const double& lo
}
/**
* @brief returns the epsg code of the current projection
* @brief returns the epsg code matching a provided string representation
* For example, when given "CH1903" with empty coordparam, it will return "21781"
* @param[in] coordsystem string representation of the coordinate system
* @param[in] coordparam string representation of the optional coordinate system parameters (such as zone for utm, etc)
* @return epsg code
*/
short int CoordsAlgorithms::str_to_EPSG(const std::string& coordsystem, const std::string& coordparam)
......@@ -293,8 +296,10 @@ short int CoordsAlgorithms::str_to_EPSG(const std::string& coordsystem, const st
}
/**
* @brief set the current projection to a given EPSG-defined projection
* @param epsg epsg code
* @brief Build the string representation for a given EPSG code
* @param[in] epsg epsg code
* @param[out] coordsystem string representation of the coordinate system
*@param[out] coordparam string representation of the optional coordinate system parameters (such as zone for utm, etc)
*/
void CoordsAlgorithms::EPSG_to_str(const int& epsg, std::string& coordsystem, std::string& coordparam)
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment