Change the elevations in the PolarScans to match the given elevation vector.
385 if (elevations.size() < this->size())
387 LOG_CATEGORY(
"radar.io");
388 LOG_ERROR(
"normalize_elevations: standard elevation array has %zd elements, but we have %zd scans",
389 elevations.size(), this->size());
390 throw std::runtime_error(
"not enough standard elevations");
394 for (
size_t i = 0; i < this->size() - 1; ++i)
396 if (abs(elevations[i] - this->at(i).elevation) > abs(elevations[i] - this->at(i + 1).elevation))
398 LOG_CATEGORY(
"radar.io");
399 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);
400 throw std::runtime_error(
"real elevation is too different than standard elevations");
404 for (
size_t i = 0; i < this->size(); ++i)
405 this->at(i).elevation = elevations[i];