OpendTect-6_4  6.4
velocitycalc.h
Go to the documentation of this file.
1 #ifndef velocitycalc_h
2 #define velocitycalc_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: K. Tingdahl
9  Date: Dec 2007
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 
16 #include "algomod.h"
17 #include "samplingdata.h"
18 #include "veldesc.h"
19 #include "keystrs.h"
20 #include "factory.h"
21 #include "uistring.h"
22 
23 template <class T> class ValueSeries;
24 
32 { mODTextTranslationClass(TimeDepthModel)
33 public:
34  TimeDepthModel();
35  TimeDepthModel(const TimeDepthModel&);
36  virtual ~TimeDepthModel();
37 
38  TimeDepthModel& operator=(const TimeDepthModel&);
39  virtual bool isOK() const;
40  const char* errMsg() const;
41  int size() const { return sz_; }
42 
43  bool setModel(const float* dpths,const float* times,int sz);
44 
45  float getDepth(float time) const;
46  float getTime(float depth) const;
47  float getVelocity(float depth) const;
48  float getFirstTime() const;
49  float getLastTime() const;
50 
51  static float getDepth(const float* dpths,const float* times,int sz,
52  float time);
53  static float getTime(const float* dpths,const float* times,int sz,
54  float depth);
55  static float getVelocity(const float* dpths,const float* times,
56  int sz,float depth);
57 
58  // use only if you're sure about what you're doing
59  float getDepth(int idx) const;
60  float getTime(int idx) const;
61 
62 protected:
63 
64  static float convertTo(const float* dpths,const float* times,int sz,
65  float z,bool targetistime);
66 
67  int sz_;
68 
69  float* times_;
70  float* depths_;
71 
73 };
74 
75 
82 public:
84 
85  bool isOK() const;
86  static bool isVelocityDescUseable(const VelocityDesc&,
87  bool velintime,
88  uiString* errmsg = 0);
89 
90  bool setVelocityModel(const ValueSeries<float>& vels, int sz,
91  const SamplingData<double>& sd,
92  const VelocityDesc&,bool istime);
93 
94  bool calcDepths(ValueSeries<float>&, int sz,
95  const SamplingData<double>& timesamp) const;
96  bool calcTimes(ValueSeries<float>&, int sz,
97  const SamplingData<double>& depthsamp) const;
98 
99  static bool calcDepths(const ValueSeries<float>& vels,int velsz,
100  const SamplingData<double>&,float* depths);
103  static bool calcDepths(const ValueSeries<float>& vels,int velsz,
104  const ValueSeries<double>& times,
105  double* depths);
106  static bool mDeprecated calcDepths(const ValueSeries<float>& vels,
107  int velsz,const ValueSeries<float>& times,
108  float* depths);
111  static bool calcTimes(const ValueSeries<float>& vels,int velsz,
112  const ValueSeries<float>& depth,float* times);
115  static bool calcTimes(const ValueSeries<float>& vels, int velsz,
116  const SamplingData<double>&, float* times);
118 protected:
119 
120  void calcZ(const float*,int inpsz,
121  ValueSeries<float>&,int outpsz,
122  const SamplingData<double>&,bool istime) const;
123 
124  float firstvel_;
125  float lastvel_;
126 
128  int sz_;
130 };
131 
132 
138 { mODTextTranslationClass(MoveoutComputer)
139 public:
140  virtual ~MoveoutComputer() {}
141 
142  virtual int nrVariables() const = 0;
143  virtual const char* variableName(int) const = 0;
144 
145  virtual bool computeMoveout(const float* variables,
146  int nroffsets,
147  const float* offsets,
148  float* res) const = 0;
149  float findBestVariable(float* variables, int variabletochange,
150  const Interval<float>& searchrg,int nroffsets,
151  const float* offsets, const float* moveout ) const;
155 };
156 
157 
164 public:
165  int nrVariables() const { return 3; }
166  const char* variableName(int idx) const
167  {
168  switch ( idx )
169  {
170  case 0: return sKey::Depth();
171  case 1: return "RMO";
172  case 2: return "Reference offset";
173  };
174 
175  return 0;
176  }
177  bool computeMoveout(const float*,int,const float*,float*) const;
178  static bool computeMoveout(float d0, float rmo, float refoffset,
179  int,const float*,float*);
180 };
181 
182 
190 public:
191  int nrVariables() const { return 3; }
192  const char* variableName( int idx ) const
193  {
194  switch ( idx )
195  {
196  case 0: return sKey::Time();
197  case 1: return "Vrms";
198  case 2: return "Effective anisotrophy";
199  };
200 
201  return 0;
202  }
203  bool computeMoveout(const float*,int,const float*,float*) const;
204  static bool computeMoveout(float t0, float Vrms, float effectiveanisotropy,
205  int,const float*,float*);
206 };
207 
212 mGlobal(Algo) bool computeDix(const float* Vrms, double t0, float v0,
213  const double* t, int nrlayers, float* Vint);
214 
215 mGlobal(Algo) bool mDeprecated computeDix(const float* Vrms, float t0, float v0,
216  const float* t, int nrlayers, float* Vint);
217 
223 { mODTextTranslationClass(Vrms2Vint)
224 public:
225  mDefineFactoryInClass( Vrms2Vint, factory );
226  virtual ~Vrms2Vint() {}
227 
228  virtual bool compute(const float* Vrms, float t0, float v0,
229  const float* t, int nrlayers, float* Vint) = 0;
230 };
231 
232 
239 public:
241  "Dix",
242  toUiString(sFactoryKeyword()));
243 
244  bool compute(const float* Vrms, double t0, float v0,
245  const double* t, int nrlayers, float* Vint)
246  { return computeDix( Vrms, t0, v0, t, nrlayers, Vint ); }
247 
249  bool compute(const float* Vrms, float t0, float v0,
250  const float* t, int nrlayers, float* Vint)
251  { return computeDix( Vrms, t0, v0, t, nrlayers, Vint ); }
253 };
254 
255 
256 
260 mGlobal(Algo) bool computeDix(const float* Vrms,const SamplingData<double>& sd,
261  int nrvels,float* Vint);
262 
267 mGlobal(Algo) bool computeDix(const float* Vrms, double t0, float v0,
268  const double* t, int nrlayers, float* Vint);
269 
270 mGlobal(Algo) bool mDeprecated computeDix(const float* Vrms, float t0, float v0,
271  const float* t, int nrlayers, float* Vint);
272 
273 
276 mGlobal(Algo) bool computeVrms(const float* Vint,const SamplingData<double>& sd,
277  int nrvels, float* Vrms);
278 
283 mGlobal(Algo) bool computeVrms(const float* Vint,double t0,const double* t,
284  int nrlayers, float* Vrms);
285 
286 mGlobal(Algo) bool mDeprecated computeVrms(const float* Vint,float t0,
287  const float* t, int nrlayers, float* Vrms);
288 
289 
294 mGlobal(Algo) bool sampleVrms(const float* Vin,double t0_in,float v0_in,
295  const double* t_in, int nr_in,
296  const SamplingData<double>& sd_out,
297  float* Vout, int nr_out);
298 
299 mGlobal(Algo) bool mDeprecated sampleVrms(const float* Vin,float t0_in,
300  float v0_in,const float* t_in, int nr_in,
301  const SamplingData<double>& sd_out,
302  float* Vout, int nr_out);
303 
305 
306 mGlobal(Algo) bool computeVavg(const float* Vint,const double* t,int nrvels,
307  float* Vavg);
308 
309 mGlobal(Algo) bool mDeprecated computeVavg(const float* Vint, float t0,
310  const float* t, int nrvels, float* Vavg);
311 
313 
314 mGlobal(Algo) bool computeVint(const float* Vavg,const double* t,int nrvels,
315  float* Vint);
316 
317 mGlobal(Algo) bool mDeprecated computeVint(const float* Vavg, float t0,
318  const float* t, int nrvels, float* Vint);
319 
320 
325 mGlobal(Algo) bool sampleVint(const float* Vint,const double* t_in,int nr_in,
326  const SamplingData<double>& sd_out,float* Vout,
327  int nr_out);
328 
329 mGlobal(Algo) bool mDeprecated sampleVint(const float* Vint,const float* t_in,
330  int nr_in,
331  const SamplingData<double>& sd_out, float* Vout,
332  int nr_out);
333 
338 mGlobal(Algo) bool sampleVavg(const float* Vavg,const double* t_in,int nr_in,
339  const SamplingData<double>& sd_out,float* Vout,
340  int nr_out);
341 
342 mGlobal(Algo) bool mDeprecated sampleVavg(const float* Vavg, const float* t_in,
343  int nr_in,
344  const SamplingData<double>& sd_out, float* Vout,
345  int nr_out);
346 
350 mGlobal(Algo) void computeResidualMoveouts(float z0,float rmo,float refoffset,
351  int nroffsets,bool outputdepth,
352  const float* offsets,float* output);
353 
357 mGlobal(Algo) bool fitLinearVelocity( const float* Vint, const float* z_in,
358  int nr_in, const Interval<float>& zlayer,
359  float reference_z, bool zisdepth, float& V_0,
360  float& gradient, float& error);
361 
362 
367 mGlobal(Algo) void resampleZ(const double* zarr,const double* tord_in,int nr_in,
368  const SamplingData<double>& sd_out,int nr_out,
369  double* zsampled);
370 
371 mGlobal(Algo) void mDeprecated resampleZ(const float* zarr,const float* tord_in,
372  int nr_in,
373  const SamplingData<double>& sd_out, int nr_out,
374  float* zsampled);
375 
376 
380 mGlobal(Algo) void sampleEffectiveThomsenPars(const float* vinarr,
381  const double* t_in,int nr_in,const SamplingData<double>& sd_out,
382  int nr_out,float* voutarr);
383 
384 mGlobal(Algo) void mDeprecated sampleEffectiveThomsenPars(const float* vinarr,
385  const float* t_in,int nr_in,const SamplingData<double>& sd_out,
386  int nr_out,float* voutarr);
387 
388 
392 mGlobal(Algo) void sampleIntvThomsenPars(const float* inarr,const double* t_in,
393  int nr_in,const SamplingData<double>& sd_out,
394  int nr_out,float* outarr);
395 
396 mGlobal(Algo) void mDeprecated sampleIntvThomsenPars(const float* inarr,
397  const float* t_in,int nr_in,
398  const SamplingData<double>& sd_out,int nr_out,
399  float* outarr);
400 
401 
402 /* Utility function for Depth and effective Thomsen parameters resampling*/
403 mGlobal(Algo) void resampleContinuousData(const double* in,const double* t_in,
404  int nr_in,const SamplingData<double>& sd_out,
405  int nr_out,double* outarr);
406 
407 mGlobal(Algo) void mDeprecated resampleContinuousData(const float* inarr,
408  const float* t_in,
409  int nr_in,const SamplingData<double>& sd_out,
410  int nr_out,float* outarr);
411 
412 
416 mGlobal(Algo) bool computeLinearT2D( double v0, double dv, double v0depth,
417  const SamplingData<float>& timesampling,
418  int sz, float* res );
419 
423 mGlobal(Algo) bool computeLinearD2T( double v0, double dv, double v0depth,
424  const SamplingData<float>& depthsampling,
425  int sz, float* res );
426 
427 
428 mGlobal(Algo) bool convertToVintIfNeeded(const float* inpvel,
429  const VelocityDesc& veldesc,
430  const StepInterval<float>& zrange,
431  float* outvel);
432 
434  const SamplingData<float>&);
435 
436 #endif
mODTextTranslationClass(DixConversion) public bool compute(const float *Vrms, double t0, float v0, const double *t, int nrlayers, float *Vint)
Definition: velocitycalc.h:244
#define mExpClass(module)
Definition: commondefs.h:160
Rms velocity to interval velocity conversion.
Definition: velocitycalc.h:222
void sampleEffectiveThomsenPars(const float *vinarr, const double *t_in, int nr_in, const SamplingData< double > &sd_out, int nr_out, float *voutarr)
int sz_
Definition: velocitycalc.h:67
float * times_
Definition: velocitycalc.h:69
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
Export_Basic uiString toUiString(ViewStyle)
bool computeLinearD2T(double v0, double dv, double v0depth, const SamplingData< float > &depthsampling, int sz, float *res)
#define mGlobal(module)
Definition: commondefs.h:163
bool sampleVint(const float *Vint, const double *t_in, int nr_in, const SamplingData< double > &sd_out, float *Vout, int nr_out)
mODTextTranslationClass(MoveoutComputer) public
Definition: velocitycalc.h:138
bool sampleVrms(const float *Vin, double t0_in, float v0_in, const double *t_in, int nr_in, const SamplingData< double > &sd_out, float *Vout, int nr_out)
Definition: veldesc.h:38
uiString errmsg_
Definition: velocitycalc.h:72
bool computeVrms(const float *Vint, const SamplingData< double > &sd, int nrvels, float *Vrms)
bool computeVavg(const float *Vint, const double *t, int nrvels, float *Vavg)
Converts a number of layers with Vint to average velocities.
SamplingData< double > sd_
Definition: velocitycalc.h:129
bool sampleVavg(const float *Vavg, const double *t_in, int nr_in, const SamplingData< double > &sd_out, float *Vout, int nr_out)
mStartAllowDeprecatedSection bool compute(const float *Vrms, float t0, float v0, const float *t, int nrlayers, float *Vint)
Definition: velocitycalc.h:249
#define mDefaultFactoryInstantiation(baseclss, clss, keywrd, usernm)
Definition: factory.h:289
bool fitLinearVelocity(const float *Vint, const float *z_in, int nr_in, const Interval< float > &zlayer, float reference_z, bool zisdepth, float &V_0, float &gradient, float &error)
Definition: uistring.h:89
bool computeDix(const float *Vrms, double t0, float v0, const double *t, int nrlayers, float *Vint)
float firstvel_
Definition: velocitycalc.h:124
float lastvel_
Definition: velocitycalc.h:125
Base class for computing a moveout curve.
Definition: velocitycalc.h:137
virtual bool isOK() const
Definition: valseries.h:41
Computes moveout in depth from RMO at a certain reference offset.
Definition: velocitycalc.h:162
void computeResidualMoveouts(float z0, float rmo, float refoffset, int nroffsets, bool outputdepth, const float *offsets, float *output)
#define mStartAllowDeprecatedSection
Definition: plfdefs.h:235
virtual mODTextTranslationClass(Vrms2Vint) public ~Vrms2Vint()
Definition: velocitycalc.h:226
#define mStopAllowDeprecatedSection
Definition: plfdefs.h:236
bool regularinput_
Definition: velocitycalc.h:127
Interface to a series of values.
Definition: odmemory.h:17
Converts between time and depth given a model.
Definition: velocitycalc.h:80
#define mDefineFactoryInClass(T, funcname)
Definition: factory.h:426
Computes moveout with anisotropy, according to the equation by Alkhalifah and Tsvankin 1995...
Definition: velocitycalc.h:188
SamplingData< double > getDoubleSamplingData(const SamplingData< float > &)
bool computeLinearT2D(double v0, double dv, double v0depth, const SamplingData< float > &timesampling, int sz, float *res)
#define mDeprecated
Definition: plfdefs.h:233
FixedString Time()
Definition: keystrs.h:132
void resampleContinuousData(const double *in, const double *t_in, int nr_in, const SamplingData< double > &sd_out, int nr_out, double *outarr)
Rms velocity to interval velocity conversion using the Dix formula.
Definition: velocitycalc.h:237
void sampleIntvThomsenPars(const float *inarr, const double *t_in, int nr_in, const SamplingData< double > &sd_out, int nr_out, float *outarr)
bool convertToVintIfNeeded(const float *inpvel, const VelocityDesc &veldesc, const StepInterval< float > &zrange, float *outvel)
bool computeVint(const float *Vavg, const double *t, int nrvels, float *Vint)
Converts a number of layers with Vavg to Vint velocities.
const char * errMsg() const
Definition: horizontracker.h:61
int size() const
Definition: velocitycalc.h:41
void resampleZ(const double *zarr, const double *tord_in, int nr_in, const SamplingData< double > &sd_out, int nr_out, double *zsampled)
Converts between time, depth and velocity given a model. The velocity model can be either RMO-velocit...
Definition: velocitycalc.h:31
int sz_
Definition: velocitycalc.h:128
float * depths_
Definition: velocitycalc.h:70
FixedString Depth()
Definition: keystrs.h:60

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