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

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