WSL/SLF GitLab Repository

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

Removing some "HACKS" tags

parent 29a18c18
......@@ -584,7 +584,6 @@ bool convertString(Date& t, const std::string& str, const double& time_zone, std
double second;
char rest[32] = "";
//HACK: we read the seconds, but we ignore them...
const char *c_str = s.c_str();
if (sscanf(c_str, "%d-%u-%u %u:%u:%lg%31s", &year, &month, &day, &hour, &minute, &second, rest) >= 6) {
std::string timezone_iso(rest);
......
......@@ -370,7 +370,7 @@ void LocalIDWLapseAlgorithm::calculate(const DEMObject& /*dem*/, Grid2DObject& /
}
double r2=0.;
Interpol2D::LocalLapseIDW(vecData, vecMeta, dem, nrOfNeighbors, grid, r2); //HACK
Interpol2D::LocalLapseIDW(vecData, vecMeta, dem, nrOfNeighbors, grid, r2);
info << "r^2=" << Optim::pow2( r2 );*/
}
......@@ -615,7 +615,7 @@ void SnowHNWInterpolation::calculate(const DEMObject& dem, Grid2DObject& grid)
//initialize precipitation grid with user supplied algorithm (IDW_LAPSE by default)
IOUtils::toUpper(base_algo);
vector<string> vecArgs2;
mi.getArgumentsForAlgorithm(MeteoData::getParameterName(param), base_algo, vecArgs2); //HACK
mi.getArgumentsForAlgorithm(MeteoData::getParameterName(param), base_algo, vecArgs2);
auto_ptr<InterpolationAlgorithm> algorithm(AlgorithmFactory::getAlgorithm(base_algo, mi, vecArgs2, iomanager));
algorithm->getQualityRating(date, param);
algorithm->calculate(dem, grid);
......
......@@ -280,7 +280,7 @@ double Interpol2D::LLIDW_pixel(const unsigned int& i, const unsigned int& j,
const double alt = vecStations_in[st_index].position.getAltitude();
if ((value != IOUtils::nodata) && (alt != IOUtils::nodata)) {
//const double contrib = LinProject(value, alt, cell_altitude, coeffs);
//const double contrib = BiLinProject(value, alt, cell_altitude, coeffs); //HACK
//const double contrib = BiLinProject(value, alt, cell_altitude, coeffs);
const double weight = Optim::invSqrt( list[st].first + scale + 1.e-6 );
//pixel_value += weight*contrib;
norm += weight;
......
......@@ -218,7 +218,6 @@ void A3DIO::read1DStation(StationData& sd)
IOUtils::getValueForKey(header, "Y_Coord", ycoord);
IOUtils::getValueForKey(header, "Altitude", altitude);
//HACK!! would it be possible for getValueForKey() to do this transparently? (with a user flag)
latitude = IOUtils::standardizeNodata(latitude, plugin_nodata);
longitude = IOUtils::standardizeNodata(longitude, plugin_nodata);
altitude = IOUtils::standardizeNodata(altitude, plugin_nodata);
......
......@@ -197,7 +197,6 @@ void ARCIO::read2DGrid_internal(Grid2DObject& grid_out, const std::string& full_
IOUtils::getValueForKey(header, "cellsize", cellsize);
IOUtils::getValueForKey(header, "NODATA_value", plugin_nodata);
//HACK!! would it be possible for getValueForKey() to do this transparently? (with a user flag)
i_ncols = IOUtils::standardizeNodata(i_ncols, plugin_nodata);
i_nrows = IOUtils::standardizeNodata(i_nrows, plugin_nodata);
xllcorner = IOUtils::standardizeNodata(xllcorner, plugin_nodata);
......
......@@ -276,7 +276,6 @@ void BormaIO::xmlExtractData(const std::string& filename, const Date& date_in, M
xmlParseStringToDouble(str_lati, latitude, "stationsLat");
xmlParseStringToDouble(str_alti, altitude, "stationsAlt");
//HACK!! would it be possible for getValueForKey() to do this transparently? (with a user flag)
latitude = IOUtils::standardizeNodata(latitude, plugin_nodata);
longitude = IOUtils::standardizeNodata(longitude, plugin_nodata);
altitude = IOUtils::standardizeNodata(altitude, plugin_nodata);
......
......@@ -489,7 +489,6 @@ void GeotopIO::readMetaData(const std::string& metafile) {
if (!IOUtils::convertString(tmpdata.at(elv), vecAlt.at(i), std::dec))
throw InvalidFormatException(metafile + ": " + line, AT);
//HACK!! would it be possible for getValueForKey() to do this transparently? (with a user flag)
tmpdata[0] = IOUtils::standardizeNodata(tmpdata[0], plugin_nodata);
tmpdata[1] = IOUtils::standardizeNodata(tmpdata[1], plugin_nodata);
tmpdata[2] = IOUtils::standardizeNodata(tmpdata[2], plugin_nodata);
......
......@@ -104,7 +104,6 @@ void GrassIO::read2DGrid(Grid2DObject& grid_out, const std::string& filename)
IOUtils::getValueForKey(header, "south", south);
IOUtils::getValueForKey(header, "west", west);
//HACK!! would it be possible for getValueForKey() to do this transparently? (with a user flag)
_nx = IOUtils::standardizeNodata(_nx, plugin_nodata);
_ny = IOUtils::standardizeNodata(_ny, plugin_nodata);
north = IOUtils::standardizeNodata(north, plugin_nodata);
......
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