Elaboradar  0.1

◆ normalize_elevations()

template<typename T >
void radarelab::volume::Scans< T >::normalize_elevations ( const std::vector< double > &  elevations)
inline

Change the elevations in the PolarScans to match the given elevation vector.

Parametri
[in]elevations- values to be used

Definizione alla linea 397 del file volume.h.

398  {
399  // Ensure that we have enough standard elevations
400  if (elevations.size() < this->size())
401  {
402  LOG_CATEGORY("radar.io");
403  LOG_ERROR("normalize_elevations: standard elevation array has %zd elements, but we have %zd scans",
404  elevations.size(), this->size());
405  throw std::runtime_error("not enough standard elevations");
406  }
407  // Ensure that the nudging that we do do not confuse a scan
408  // with another
409  for (size_t i = 0; i < this->size() - 1; ++i)
410  {
411  if (abs(elevations[i] - this->at(i).elevation) > abs(elevations[i] - this->at(i + 1).elevation))
412  {
413  LOG_CATEGORY("radar.io");
414  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);
415  throw std::runtime_error("real elevation is too different than standard elevations");
416  }
417  }
418  // Assign the new elevations
419  for (size_t i = 0; i < this->size(); ++i)
420  this->at(i).elevation = elevations[i];
421  }

Referenzia radarelab::PolarScanBase::elevation.

Referenziato da elaboradar::CUM_BAC::read_sp20_volume().