WSL/SLF GitLab Repository

Commit 7f97c133 authored by Thomas Egger's avatar Thomas Egger
Browse files

IOManager: Removed unnecessary consistency check in IOManager::interpolate(),...

IOManager: Removed unnecessary consistency check in IOManager::interpolate(), the grid can only have the same size as the DEM anyway. Expanded the arguments of the interpolate() procedure to allow the user to pass a reference to a string, that will hold some info about the interpolation used. 
parent 0b6fde06
......@@ -279,6 +279,7 @@ void IOManager::interpolate(const Date& date, const DEMObject& dem, const MeteoD
cout << "[i] Interpolating " << MeteoData::getParameterName(meteoparam);
cout << " (" << info_string << ") " << endl;
}
#ifdef _POPC_ //HACK popc
void IOManager::interpolate(/*const*/ Date& date, /*const*/ DEMObject& dem, /*const*/ MeteoData::Parameters& meteoparam,
/*const*/ std::vector<Coords>& in_coords, std::vector<double>& result)
......@@ -286,6 +287,19 @@ void IOManager::interpolate(/*const*/ Date& date, /*const*/ DEMObject& dem, /*co
void IOManager::interpolate(const Date& date, const DEMObject& dem, const MeteoData::Parameters& meteoparam,
const std::vector<Coords>& in_coords, std::vector<double>& result)
#endif
{
string info_string;
interpolate(date, dem, meteoparam, in_coords, result, info_string);
}
#ifdef _POPC_ //HACK popc
void IOManager::interpolate(/*const*/ Date& date, /*const*/ DEMObject& dem, /*const*/ MeteoData::Parameters& meteoparam,
/*const*/ std::vector<Coords>& in_coords, std::vector<double>& result,
std::string& info_string)
#else
void IOManager::interpolate(const Date& date, const DEMObject& dem, const MeteoData::Parameters& meteoparam,
const std::vector<Coords>& in_coords, std::vector<double>& result, std::string& info_string)
#endif
{
result.clear();
......@@ -308,7 +322,6 @@ void IOManager::interpolate(const Date& date, const DEMObject& dem, const MeteoD
one_point_dem.max_curvature = dem.max_curvature;
Grid2DObject result_grid;
string info_string;
interpolator.interpolate(date, one_point_dem, meteoparam, result_grid, info_string);
if (ii == 0) {
cout << "[i] Interpolating " << MeteoData::getParameterName(meteoparam)
......@@ -316,14 +329,7 @@ void IOManager::interpolate(const Date& date, const DEMObject& dem, const MeteoD
<< " (" << info_string << ") " << endl;
}
unsigned int result_x, result_y;
result_grid.size(result_x, result_y);
if ((result_x == result_y) && (result_x == 1)) { //Consistency check, maybe unnecessary
result.push_back(result_grid.grid2D(0,0));
} else {
throw IOException("Error while trying to interpolate for one coordinate", AT);
}
result.push_back(result_grid.grid2D(0,0));
}
}
......
......@@ -131,10 +131,19 @@ class IOManager {
#ifdef _POPC_ //HACK popc
void interpolate(/*const*/ Date& date, /*const*/ DEMObject& dem, /*const*/ MeteoData::Parameters& meteoparam,
/*const*/ std::vector<Coords>& in_coords, std::vector<double>& result);
/*const*/ std::vector<Coords>& in_coords, std::vector<double>& result);
#else
void interpolate(const Date& date, const DEMObject& dem, const MeteoData::Parameters& meteoparam,
const std::vector<Coords>& in_coords, std::vector<double>& result);
const std::vector<Coords>& in_coords, std::vector<double>& result);
#endif
#ifdef _POPC_ //HACK popc
void interpolate(/*const*/ Date& date, /*const*/ DEMObject& dem, /*const*/ MeteoData::Parameters& meteoparam,
/*const*/ std::vector<Coords>& in_coords, std::vector<double>& result,
std::string& info_string);
#else
void interpolate(const Date& date, const DEMObject& dem, const MeteoData::Parameters& meteoparam,
const std::vector<Coords>& in_coords, std::vector<double>& result, std::string& info_string);
#endif
/**
......
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