UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
psc_correlator.hpp
1 /* psc_correlator.hpp */
2 /* $Id$ */
3 #ifndef __psc_correlator_hpp
4 #define __psc_correlator_hpp
5 
6 #include <utility>
7 
8 #ifdef GE_BUILD
9 #include <dba_seismic.hpp>
10 #include <psc_service.hpp>
11 #include <psc_weights_store.hpp>
12 #else
13 #include <s2proc/dba_seismic.hpp>
14 #include <s2proc/psc_service.hpp>
15 #include <s2proc/psc_weights_store.hpp>
16 #endif
17 
19 namespace psc
20 {
29  class Correlator
30  {
31  public:
32 
34  struct Params
35  {
37  Params():
38  t0(0),
39  tSize(0),
40  ccfSize(0),
41  maxStride(0),
42  corrDirMask(CorrDirMask::COMPLETE_2D),
43  maxZerosPart(1.)
44  {offsetsRange[0] = offsetsRange[1] = 0;}
45 
49  unsigned int maxStride;
51  float maxZerosPart;
53  };
54 
56  Correlator(const Params &params);
57 
59  virtual ~Correlator();
60 
61 
65  virtual bool operator()(const dba::Seismic &in_seis_db,
66  dba::Seismic &out_seis_db,
67  WeightsStore *pwstore = NULL) const;
68 
69 
71  virtual int ccfsTraceSize(const dba::Seismic &in_seis_db) const;
72 
73 
75  const Params& params() const;
76 
78  void setParams(const Params &params);
79 
80 
83  static std::pair<int, int> gridStep(const unsigned int dir,
84  const int stride,
85  const std::pair<int, int> &sp_rp_ids);
86 
87  protected:
88 
90  typedef std::vector< std::pair <unsigned int, unsigned int> > StrideDirVec;
91 
92 
94  Params m_params;
95 
96 
98  virtual void progress(const int /* current */, const int /* all */) const
99  {/* Should be reimplemented. */}
100 
101 
103  bool correlate(const StrideDirVec &dir_stride_vec,
104  const dba::Seismic &in_seis_db,
105  const Trace &tr,
106  Trace &ccfs,
107  WeightsStore *pwstore) const;
108 
110  bool calc_ccf(const int corr_dir,
111  const unsigned int stride,
112  const dba::Seismic &in_seis_db,
113  const Trace &tr,
114  Trace &ccfs) const;
115 
118 
120  int corr_trace_size(const dba::Seismic &in_seis_db) const;
121  };
122 }; // namespace psc
123 
124 #endif /* psc_correlator.hpp */
bool correlate(const StrideDirVec &dir_stride_vec, const dba::Seismic &in_seis_db, const Trace &tr, Trace &ccfs, WeightsStore *pwstore) const
void setParams(const Params &params)
bool calc_ccf(const int corr_dir, const unsigned int stride, const dba::Seismic &in_seis_db, const Trace &tr, Trace &ccfs) const
Trace::TimeT ccfSize
Definition: psc_correlator.hpp:48
float OffsetT
Definition: trace.hpp:23
virtual void progress(const int, const int) const
Definition: psc_correlator.hpp:98
float TimeT
Definition: trace.hpp:22
virtual int ccfsTraceSize(const dba::Seismic &in_seis_db) const
int corrDirMask
Definition: psc_correlator.hpp:50
Definition: psc_correlator.hpp:34
std::vector< std::pair< unsigned int, unsigned int > > StrideDirVec
Definition: psc_correlator.hpp:90
Trace::TimeT tSize
Definition: psc_correlator.hpp:47
Definition: psc_weights_store.hpp:21
Trace::TimeT t0
Definition: psc_correlator.hpp:46
Trace::OffsetT offsetsRange[2]
Definition: psc_correlator.hpp:52
Params()
Definition: psc_correlator.hpp:37
unsigned int maxStride
Definition: psc_correlator.hpp:49
float maxZerosPart
Definition: psc_correlator.hpp:51
Definition: psc_service.hpp:24
virtual ~Correlator()
Definition: trace.hpp:14
Correlator(const Params &params)
Definition: psc_correlator.hpp:29
virtual bool operator()(const dba::Seismic &in_seis_db, dba::Seismic &out_seis_db, WeightsStore *pwstore=NULL) const
static std::pair< int, int > gridStep(const unsigned int dir, const int stride, const std::pair< int, int > &sp_rp_ids)
Definition: dba_seismic.hpp:19
Trace::TimeT corr_trace_size() const
const Params & params() const