UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
psc_ts_container.hpp
1 /* psc_ts_container.hpp */
2 /* $Id$ */
3 #ifndef __psc_ts_container_hpp
4 #define __psc_ts_container_hpp
5 
6 #include <vector>
7 
8 #ifdef GE_BUILD
9 #include <dba_seismic.hpp>
10 #include <psc_service.hpp>
11 #else
12 #include <s2proc/dba_seismic.hpp>
13 #include <s2proc/psc_service.hpp>
14 #endif
15 
17 namespace psc
18 {
21  {
22  public:
23 
25  struct Entry
26  {
28  Entry();
29 
31  Entry(const Trace::TimeT &i_dt, const float i_w);
32 
34  bool actual() const;
35 
37  void setInactual();
38 
41  };
42 
44  typedef std::vector<Entry> Entries;
45 
47  typedef std::vector<Entries> Storage;
48 
49 
51  TsContainer();
52 
54  virtual ~TsContainer();
55 
67  virtual bool init(const dba::Seismic &dba,
68  const unsigned int corr_dir_mask,
69  const unsigned int max_stride,
70  const Trace::OffsetT offsets_range[2] = NULL);
71 
72 
82  virtual const Entry& operator()(const int nsp,
83  const int nrp,
84  const unsigned int corr_dir,
85  const unsigned int stride) const;
86 
96  virtual Entry& operator()(const int nsp,
97  const int nrp,
98  const unsigned int corr_dir,
99  const unsigned int stride);
100 
108  const std::vector<int>& getIds(const Trace::Header::AttrId &attr_id) const;
109 
114  unsigned int getCorrDirMask() const {return m_corr_dir_mask;}
115 
120  unsigned int getMaxStride() const {return m_max_stride;}
121 
122 
129  virtual void applyTimeShift(const Trace::Header::AttrId &attr_id, const int id, const Trace::TimeT dt);
130 
135  void removeIncline(const Trace::Header::AttrId &attr_id);
136 
137 
138  void test_to_file(const std::string &fname) const;
139 
140  protected:
141 
143  std::vector<int> m_nsp_ids_vec;
144  std::vector<int> m_nrp_ids_vec;
145  unsigned int m_corr_dir_mask;
146  unsigned int m_max_stride;
154  virtual void progress(const int cur, const int max) const;
155 
156  bool get_ids_from_db(const dba::Seismic &dba,
157  const Trace::Header::AttrId &attr_id,
158  std::vector<int> &ids_vec) const;
159 
163  Entry tr2entry(Trace &tr,
164  const unsigned int dir,
165  const unsigned int stride) const;
166 
170  bool id_of_corr_dir(const unsigned int dir, size_t &id) const;
171 
175  bool get_entry_ids(const int nsp,
176  const int nrp,
177  const unsigned int corr_dir,
178  const unsigned int stride,
179  size_t &storage_id,
180  size_t &entries_id) const;
181 
182  Entry def_inactual_entry;
183  };
184 
185 }; // namespace psc
186 
187 #endif /* psc_ts_container.hpp */
unsigned int getMaxStride() const
Definition: psc_ts_container.hpp:120
float AmplT
Definition: trace.hpp:21
virtual const Entry & operator()(const int nsp, const int nrp, const unsigned int corr_dir, const unsigned int stride) const
std::vector< int > m_nsp_ids_vec
Definition: psc_ts_container.hpp:143
Definition: psc_ts_container.hpp:25
float OffsetT
Definition: trace.hpp:23
Storage m_storage
Definition: psc_ts_container.hpp:142
Definition: psc_ts_container.hpp:20
float TimeT
Definition: trace.hpp:22
const std::vector< int > & getIds(const Trace::Header::AttrId &attr_id) const
void removeIncline(const Trace::Header::AttrId &attr_id)
std::vector< int > m_nrp_ids_vec
Definition: psc_ts_container.hpp:144
virtual bool init(const dba::Seismic &dba, const unsigned int corr_dir_mask, const unsigned int max_stride, const Trace::OffsetT offsets_range[2]=NULL)
Definition: trace.hpp:14
virtual void progress(const int cur, const int max) const
Trace::AmplT w
Definition: psc_ts_container.hpp:40
unsigned int m_corr_dir_mask
Definition: psc_ts_container.hpp:145
std::vector< Entry > Entries
Definition: psc_ts_container.hpp:44
Trace::TimeT dt
Definition: psc_ts_container.hpp:39
Entry tr2entry(Trace &tr, const unsigned int dir, const unsigned int stride) const
Definition: dba_seismic.hpp:19
unsigned int getCorrDirMask() const
Definition: psc_ts_container.hpp:114
std::vector< Entries > Storage
Definition: psc_ts_container.hpp:47
virtual ~TsContainer()
bool id_of_corr_dir(const unsigned int dir, size_t &id) const
AttrId
Definition: trace.hpp:34
virtual void applyTimeShift(const Trace::Header::AttrId &attr_id, const int id, const Trace::TimeT dt)
bool get_entry_ids(const int nsp, const int nrp, const unsigned int corr_dir, const unsigned int stride, size_t &storage_id, size_t &entries_id) const
unsigned int m_max_stride
Definition: psc_ts_container.hpp:146