UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
s2_traces_quality.hpp
1 /* s2_traces_quality.hpp */
2 /* $Id$ */
3 #ifndef __s2_traces_quality_hpp
4 #define __s2_traces_quality_hpp
5 
6 #include <map>
7 
8 #ifdef GE_BUILD
9 #include <s2_abstract_db_access.hpp>
10 #include <polycor.hpp>
11 #else
12 #include <s2proc/s2_abstract_db_access.hpp>
13 #include <s2proc/polycor.hpp>
14 #endif
15 
18 {
19 public:
20 
22  struct QP
23  {
25  QP() : max_pos(0.), min_neg(0.) {/* Nothing to do. */}
26 
27  QP& operator/=(const int &val) {max_pos /= val; min_neg /= val; return *this;}
28  QP& operator+=(const QP &that) {max_pos += that.max_pos; min_neg += that.min_neg; return *this;}
29 
32  };
33 
35  typedef std::map<int, std::map<int, std::map<PSC::Direction, QP> > > Quality;
36 
38  S2TracesQuality(const S2AbstractDBAccess &dba_if,
39  const Trace::TimeT &max_time_range,
40  const Trace::TimeT &start_time,
41  const Trace::TimeT &time_length);
42 
45 
47  bool fill();
48 
49 
52  const QP& getQP(int nsp, int nrp, PSC::Direction dir, bool *rc = 0x0) const;
53 
55  const Quality& getQuality() const {return m_quality;}
56 
60  bool getWeightsDistribution(PSC::Direction dir, std::map<int, Trace::AmplT>& weights) const;
61 
63  static bool calc_qp(const Trace &tr1, const Trace &tr2,
64  const Trace::TimeT &max_time_range, QP &qp);
65 
66 
67 protected:
68 
71 
74 
77 
80 
82  S2AbstractDBAccess *mp_dba_if;
83 
84 private:
85 
86  bool add_correlations(int comp, PSC::Direction dir);
87 
90  bool obtain_qp(int nsp, int nrp, PSC::Direction dir, const Trace &tr, QP &qp) const;
91 
93  QP merge_qps(const QP &qp1, bool rc1, const QP &qp2, bool rc2);
94 
95  static QP m_tmp_qp;
96 };
97 
98 #endif /* s2_traces_quality.hpp */
QP()
Definition: s2_traces_quality.hpp:25
float AmplT
Definition: trace.hpp:21
std::map< int, std::map< int, std::map< PSC::Direction, QP > > > Quality
Definition: s2_traces_quality.hpp:35
S2TracesQuality(const S2AbstractDBAccess &dba_if, const Trace::TimeT &max_time_range, const Trace::TimeT &start_time, const Trace::TimeT &time_length)
Trace::TimeT m_start_time
Definition: s2_traces_quality.hpp:76
float TimeT
Definition: trace.hpp:22
Definition: s2_abstract_db_access.hpp:15
const QP & getQP(int nsp, int nrp, PSC::Direction dir, bool *rc=0x0) const
static bool calc_qp(const Trace &tr1, const Trace &tr2, const Trace::TimeT &max_time_range, QP &qp)
Trace::TimeT m_max_time_range
Definition: s2_traces_quality.hpp:73
bool getWeightsDistribution(PSC::Direction dir, std::map< int, Trace::AmplT > &weights) const
const Quality & getQuality() const
Definition: s2_traces_quality.hpp:55
Definition: trace.hpp:14
Trace::AmplT min_neg
Definition: s2_traces_quality.hpp:31
Quality m_quality
Definition: s2_traces_quality.hpp:70
Trace::AmplT max_pos
Definition: s2_traces_quality.hpp:30
Trace::TimeT m_time_length
Definition: s2_traces_quality.hpp:79
Definition: s2_traces_quality.hpp:22
Definition: s2_traces_quality.hpp:17