Elaboradar  0.1

◆ compute_stats()

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

Compute Volume statistics.

Definizione alla linea 500 del file volume.h.

501  {
502  stats.count_zeros.resize(this->size());
503  stats.count_ones.resize(this->size());
504  stats.count_others.resize(this->size());
505  stats.sum_others.resize(this->size());
506 
507  for (unsigned iel = 0; iel < this->size(); ++iel)
508  {
509  stats.count_zeros[iel] = 0;
510  stats.count_ones[iel] = 0;
511  stats.count_others[iel] = 0;
512  stats.sum_others[iel] = 0;
513 
514  for (unsigned iaz = 0; iaz < this->scan(iel).beam_count; ++iaz)
515  {
516  for (size_t i = 0; i < this->scan(iel).beam_size; ++i)
517  {
518  int val = algo::DBZ::DBtoBYTE(this->scan(iel).get(iaz, i));
519  switch (val)
520  {
521  case 0: stats.count_zeros[iel]++; break;
522  case 1: stats.count_ones[iel]++; break;
523  default:
524  stats.count_others[iel]++;
525  stats.sum_others[iel] += val;
526  break;
527  }
528  }
529  }
530  }
531  }
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:313

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