UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
s2_reflsim.hpp
1 /* s2_reflsim.hpp */
2 /* $Id: s2_reflsim.hpp 21022 2011-07-11 11:45:03Z urij $ */
3 #ifndef __s2_reflsim_hpp
4 #define __s2_reflsim_hpp
5 
6 #include <s2proc/s2_poly_wave_approx.hpp>
7 
9 class S2ReflSim
10 {
11 public:
12 
14  enum KinType
15  {
16  HYP = 0,
18  };
19 
21  struct Parameters
22  {
24  size_t tr_slide_base;
27  size_t poly_deg;
28  size_t poly_bases_num;
33  };
34 
36  struct AprItem
37  {
38  AprItem() {t = pmn = pmx = 0.;}
39 
41  {
42  t = i_t;
43  pmn = i_pmn;
44  pmx = i_pmx;
45  }
46 
47  Trace::AmplT t, pmn, pmx;
48  };
49 
50  typedef std::vector<S2ReflSim::AprItem> AprVector;
51 
53  struct KinParams
54  {
55  double t;
56  double p;
57  double k1;
58  double k2;
59  double corr;
60  int nmgl;
61  int point_type;
64  static bool t_asc_corr_desc_comp (const KinParams &p1, const KinParams &p2);
65 
67  static bool t_asc_nmgl_asc_comp (const KinParams &p1, const KinParams &p2);
68 
70  static bool nmgl_asc_t_asc_comp (const KinParams &p1, const KinParams &p2);
71 
73  static bool t_asc_comp (const KinParams &p1, const KinParams &p2);
74 
76  static bool t_eq_predicator (const KinParams &p1, const KinParams &p2);
77 
79  void info() const
80  {printf ("KinParams->info: (nmgl,t,p,k1,k2,corr)=(%d, %2.3f, %2.3f, %2.3f, %2.3f, %2.3f)\n",
81  nmgl, t, p, k1, k2, corr);}
82  };
83 
84  typedef std::vector<S2ReflSim::KinParams> KPSVector;
85 
87  struct CFElem
88  {
89  CFElem(){ c = 0.; cmx = 0.; mxbn = 0;}
90 
91  double c;
92  double cmx;
93  int mxbn;
94  };
95 
96  typedef std::vector<CFElem> CFVector;
97  typedef std::vector<CFVector> CFMatrix;
98 
100  S2ReflSim();
101 
103  S2ReflSim(const Parameters &params);
104 
106  virtual ~S2ReflSim();
107 
108 
111  void setParameters(const Parameters &params);
112  Parameters& parameters() {return m_params;}
113 
115  void setApriorityKin(std::vector<S2ReflSim::AprItem> &apriority)
116  {m_apriority_kin = apriority;}
117 
119  bool calcCorrField(WaveField &field, std::vector<CFVector> &corr);
120 
122  bool calcCorrField(const std::vector<WaveField>::iterator &field_begin_it,
123  const std::vector<WaveField>::iterator &field_end_it,
124  CFMatrix &corr);
125 
127  bool calcSim(WaveField &field, CFVector &sim_vec);
128 
130  bool calcKinParams(const CFMatrix &corr,
131  std::vector<KinParams> &kps);
132 
135  bool calcPolyCoeffs(const std::vector<WaveField>::iterator &field_begin_it,
136  const std::vector<WaveField>::iterator &field_end_it,
137  std::vector<KinParams> &kps);
138 
141  bool smoothKin(std::vector<KinParams> &kinparams, double smooth_coeff);
142 
143  bool smoothPolyCoeffs(std::vector<KinParams> &kinparams, double smooth_coeff);
144 
146  bool mfKin(std::vector<KinParams> &kinparams, double rejection);
147 
148  bool apriorityKin(std::vector<KinParams> &kinparams,
149  std::vector<S2ReflSim::AprItem> &apriority,
150  size_t poly_deg);
151 
152 
155  static void applyKin(WaveField &field,
156  const std::vector<KinParams> &kin_params,
157  bool dir = true,
158  double mul = 1.);
159 
160 protected:
161 
163  bool m_ready;
164 
167 
169  std::vector<S2ReflSim::AprItem> m_apriority_kin;
170 
173  bool construct_hyp(const CFMatrix &cf,
174  double t0, double dt,
175  double p0, double dp,
176  std::vector<KinParams> &kps);
177 
178  void calc_kin_ranges(double t, double &pmn, double &pmx);
179 
180 private:
181 
182 };
183 
184 #endif /* s2_reflsim.hpp */
float AmplT
Definition: trace.hpp:21
static bool nmgl_asc_t_asc_comp(const KinParams &p1, const KinParams &p2)
Trace::AmplT poly_time_base
Definition: s2_reflsim.hpp:29
double corr
Definition: s2_reflsim.hpp:59
void info() const
Definition: s2_reflsim.hpp:79
S2ReflSim::KinType kin_type
Definition: s2_reflsim.hpp:32
static bool t_asc_comp(const KinParams &p1, const KinParams &p2)
static bool t_asc_nmgl_asc_comp(const KinParams &p1, const KinParams &p2)
size_t poly_bases_num
Definition: s2_reflsim.hpp:28
static void applyKin(WaveField &field, const std::vector< KinParams > &kin_params, bool dir=true, double mul=1.)
bool mfKin(std::vector< KinParams > &kinparams, double rejection)
bool smoothKin(std::vector< KinParams > &kinparams, double smooth_coeff)
std::vector< S2ReflSim::AprItem > m_apriority_kin
Definition: s2_reflsim.hpp:169
Parameters m_params
Definition: s2_reflsim.hpp:166
Definition: s2_reflsim.hpp:9
double cmx
Definition: s2_reflsim.hpp:92
size_t tr_slide_base
Definition: s2_reflsim.hpp:24
double k2
Definition: s2_reflsim.hpp:58
virtual ~S2ReflSim()
Definition: wave_field.hpp:13
Definition: s2_reflsim.hpp:17
Definition: s2_reflsim.hpp:21
KinType
Definition: s2_reflsim.hpp:14
double k1
Definition: s2_reflsim.hpp:57
void setApriorityKin(std::vector< S2ReflSim::AprItem > &apriority)
Definition: s2_reflsim.hpp:115
int point_type
Definition: s2_reflsim.hpp:61
static bool t_asc_corr_desc_comp(const KinParams &p1, const KinParams &p2)
Trace::AmplT tlen
Definition: s2_reflsim.hpp:25
Trace::AmplT poly_time_win
Definition: s2_reflsim.hpp:30
int mxbn
Definition: s2_reflsim.hpp:93
bool calcCorrField(WaveField &field, std::vector< CFVector > &corr)
bool calcSim(WaveField &field, CFVector &sim_vec)
bool calcKinParams(const CFMatrix &corr, std::vector< KinParams > &kps)
bool m_ready
Definition: s2_reflsim.hpp:163
size_t poly_deg
Definition: s2_reflsim.hpp:27
bool construct_hyp(const CFMatrix &cf, double t0, double dt, double p0, double dp, std::vector< KinParams > &kps)
Definition: s2_reflsim.hpp:16
double t
Definition: s2_reflsim.hpp:55
static bool t_eq_predicator(const KinParams &p1, const KinParams &p2)
Definition: s2_reflsim.hpp:87
int nmgl
Definition: s2_reflsim.hpp:60
Definition: s2_reflsim.hpp:36
Trace::AmplT kpmx
Definition: s2_reflsim.hpp:23
Definition: s2_reflsim.hpp:53
double p
Definition: s2_reflsim.hpp:56
bool calcPolyCoeffs(const std::vector< WaveField >::iterator &field_begin_it, const std::vector< WaveField >::iterator &field_end_it, std::vector< KinParams > &kps)
Parameters getParameters()
Definition: s2_reflsim.hpp:110
double c
Definition: s2_reflsim.hpp:91