Elaboradar  0.1

◆ compute_stats()

template<typename T >
void radarelab::Volume< T >::compute_stats ( VolumeStats &  stats) const
inline

Compute Volume statistics.

Definizione alla linea 498 del file volume.h.

499  {
500  stats.count_zeros.resize(this->size());
501  stats.count_ones.resize(this->size());
502  stats.count_others.resize(this->size());
503  stats.sum_others.resize(this->size());
504 
505  for (unsigned iel = 0; iel < this->size(); ++iel)
506  {
507  stats.count_zeros[iel] = 0;
508  stats.count_ones[iel] = 0;
509  stats.count_others[iel] = 0;
510  stats.sum_others[iel] = 0;
511 
512  for (unsigned iaz = 0; iaz < this->scan(iel).beam_count; ++iaz)
513  {
514  for (size_t i = 0; i < this->scan(iel).beam_size; ++i)
515  {
516  int val = algo::DBZ::DBtoBYTE(this->scan(iel).get(iaz, i));
517  switch (val)
518  {
519  case 0: stats.count_zeros[iel]++; break;
520  case 1: stats.count_ones[iel]++; break;
521  default:
522  stats.count_others[iel]++;
523  stats.sum_others[iel] += val;
524  break;
525  }
526  }
527  }
528  }
529  }
static unsigned char DBtoBYTE(double DB, double gain=80./255., double offset=-20.)
funzione che converte dB in valore intero tra 0 e 255
Definition: dbz.h:94
PolarScan< T > & scan(unsigned idx)
Access a polar scan.
Definition: volume.h:311

Referenzia radarelab::algo::DBZ::DBtoBYTE(), e radarelab::PolarScan< T >::get().