Change the elevations in the PolarScans to match the given elevation vector.
398 if (elevations.size() < this->size())
400 LOG_CATEGORY(
"radar.io");
401 LOG_ERROR(
"normalize_elevations: standard elevation array has %zd elements, but we have %zd scans",
402 elevations.size(), this->size());
403 throw std::runtime_error(
"not enough standard elevations");
407 for (
size_t i = 0; i < this->size() - 1; ++i)
409 if (abs(elevations[i] - this->at(i).elevation) > abs(elevations[i] - this->at(i + 1).elevation))
411 LOG_CATEGORY(
"radar.io");
412 LOG_ERROR(
"normalize_elevations: elevation %zd (%f) should be set to %f but it would make it closer to the next elevation %f", i, this->at(i).elevation, elevations[i], this->at(i + 1).elevation);
413 throw std::runtime_error(
"real elevation is too different than standard elevations");
417 for (
size_t i = 0; i < this->size(); ++i)
418 this->at(i).elevation = elevations[i];