UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
polycor.hpp
1 /* polycor.hpp */
2 /* $Id$ */
3 #ifndef __polycor_hpp
4 #define __polycor_hpp
5 
6 #include <map>
7 #include <set>
8 #include <string>
9 #include <utility>
10 
11 #ifdef GE_BUILD
12 #include <trace.hpp>
13 #else
14 #include <s2proc/trace.hpp>
15 #endif
16 
17 namespace PSC
18 {
19  struct PSC_Params
20  {
22  unsigned int stride_num;
23  float start_time;
24  float time_width;
25  float ccf_length;
26  float offset_range[2];
27  float max_shift;
29  float l_max;
30  float l_half;
31  float l_eps;
33  bool CheckParams();
34 
35  void info();
36  };
37 
39  enum Direction
40  {
41  SP_LINE = 0,
42  RP_LINE,
43  SL_LINE,
44  SS_LINE,
45  RL_LINE,
46  RS_LINE,
47  CMP_LINE,
48  OFFSET_LINE
49  };
50 
51  std::string toString(const Direction &dir);
52 
54  enum StMode
55  {
56  SP_RP_ORT = 0,
57  SP_OFFSET,
58  RP_OFFSET,
59  SP_CMP,
60  RP_CMP
61  };
62 
64  typedef std::map<int, Trace::TimeT> Statics;
65 
66  // fixed CCF1 row
67  typedef std::map<int, std::pair<int, float> > CCF1_ROW;
68  // key: index of RP
69  // value: first->index correcponded to CCF1 body in TrSet, second-> max value of CCF1
70 
71  // array of CCF1 rows in current stride
72  typedef std::map<int, CCF1_ROW> ROW_AR;
73  // key: index of fixed CCF1 row
74  // value: CCF1_ROW
75 
76  // array of all strides
77  typedef std::map<int, ROW_AR> STRIDE_AR;
78  // key: stride num
79  // value: array of CCF1 rows in current stride
80 
83  // container for formed row
84  // key: id for CCF1 row (id for CCF2 row in case of CCF2 row)
85  //value: body of CCF1 (body of CCF2 in case of CCF2 row)
86  typedef std::multimap<int, Trace> ROW;
87 
88  // container for formed sum row
89  // outer key: Statics calculation mode PSC::StMode
90  // inner key: number of stride
91  // inner value: sum row for statics calculation
92  typedef std::map<PSC::StMode, std::map<int, PSC::ROW> > ROWS_MAP;
94 
95 
98 
99  // first -> number of line
100  // end -> number of point in current line
101  typedef std::pair<int, int> POINT_ID;
102 
103  // container for formed row
104  // key: id for CCF row
105  //value: body of CCF
106  typedef std::map<PSC::POINT_ID, Trace> ROW3D;
107 
108  // container for array of calculated rows
109  // Direction can be realised in two main ways
110  // inline (SS_LINE or RS_LINE)
111  // crossline (SL_LINE or RL_LINE)
112  //typedef std::map<PSC::Direction, PSC::ROW3D> ROW3D_AR;
113  typedef std::map<PSC::POINT_ID, PSC::ROW3D> ROW3D_AR;
114 
115  //container for all calculated CCF1 rows for current stride
116  //typedef std::map<PSC::POINT_ID, PSC::ROW3D_AR> CCF_AR;
117  typedef std::map<PSC::Direction, PSC::ROW3D_AR> CCF_AR;
119 
120 
122  double calc_offset_weight(double L,
123  double L_half,
124  double L_max,
125  double eps );
126 
127 
128  // determines maximum of CCF1 in window limited by window [midle - max_shift, midle + max_shift]
129  bool get_max_in_win(float *samples, int samples_count, int max_shift, std::pair<int, float> &max_pair);
130 
131  bool get_max_in_win_tr(const Trace &tr, float max_shift, std::pair<int, float> &max_pair);
132 
133  bool get_intersection_3d(const ROW3D &add_row, const ROW3D &base_row, float &intersection);
134 
135  bool get_best_row(const std::map<int, std::map<int, PSC::ROW3D> > &rows,
136  const std::set<int> &lines,
137  float max_shift,
138  std::map<int, PSC::ROW3D> &best_rows,
139  int &id,
140  float &weignt);
141 
142  bool row3d2d_convertor(const std::map<int, PSC::ROW3D> &row_3d,
143  std::map<int, PSC::ROW> &row_2d,
144  bool is_inline);
145 
146 
147  bool stack_rows_3d(PSC::ROW3D &base_row,
148  PSC::ROW3D &add_row,
149  const PSC::PSC_Params &params,
150  std::map<PSC::POINT_ID, int> &count_ar);
151 
152 };
153 
154 
155 #endif /* polycor.hpp */
float time_width
Definition: polycor.hpp:24
float l_half
Definition: polycor.hpp:30
float offset_range[2]
Definition: polycor.hpp:26
float ccf_length
Definition: polycor.hpp:25
float l_eps
Definition: polycor.hpp:31
float start_time
Definition: polycor.hpp:23
float max_shift
Definition: polycor.hpp:27
float l_max
Definition: polycor.hpp:29
Definition: trace.hpp:14
bool use_offset_weights_flag
Definition: polycor.hpp:28
unsigned int stride_num
Definition: polycor.hpp:22
int corr_direct
Definition: polycor.hpp:21
Definition: polycor.hpp:19