OpendTect-6_4  6.4
wellextractdata.h
Go to the documentation of this file.
1 #ifndef wellextractdata_h
2 #define wellextractdata_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Bert Bril
9  Date: May 2004
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "wellmod.h"
16 #include "executor.h"
17 #include "paralleltask.h"
18 #include "bufstringset.h"
19 #include "position.h"
20 #include "ranges.h"
21 #include "enums.h"
22 #include "stattype.h"
23 #include "survinfo.h"
24 #include "uistrings.h"
25 
26 class DataPointSet;
27 class IODirEntryList;
28 class IOObj;
29 class IODir;
30 template <class T> class Array2DImpl;
31 
32 
33 namespace Well
34 {
35 class Log;
36 class Info;
37 class D2TModel;
38 class Data;
39 class Track;
40 class Marker;
41 class MarkerSet;
42 
48 { mODTextTranslationClass(ZRangeSelector);
49 public :
50  ZRangeSelector() { setEmpty(); }
51  ZRangeSelector(const ZRangeSelector&);
52  virtual ~ZRangeSelector() {}
53 
54 
55  enum ZSelection { Markers, Depths, Times };
57 
59 
60  static const char* sKeyTopMrk();
61  static const char* sKeyBotMrk();
62  static const char* sKeyDataStart();
63  static const char* sKeyDataEnd();
64  static const char* sKeyLimits();
65  static const char* sKeyZSelection();
66  static const char* sKeyZRange();
67  static const char* sKeySnapZRangeToSurvey();
68 
69  virtual void usePar(const IOPar&);
70  virtual void fillPar(IOPar&) const;
71 
72  virtual void setEmpty();
73  virtual bool isOK(uiString* errmsg=0) const;
74 
75  //set
76  void setTopMarker(const char* nm,float offset)
77  { setMarker( true, nm, offset); }
78  void setBotMarker(const char* nm,float offset)
79  { setMarker( false, nm, offset); }
80  void setFixedRange(Interval<float>,bool istime);
81  void snapZRangeToSurvey(bool yn)
82  { snapzrgtosurvey_ = yn; }
83 
84  //get
85  Interval<float> calcFrom(const Data&,const BufferStringSet& logs,
86  bool todah=true) const;
87 
88  float topOffset() const { return above_; }
89  float botOffset() const { return below_; }
90  const char* topMarker() const { return topmrkr_; }
91  const char* botMarker() const { return botmrkr_; }
92  Interval<float> getFixedRange() const { return fixedzrg_; }
93  bool isInTime() const { return zselection_ == Times; }
94 
95 protected:
96 
100  float above_;
101  float below_;
103 
104  void setMarker(bool top,BufferString nm,float offset);
105  void getMarkerRange(const Data&,Interval<float>&) const;
106  void getLimitPos(const MarkerSet&,bool,float&,
107  const Interval<float>&) const;
108  void snapZRangeToSurvey(Interval<float>&,bool,
109  const D2TModel*,
110  const Track&) const;
111 };
112 
113 
120 public:
121  ExtractParams() { setEmpty(); }
123 
124  void usePar(const IOPar&);
125  void fillPar(IOPar&) const;
126 
127  void setEmpty();
128  bool isOK(uiString* errmsg=0) const;
129 
130  static const char* sKeySamplePol();
131  static const char* sKeyZExtractInTime();
132  float getZStep() const;
133 
134  float zstep_; //can be in time
136  Stats::UpscaleType samppol_;
137 };
138 
139 
146 public:
147 
148  InfoCollector(bool wellloginfo=true,
149  bool markers=true,
150  bool trackinfo=false);
151  ~InfoCollector();
152 
153  int nextStep();
154  uiString uiMessage() const { return curmsg_; }
156  return tr("Wells inspected");
157  }
158  od_int64 nrDone() const { return curidx_; }
159  od_int64 totalNr() const { return totalnr_; }
160 
161  const ObjectSet<MultiID>& ids() const { return ids_; }
162  const ObjectSet<Info>& infos() const { return infos_; }
164  const ObjectSet<MarkerSet>& markers() const { return markers_; }
166  const ObjectSet<BufferStringSet>& logs() const { return logs_; }
168  const Interval<float> getTracksTVDRange() const {return trackstvdrg_;}
169 
170 protected:
171 
177  const IODir* iodir_;
178  int totalnr_;
179  int curidx_;
181  bool domrkrs_;
182  bool dologs_;
183  bool dotracks_;
185 
186 };
187 
188 
196 public:
197 
198  TrackSampler(const BufferStringSet& ioobjids,
200  bool zvalsintime);
201 
202  float locradius_;
203  bool for2d_;
204  bool minidps_;
205  bool mkdahcol_;
207 
209 
210  void usePar(const IOPar&);
211 
212  int nextStep();
213  uiString uiMessage() const { return tr("Scanning well tracks"); }
214  uiString uiNrDoneText() const { return tr("Wells inspected"); }
215  od_int64 nrDone() const { return curid_; }
216  od_int64 totalNr() const { return ids_.size(); }
217 
218  uiString errMsg() const
219  { return errmsg_.isEmpty() ? uiString::emptyString()
220  : errmsg_; }
221 
222  const BufferStringSet& ioObjIds() const { return ids_; }
224 
225  static const char* sKeySelRadius();
226  static const char* sKeyDahCol();
227  static const char* sKeyFor2D();
228  static const char* sKeyLogNm();
229 
230 protected:
231 
234  int curid_;
235  const bool zistime_;
239 
240  void getData(const Data&,DataPointSet&);
241  bool getPos(const Data&,float,BinIDValue&,int&,
242  Coord3&) const;
243  void addPosns(DataPointSet&,const BinIDValue&,
244  const Coord3&,float dah) const;
245 };
246 
247 
255 public:
256 
257  LogDataExtracter(const BufferStringSet& ioobjids,
259  bool zvalsintime);
260 
262  Stats::UpscaleType samppol_;
263  static const char* sKeyLogNm();
264 
265  void usePar(const IOPar&);
266 
267  int nextStep();
268  uiString uiMessage() const { return msg_; }
269  uiString uiNrDoneText() const { return tr("Wells handled"); }
270  od_int64 nrDone() const { return curid_; }
271  od_int64 totalNr() const { return ids_.size(); }
272 
273  const BufferStringSet& ioObjIds() const { return ids_; }
274 
275  static float calcVal(const Log&,float dah,float winsz,
276  Stats::UpscaleType samppol);
277 
278 protected:
279 
282  int curid_;
283  const bool zistime_;
285 
286  void getData(DataPointSet&,const Data&,const Track&);
287  void getGenTrackData(DataPointSet&,const Track&,const Log&,
288  int,int);
289  void addValAtDah(float,const Log&,float,
290  DataPointSet&,int,int) const;
291  float findNearest(const Track&,const BinIDValue&,
292  float,float,float) const;
293 };
294 
295 
302 public:
304  const Well::D2TModel*,
305  bool extrapolate_ = false,
306  bool stayinsidesurvey = false);
307 
309  { extrintv_ = intv; } //In time if d2TModel is provided
310 
311  int nextStep();
312  od_int64 totalNr() const { return extrintv_.nrSteps(); }
313  od_int64 nrDone() const { return nrdone_; }
314  uiString uiMessage() const { return m3Dots(tr("Computing")); }
315  uiString uiNrDoneText() const { return tr("Points done"); }
316 
317  void getBIDs(TypeSet<BinID>& bs) const { bs = bidset_; }
318  void getCoords(TypeSet<Coord>& cs) const { cs = coords_; }
319 
320 protected:
322 
325 
328 
332  int nrdone_;
333 };
334 
335 
343 public:
344  LogSampler(const Well::Data& wd,
345  const Well::ExtractParams&,
346  const BufferStringSet& lognms);
347 
348  LogSampler(const Well::Data& wd,
349  const Interval<float>& zrg, bool zrgintime,
350  float zstep, bool extractintime,
351  Stats::UpscaleType samppol,
352  const BufferStringSet& lognms);
353 
354  LogSampler(const Well::D2TModel* d2t,
355  const Well::Track* track,
356  const Interval<float>& zrg, bool zrgintime,
357  float zstep, bool extractintime,
358  Stats::UpscaleType samppol,
359  const ObjectSet<const Well::Log>& logs);
360 
361  ~LogSampler();
362 
363  //avalaible after execution
364  float getDah(int idz) const;
365  float getLogVal(int logidx,int idz) const;
366  float getLogVal(const char* lognm,int idx) const;
367  float getThickness(int idz) const;
369 
370  uiString errMsg() const
371  { return errmsg_.isEmpty() ? uiString::emptyString()
372  : errmsg_; }
373 
374  int nrZSamples() const;
375  Interval<float> zRange() const { return zrg_; } //can be in time
376 
377 protected:
378  void init (const Well::D2TModel*,const Interval<float>&,
379  bool zrgintime,float zstep, bool extractintime,
380  Stats::UpscaleType samppol);
381 
382  od_int64 nrIterations() const;
383 
384  bool doLog(int logidx);
385  bool doPrepare(int);
386  bool doWork(od_int64,od_int64,int);
387 
391  float zstep_;
397  Stats::UpscaleType samppol_;
398 };
399 
400 }; // namespace Well
401 
402 
403 #endif
uiString msg_
Definition: wellextractdata.h:284
ObjectSet< DataPointSet > & dpss_
Definition: wellextractdata.h:281
#define mExpClass(module)
Definition: commondefs.h:160
ExtractParams()
Definition: wellextractdata.h:121
Stats::UpscaleType samppol_
Definition: wellextractdata.h:262
const IODir * iodir_
Definition: wellextractdata.h:177
Set of Markers.
Definition: wellmarker.h:76
uiString uiNrDoneText() const
will be nrDoneText() in 7.x
Definition: wellextractdata.h:315
ExtractParams params_
Definition: wellextractdata.h:208
uiString errmsg_
Definition: wellextractdata.h:238
const BufferStringSet & ids_
Definition: wellextractdata.h:280
Stats::UpscaleType samppol_
Definition: wellextractdata.h:136
const ObjectSet< MarkerSet > & markers() const
If selected, same size as ids()
Definition: wellextractdata.h:164
bool extrapolate_
Definition: wellextractdata.h:327
void snapZRangeToSurvey(bool yn)
Definition: wellextractdata.h:81
uiString uiMessage() const
will be message() again in 7.x
Definition: wellextractdata.h:154
Definition: ioobj.h:58
Depth to time model.
Definition: welld2tmodel.h:34
Set of data points with group selection.
Definition: datapointset.h:48
od_int64 nrDone() const
Definition: wellextractdata.h:270
bool isInTime() const
Definition: wellextractdata.h:93
BufferString topmrkr_
Definition: wellextractdata.h:98
Collects positions along selected well tracks. The DataPointSet will get new rows with the positions ...
Definition: wellextractdata.h:194
void setSampling(const StepInterval< float > &intv)
Definition: wellextractdata.h:308
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
TypeSet< BinID > bidset_
Definition: wellextractdata.h:323
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:188
Well log.
Definition: welllog.h:44
bool minidps_
Definition: wellextractdata.h:204
#define od_int64
Definition: plftypes.h:36
od_int64 nrDone() const
Definition: wellextractdata.h:158
BufferString lognm_
Definition: wellextractdata.h:261
bool init()
const ObjectSet< Info > & infos() const
Same size as ids()
Definition: wellextractdata.h:162
ObjectSet< DataPointSet > & dataPointSets()
Definition: wellextractdata.h:223
const Well::Track & track_
Definition: wellextractdata.h:330
Implementation of Array2D.
Definition: arrayndimpl.h:102
ZRangeSelector to extract parameters.
Definition: wellextractdata.h:118
static const uiString & emptyString()
Definition: uistring.h:109
Definition: file.h:99
od_int64 totalNr() const
Definition: wellextractdata.h:271
bool for2d_
Definition: wellextractdata.h:203
float zstep_
Definition: wellextractdata.h:391
Definition: uistring.h:89
od_int64 nrDone() const
Definition: wellextractdata.h:313
void setBotMarker(const char *nm, float offset)
Definition: wellextractdata.h:78
bool mkdahcol_
Definition: wellextractdata.h:205
Collects information about all wells in store.
Definition: wellextractdata.h:144
uiString uiMessage() const
will be message() again in 7.x
Definition: wellextractdata.h:314
Set of BufferString objects.
Definition: bufstringset.h:28
const Well::D2TModel * d2t_
Definition: wellextractdata.h:388
bool dotracks_
Definition: wellextractdata.h:183
StepInterval< float > extrintv_
Definition: wellextractdata.h:321
od_int64 totalNr() const
Definition: wellextractdata.h:312
bool isinsidesurvey_
Definition: wellextractdata.h:326
#define mDeclareEnumUtils(enm)
Some utilities surrounding the often needed enum <-> string table.
Definition: enums.h:258
Generalization of a task that can be run in parallel.
Definition: paralleltask.h:66
ZSelection
Definition: wellextractdata.h:55
uiString errMsg() const
Definition: wellextractdata.h:218
uiString errMsg() const
Definition: wellextractdata.h:370
float zstep_
Definition: wellextractdata.h:134
Stats::UpscaleType samppol_
Definition: wellextractdata.h:397
int curid_
Definition: wellextractdata.h:234
const ObjectSet< MultiID > & ids() const
Definition: wellextractdata.h:161
Interval< float > getFixedRange() const
Definition: wellextractdata.h:92
od_int64 totalNr() const
Definition: wellextractdata.h:216
uiString uiNrDoneText() const
will be nrDoneText() in 7.x
Definition: wellextractdata.h:214
bool snapzrgtosurvey_
Definition: wellextractdata.h:102
ObjectSet< BufferStringSet > logs_
Definition: wellextractdata.h:175
Parameters (zrg, sampling method) to extract well data.
Definition: wellextractdata.h:47
bool zrgisintime_
Definition: wellextractdata.h:393
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
uiString errmsg_
Definition: wellextractdata.h:396
int curid_
Definition: wellextractdata.h:282
const char * topMarker() const
Definition: wellextractdata.h:90
Definition: directionalsurvey.h:19
uiString uiMessage() const
will be message() again in 7.x
Definition: wellextractdata.h:213
bool dologs_
Definition: wellextractdata.h:182
TypeSet< Coord > coords_
Definition: wellextractdata.h:324
Well track.
Definition: welltrack.h:29
ObjectSet< MultiID > ids_
Definition: wellextractdata.h:172
Interval< float > zRange() const
Definition: wellextractdata.h:375
BinID and a value.
Definition: binidvalue.h:31
virtual ~ZRangeSelector()
Definition: wellextractdata.h:52
ObjectSet< Info > infos_
Definition: wellextractdata.h:173
ObjectSet< MarkerSet > markers_
Definition: wellextractdata.h:174
ZSelection zselection_
Definition: wellextractdata.h:58
Collects positions along selected well tracks. Will add column to the DataPointSet.
Definition: wellextractdata.h:253
float locradius_
Definition: wellextractdata.h:202
void getCoords(TypeSet< Coord > &cs) const
Definition: wellextractdata.h:318
ObjectSet< const Well::Log > logset_
Definition: wellextractdata.h:394
const Well::Track & track_
Definition: wellextractdata.h:389
uiString curmsg_
Definition: wellextractdata.h:180
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:175
Interval< float > trackstvdrg_
Definition: wellextractdata.h:184
A cartesian coordinate in 3D space.
Definition: coord.h:72
Definition: repos.h:25
uiString uiNrDoneText() const
will be nrDoneText() in 7.x
Definition: wellextractdata.h:269
list of dir entries.
Definition: iodirentry.h:38
BufferStringSet lognms_
Definition: wellextractdata.h:206
const bool zistime_
Definition: wellextractdata.h:235
const char * botMarker() const
Definition: wellextractdata.h:91
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
bool extractzintime_
Definition: wellextractdata.h:135
bool isEmpty() const
Definition: odstring.h:51
IODirEntryList * direntries_
Definition: wellextractdata.h:176
int nrdone_
Definition: wellextractdata.h:332
BufferString errmsg_
Definition: horizontracker.h:119
int totalnr_
Definition: wellextractdata.h:178
bool extrintime_
Definition: wellextractdata.h:392
float below_
Definition: wellextractdata.h:101
Interval< float > zrg_
Definition: wellextractdata.h:390
bool domrkrs_
Definition: wellextractdata.h:181
od_int64 totalNr() const
Definition: wellextractdata.h:159
const ObjectSet< BufferStringSet > & logs() const
If selected, same size as ids()
Definition: wellextractdata.h:166
const bool zistime_
Definition: wellextractdata.h:283
const BufferStringSet & ioObjIds() const
Definition: wellextractdata.h:273
Executor to sample Well::Track.
Definition: wellextractdata.h:300
ZRangeSelector()
Definition: wellextractdata.h:50
Definition: iodir.h:36
int curidx_
Definition: wellextractdata.h:179
const BufferStringSet & ioObjIds() const
Definition: wellextractdata.h:222
BufferString botmrkr_
Definition: wellextractdata.h:99
const Interval< float > getTracksTVDRange() const
Definition: wellextractdata.h:168
const BufferStringSet & ids_
Definition: wellextractdata.h:232
The holder of all data concerning a certain well.
Definition: welldata.h:113
Interval< float > zrg_
Definition: wellextractdata.h:236
Interval< float > tracklimits_
Definition: wellextractdata.h:329
float botOffset() const
Definition: wellextractdata.h:89
uiString uiMessage() const
will be message() again in 7.x
Definition: wellextractdata.h:268
void setTopMarker(const char *nm, float offset)
Definition: wellextractdata.h:76
Interval< float > fixedzrg_
Definition: wellextractdata.h:97
const Well::D2TModel * d2t_
Definition: wellextractdata.h:331
uiString uiNrDoneText() const
will be nrDoneText() in 7.x
Definition: wellextractdata.h:155
od_int64 nrDone() const
Definition: wellextractdata.h:215
#define m3Dots(txt)
Definition: uistrings.h:548
float topOffset() const
Definition: wellextractdata.h:88
int dahcolnr_
Definition: wellextractdata.h:237
void getBIDs(TypeSet< BinID > &bs) const
Definition: wellextractdata.h:317
Log resampler, extracts all the logs given by log names along a z time or dah axis.
Definition: wellextractdata.h:341
float above_
Definition: wellextractdata.h:100
ObjectSet< DataPointSet > & dpss_
Definition: wellextractdata.h:233
Specification to enable chunkwise execution of a process.
Definition: executor.h:39
Array2DImpl< float > * data_
Definition: wellextractdata.h:395

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