Elaboradar  0.1
 Tutto Classi Namespace File Funzioni Variabili Tipi enumerati (enum) Gruppi
void classifier::class_designation ( unsigned  win_rg = 1,
unsigned  win_az = 1 
)

Designate class echo Find the maximum of aggregation values.

Definizione alla linea 440 del file classifier.cpp.

Referenzia radarelab::volume::Scans< T >::scan(), vol_Ai, vol_hca, e vol_z.

Referenziato da HCA_Park_2009().

441 {
442  if(win_rg||win_az)
443  {
444  std::vector< std::vector< std::vector<HCA_Park> > > vol_Ai_filtered;
445  vol_Ai_filtered=vol_Ai;
446  unsigned half_rg=0.5*(win_rg-1);
447  unsigned half_az=0.5*(win_az-1);
448  int pre_rg,post_rg,pre_az,post_az;
449  unsigned count=0;
450  //cout<<half_az<<"\t"<<half_rg<<endl;
451  for(unsigned el=0;el<vol_Ai.size();el++)
452  {
453  vol_hca.push_back(PolarScan<EchoClass>(vol_z.scan(el).beam_count,vol_z.scan(el).beam_size, NC));
454  vol_hca[el].elevation=vol_z[el].elevation;
455  vol_hca[el].gain=1;
456  vol_hca[el].offset=0;
457  vol_hca[el].undetect=NC;
458  vol_hca[el].nodata=255;
459  for(unsigned az=0;az<vol_Ai[el].size();az++)
460  for(unsigned rg=0;rg<vol_Ai[el][az].size();rg++)
461  {
462  //cout<<el<<"\t"<<az<<"\t"<<rg<<endl;
463  vol_Ai_filtered[el][az][rg].clearAi();
464  vol_Ai_filtered[el][az][rg].Ai+=vol_Ai[el][az][rg].Ai;
465  count++;
466  //cout<<"faccio gli az"<<endl;
467  for(unsigned j=1;j<half_az+1;j++)
468  {
469  pre_az=az-j;
470  post_az=az+j;
471  //cout<<pre_az<<"\t"<<post_az<<endl;
472  if(pre_az<0)pre_az+=vol_Ai[el].size();
473  if(post_az>=vol_Ai[el].size())post_az-=vol_Ai[el].size();
474  //cout<<pre_az<<"\t"<<post_az<<endl;
475  vol_Ai_filtered[el][az][rg].Ai+=vol_Ai[el][pre_az][rg].Ai;
476  vol_Ai_filtered[el][az][rg].Ai+=vol_Ai[el][post_az][rg].Ai;
477  count+=2;
478  }
479  //cout<<"faccio gli rg"<<flush;
480  for(unsigned i=1;i<half_rg+1;i++)
481  {
482  pre_rg=rg-i;
483  post_rg=rg+i;
484  if(pre_rg>=0)
485  {
486  vol_Ai_filtered[el][az][rg].Ai+=vol_Ai[el][az][pre_rg].Ai;
487  count++;
488  }
489  if(post_rg<vol_Ai[el][az].size())
490  {
491  vol_Ai_filtered[el][az][rg].Ai+=vol_Ai[el][az][post_rg].Ai;
492  count++;
493  }
494  //cout<<"faccio gli az "<<i<<flush;
495  for(unsigned j=1;j<half_az+1;j++)
496  {
497  pre_az=az-j;
498  post_az=az+j;
499  pre_az=az-j;
500  post_az=az+j;
501  if(pre_az<0)pre_az+=vol_Ai[el].size();
502  if(post_az>=vol_Ai[el].size())post_az-=vol_Ai[el].size();
503  if(pre_rg>=0)
504  {
505  vol_Ai_filtered[el][az][rg].Ai+=vol_Ai[el][pre_az][pre_rg].Ai;
506  vol_Ai_filtered[el][az][rg].Ai+=vol_Ai[el][pre_az][pre_rg].Ai;
507  count+=2;
508  }
509  if(post_rg<vol_Ai[el][az].size())
510  {
511  vol_Ai_filtered[el][az][rg].Ai+=vol_Ai[el][post_az][post_rg].Ai;
512  vol_Ai_filtered[el][az][rg].Ai+=vol_Ai[el][post_az][post_rg].Ai;
513  count+=2;
514  }
515  }
516  }
517  //cout<<" fatto"<<endl;
518  vol_Ai_filtered[el][az][rg].Ai.array()/=(double)count;
519  //cout<<"normalizzato"<<endl;
520  vol_hca[el](az,rg)=vol_Ai_filtered[el][az][rg].echo(0.00001);
521  //cout<<"azzero"<<endl;
522  count=0;
523  }
524  }
525  }
526  else
527  {
528  for(unsigned el=0;el<vol_z.size();el++)
529  {
530  vol_hca.push_back(PolarScan<EchoClass>(vol_z.scan(el).beam_count,vol_z.scan(el).beam_size, NC));
531  vol_hca[el].elevation=vol_z[el].elevation;
532  for(unsigned az=0;az<vol_z.scan(el).beam_count;az++)
533  for(unsigned rg=0;rg<vol_z.scan(el).beam_size;rg++)
534  vol_hca[el](az,rg)=vol_Ai[el][az][rg].echo(0.00001);
535  }
536  }
537 }
PolarScan< T > & scan(unsigned idx)
Access a polar scan.
Definition: volume.h:298
Volume< EchoClass > vol_hca
Definition: classifier.h:356
PolarScan - structure to describe a polarScan containing a matrix of data and conversion factors...
Definition: volume.h:112
std::vector< std::vector< std::vector< HCA_Park > > > vol_Ai
Definition: classifier.h:360