Elaboradar  0.1

◆ clean_beam() [3/3]

std::vector< bool > radarelab::algo::Cleaner::clean_beam ( const Eigen::VectorXd &  beam_z,
const Eigen::VectorXd &  beam_w,
const Eigen::VectorXd &  beam_v,
int  i 
) const

Funzione per ripulire raggio.Utilizza (sigmaV, V)

Parametri
[in]beam_z- raggio DBZH
[in]beam_w- raggio WRAD
[in]beam_v- raggio VRAD
Restituisce
raggio di valori boleani per correzione (true-> Da Correggere)

Definizione alla linea 38 del file cleaner.cpp.

39 {
40  const unsigned beam_size = beam_z.rows();
41  vector<bool> res(beam_size, false);
42  bool in_a_segment = false;
43  unsigned start, end;
44  unsigned segment_length;
45  bool before, after;
46  unsigned counter = 0;
47 
48  for (unsigned ibin = 0; ibin < beam_size; ++ibin)
49  {
50 //printf(" %4d %4d %6.2f %6.2f %10.6f ",iray,ibin , beam_z(ibin),beam_v(ibin),beam_w(ibin));
51  if (!in_a_segment)
52  {
53  /* cerco la prima cella segmento da pulire*/
54  if (beam_w(ibin) == W_threshold && beam_v(ibin) == bin_wind_magic_number)
55  {
56 //printf(" 1 ----- START SEGMENT ------");
57  in_a_segment = true;
58  start = ibin;
59  after = false;
60  before = false;
61  }
62 // else printf(" 0 ");
63  } else {
64  /* cerco la fine segmento da pulire*/
65  if (beam_w(ibin) != W_threshold || beam_v(ibin) != bin_wind_magic_number || ibin == (beam_size - 1))
66  {
67  in_a_segment = false;
68  end = ibin - 1;
69  if (ibin == (beam_size - 1)) end = ibin; // caso particolare per fine raggio
70  /* Fine trovata ora procedo alla pulizia eventuale */
71  segment_length = end - start;
72  counter = counter + (unsigned)(segment_length);
73 
74  unsigned c_b=0;
75  unsigned c_a=0;
76  /* Cerco dati validi in Z prima del segmento */
77  for (int ib = ibin - 12; ib < (signed)ibin; ++ib)
78  if (ib >= 0 && beam_z(ib) > Z_missing)
79  c_b++;
80  if (c_b > 0.25*12) before = true;
81 
82  /* Cerco dati validi in Z dopo il segmento */
83  for (unsigned ia = ibin + 1; ia <= ibin + 12; ++ia)
84  if (ia < beam_size && beam_z(ia) >= Z_missing)
85  c_a++;
86  if (c_a > 0.25*12) after = true;
87 
88 //printf(" 0 ----- STOP SEGMENT ------ %4d -- %4d before %d %d after %d %d ",segment_length,counter, c_b,before, c_a, after);
89  if ((segment_length >= min_segment_length && !before && !after) ||
90  segment_length >= max_segment_length || counter > 100)
91  {
92  /* qui pulisco */
93  // printf (" pulisco %d %d %d \n",segment_length, min_segment_length, max_segment_length);
94  for (unsigned ib = start; ib <= end; ++ib)
95  if( beam_z(ib) > Z_missing)res[ib] = true;
96  }
97  }
98 // else printf(" 1 ");
99  }
100 //printf("\n");
101  }
102  return res;
103 }
const double Z_missing
Valore dato mancante DBZH.
Definition: cleaner.h:26
const double bin_wind_magic_number
valore magico per dati in formato SP20
Definition: cleaner.h:29
const unsigned max_segment_length
lunghezza massima segmento in celle se più lungo pulisce in ogni caso
Definition: cleaner.h:24
const double W_threshold
Soglia per WRAD.
Definition: cleaner.h:27
const unsigned min_segment_length
lunghezza minima segmento in celle
Definition: cleaner.h:23

Referenziato da clean().