OpendTect-6_4  6.4
seisparallelreader.h
Go to the documentation of this file.
1 #ifndef seisparallelreader_h
2 #define seisparallelreader_h
3 /*
4 ________________________________________________________________________
5 
6  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
7  Author: K. Tingdahl
8  Date: July 2010
9  RCS: $Id$
10 ________________________________________________________________________
11 
12 */
13 
14 #include "seismod.h"
15 
16 #include "datachar.h"
17 #include "executor.h"
18 #include "fixedstring.h"
19 #include "paralleltask.h"
20 #include "sets.h"
21 #include "trckeyzsampling.h"
22 #include "uistring.h"
23 #include "valseriesinterpol.h"
24 
25 class BinDataDesc;
26 class BinIDValueSet;
27 class IOObj;
29 class Scaler;
30 class SeisTrc;
31 class SeisTrcBuf;
32 class SeisTrcReader;
33 class TraceData;
34 
35 template <class T> class Array2D;
36 template <class T> class Array3D;
37 template <class T> class DataInterpreter;
38 namespace PosInfo { class CubeData; class CubeDataIterator; }
39 
40 
41 namespace Seis
42 {
43 
44 class ObjectSummary;
45 class SelData;
46 
55 public:
56  ParallelReader(const IOObj&,const TrcKeyZSampling&);
60  ParallelReader(const IOObj&,
62  const TypeSet<int>& components);
68  ~ParallelReader();
69 
70  void setComponents( const TypeSet<int>& compnrs )
71  { components_ = compnrs; }
72  mDeprecated bool setOutputComponents(const TypeSet<int>&);
75  void setDataPack(RegularSeisDataPack*);
76  RegularSeisDataPack* getDataPack();
77 
78  uiString uiNrDoneText() const;
79  uiString uiMessage() const;
80 
81 protected:
82  od_int64 nrIterations() const { return totalnr_; }
83 
84  bool setOutputComponents();
85 
86  bool doPrepare(int nrthreads);
87  bool doWork(od_int64,od_int64,int);
88  bool doFinish(bool);
89 
90 
92 
94 
97 
100 
103 
104 private:
105 
106  void submitUdfWriterTasks();
107 };
108 
109 
114 public:
116  const TrcKeyZSampling* =0,
117  const TypeSet<int>* comps=0);
121  ~ParallelReader2D();
122 
123  void setDataChar(DataCharacteristics::UserType);
124  void setScaler(Scaler*);
125  bool init();
126 
127  RegularSeisDataPack* getDataPack(); // The caller now owns the datapack
128 
129  uiString uiNrDoneText() const;
130  uiString uiMessage() const;
131 
132 protected:
133  od_int64 nrIterations() const;
134  bool doPrepare(int nrthreads);
135  bool doWork(od_int64,od_int64,int);
136  bool doFinish(bool);
137 
147 
149 };
150 
151 
164 public:
165  SequentialReader(const IOObj&,
166  const TrcKeyZSampling* =0,
167  const TypeSet<int>* components=0);
171  ~SequentialReader();
172 
173  void setComponents( const TypeSet<int>& compnrs )
174  { components_ = compnrs; }
175  mDeprecated bool setOutputComponents(const TypeSet<int>&);
178  void setComponentScaler(const Scaler&,int compidx);
181  void setDataChar(DataCharacteristics::UserType);
182  void setScaler(Scaler*);
183 
184  bool setDataPack(RegularSeisDataPack&,od_ostream* strm=0);
191  RegularSeisDataPack* getDataPack();
192 
193  uiString uiMessage() const { return msg_; }
194  uiString uiNrDoneText() const;
195  od_int64 nrDone() const { return nrdone_; }
196  od_int64 totalNr() const { return totalnr_; }
197 
198  bool init();
199 
200 protected:
201 
202  bool setOutputComponents();
203  virtual int nextStep();
204  virtual bool goImpl(od_ostream*,bool,bool,int);
205 
206 private:
207 
208  void adjustDPDescToScalers(const BinDataDesc& trcdesc);
209  bool getTrcsPosForRead(int& desirednrpos,
210  TypeSet<TrcKey>&) const;
211  void submitUdfWriterTasks();
212 
214  bool is2d_;
229 
230  int queueid_;
231 
238 };
239 
240 
247 public:
248  RawTrcsSequence(const ObjectSummary&,int nrpos);
249  RawTrcsSequence(const RawTrcsSequence&);
250  ~RawTrcsSequence();
251 
252  RawTrcsSequence& operator =(const RawTrcsSequence&);
253 
254  bool isOK() const;
255  bool isPS() const;
256  const DataCharacteristics getDataChar() const;
257 
258  const StepInterval<float>& getZRange() const;
259  int nrPositions() const;
260  float get(int idx,int pos,int comp) const;
261  float getValue(float,int pos,int comp) const;
262 
263  void set(int idx,float val,int pos,int comp);
264  void setPositions(const TypeSet<TrcKey>&); //Becomes mine
265  void copyFrom(const SeisTrc&,int* ipos=0);
266  void copyFrom(const SeisTrcBuf&) {}
267 
268  //No checks
269  const unsigned char* getData(int ipos,int icomp,int is=0) const;
270  unsigned char* getData(int ipos,int icomp,int is=0);
271  const TrcKey& getPosition(int ipos) const;
272 
273 private:
274 
275  const ValueSeriesInterpolator<float>& interpolator() const;
276 
280  const int nrpos_;
281 
283 
284 public:
285 
286  // Special users only
287 
288  TraceData& getTraceData( int pos ) { return *(data_[pos]); }
289 
290 };
291 
292 
302 {
303 public:
305  int pos, int comp);
307 
308  ValueSeries<float>* clone() const;
309 
310  inline void setPosition( int pos ) { ipos_ = pos; }
311  inline void setComponent( int idx ) { icomp_ = idx; }
312  void setValue(od_int64,float);
313  float* arr();
314 
315  float value(od_int64) const;
316  bool writable() const { return true; }
317  const float* arr() const;
318 
319 private:
320 
322  int ipos_;
323  int icomp_;
324 };
325 
326 } // namespace Seis
327 
328 #endif
TrcKeyZSampling tkzs_
Definition: seisparallelreader.h:96
#define mExpClass(module)
Definition: commondefs.h:160
PtrMan< ValueSeriesInterpolator< float > > intpol_
Definition: seisparallelreader.h:282
Summary for a Seismic object.
Definition: segydirectdef.h:23
void setComponents(const TypeSet< int > &compnrs)
Definition: seisparallelreader.h:70
PosInfo::CubeDataIterator * trcsiterator3d_
Definition: seisparallelreader.h:222
ObjectSet< Scaler > compscalers_
Definition: seisparallelreader.h:237
OD class for stream write common access to the user log file, or std::cout in batch progs...
Definition: od_ostream.h:26
Definition: ioobj.h:58
TrcKeyZSampling tkzs_
Definition: seisparallelreader.h:140
Pos::GeomID geomid_
Definition: seisparallelreader.h:141
Definition: seisparallelreader.h:301
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
uiString uiMessage() const
will be message() again in 7.x
Definition: seisparallelreader.h:193
bool needresampling_
Definition: seisparallelreader.h:225
#define od_int64
Definition: plftypes.h:36
RawTrcsSequence & seq_
Definition: seisparallelreader.h:321
bool init()
void setComponent(int idx)
Definition: seisparallelreader.h:311
IOObj * ioobj_
Definition: seisparallelreader.h:142
SeisTrcReader & rdr_
Definition: seisparallelreader.h:215
TypeSet< int > seisrdroutcompmgr_
Definition: seisparallelreader.h:102
void copyFrom(const SeisTrcBuf &)
Definition: seisparallelreader.h:266
const TypeSet< TrcKey > * tks_
Definition: seisparallelreader.h:279
SeisDataPack for 2D and 3D seismic data.
Definition: seisdatapack.h:28
od_int64 totalNr() const
Definition: seisparallelreader.h:196
Definition: uistring.h:89
bool samedatachar_
Definition: seisparallelreader.h:223
uiString errmsg_
Definition: seisparallelreader.h:101
Generalization of a task that can be run in parallel.
Definition: paralleltask.h:66
od_int64 nrIterations() const
Definition: seisparallelreader.h:82
Definition: seisparallelreader.h:53
Byte-level data interpreter.
Definition: cbvswriter.h:22
bool isPS(GeomType gt)
Definition: seistype.h:38
reads from a seismic data store.
Definition: seisread.h:50
Definition: seisparallelreader.h:162
Definition: ptrman.h:79
const ObjectSummary & info_
Definition: seisparallelreader.h:278
Array2D ( Subclass of ArrayND ) is a two dimensional array.
Definition: arraynd.h:131
uiString msg_
Definition: seisparallelreader.h:146
const int nrpos_
Definition: seisparallelreader.h:280
byte-level data characteristics of stored data.
Definition: datachar.h:37
DataCharacteristics dc_
Definition: seisparallelreader.h:226
Hor+Vert sampling in 3D surveys.
Definition: trckeyzsampling.h:35
Interface to a series of values.
Definition: odmemory.h:17
void setComponents(const TypeSet< int > &compnrs)
Definition: seisparallelreader.h:173
SelData * sd_
Definition: seisparallelreader.h:216
DataCharacteristics dc_
Definition: seisparallelreader.h:143
od_int64 totalnr_
Definition: seisparallelreader.h:99
bool is2d_
Definition: seisparallelreader.h:214
Iterates through CubeData.
Definition: posinfo.h:221
TrcKeyZSampling tkzs_
Definition: seisparallelreader.h:218
PosInfo::CubeData * trcssampling_
Definition: seisparallelreader.h:221
Scaling of floating point numbers.
Definition: scaler.h:33
od_int64 totalnr_
Definition: seisparallelreader.h:145
od_int64 totalnr_
Definition: seisparallelreader.h:232
ObjectSet< TraceData > data_
Definition: seisparallelreader.h:277
contains input (sub-)selection data from a cube or lineset
Definition: seisselection.h:82
Interval< int > samprg_
Definition: seisparallelreader.h:220
od_int64 nrdone_
Definition: seisparallelreader.h:233
Index_Type GeomID
Definition: commontypes.h:52
IOObj * ioobj_
Definition: seisparallelreader.h:213
RegularSeisDataPack * dp_
Definition: seisparallelreader.h:138
TypeSet< int > components_
Definition: seisparallelreader.h:219
Position info, often segmented.
Definition: posinfo.h:40
Scaler * scaler_
Definition: seisparallelreader.h:144
RegularSeisDataPack * dp_
Definition: seisparallelreader.h:95
#define mDeprecated
Definition: plfdefs.h:233
bool writable() const
Definition: seisparallelreader.h:316
RegularSeisDataPack * dp_
Definition: seisparallelreader.h:217
Seismic trace.
Definition: seistrc.h:34
int queueid_
Definition: seisparallelreader.h:230
TypeSet< int > components_
Definition: seisparallelreader.h:139
void setPosition(int pos)
Definition: seisparallelreader.h:310
bool dpclaimed_
Definition: seisparallelreader.h:148
set of seismic traces.
Definition: seisbuf.h:31
A Pos::IdxPairValueSet with BinIDs.
Definition: binidvalset.h:23
StepInterval< float > dpzsamp_
Definition: seisparallelreader.h:224
TraceData & getTraceData(int pos)
Definition: seisparallelreader.h:288
UserType
Definition: datachar.h:88
Represents a unique trace position in one of the surveys that OpendTect is managing.
Definition: trckey.h:28
uiString msg_
Definition: seisparallelreader.h:234
Definition: seisparallelreader.h:112
ObjectSummary * seissummary_
Definition: seisparallelreader.h:228
#define mClass(module)
Definition: commondefs.h:164
A set of data buffers and their interpreters.
Definition: tracedata.h:32
Scaler * scaler_
Definition: seisparallelreader.h:227
Description of binary data.
Definition: bindatadesc.h:43
BinIDValueSet * bidvals_
Definition: seisparallelreader.h:93
Position info for an entire 3D cube. The LineData&#39;s are not sorted.
Definition: posinfo.h:95
Array3D ( Subclass of ArrayND ) is a three dimensional array.
Definition: arraynd.h:153
int ipos_
Definition: seisparallelreader.h:322
TypeSet< int > components_
Definition: seisparallelreader.h:91
IOObj * ioobj_
Definition: seisparallelreader.h:98
int icomp_
Definition: seisparallelreader.h:323
TypeSet< int > outcomponents_
Definition: seisparallelreader.h:236
od_int64 nrDone() const
Definition: seisparallelreader.h:195
bool initialized_
Definition: seisparallelreader.h:235
Definition: seisioobjinfo.h:37
Specification to enable chunkwise execution of a process.
Definition: executor.h:39
Buffer to a set of entire traces ( header + component data ) Can contain traces for several positions...
Definition: seisparallelreader.h:245

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019