OpendTect  6.6
velocitycalc.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: K. Tingdahl
8  Date: Dec 2007
9  RCS: $Id$
10 ________________________________________________________________________
11 
12 -*/
13 
14 
15 #include "algomod.h"
16 #include "samplingdata.h"
17 #include "veldesc.h"
18 #include "keystrs.h"
19 #include "factory.h"
20 #include "uistring.h"
21 
22 template <class T> class ValueSeries;
23 
32 public:
35  virtual ~TimeDepthModel();
36 
38  virtual bool isOK() const;
39  const char* errMsg() const;
40  int size() const { return sz_; }
41 
42  bool setModel(const float* dpths,const float* times,int sz);
43 
44  float getDepth(float time) const;
45  float getTime(float depth) const;
46  float getVelocity(float depth) const;
47  float getFirstTime() const;
48  float getLastTime() const;
49 
50  static float getDepth(const float* dpths,const float* times,int sz,
51  float time);
52  static float getTime(const float* dpths,const float* times,int sz,
53  float depth);
54  static float getVelocity(const float* dpths,const float* times,
55  int sz,float depth);
56 
57  // use only if you're sure about what you're doing
58  float getDepth(int idx) const;
59  float getTime(int idx) const;
60 
61 protected:
62 
63  static float convertTo(const float* dpths,const float* times,int sz,
64  float z,bool targetistime);
65 
66  int sz_;
67 
68  float* times_;
69  float* depths_;
70 
72 };
73 
74 
81 public:
83 
84  bool isOK() const;
85  static bool isVelocityDescUseable(const VelocityDesc&,
86  bool velintime,
87  uiString* errmsg = 0);
88 
89  bool setVelocityModel(const ValueSeries<float>& vels, int sz,
90  const SamplingData<double>& sd,
91  const VelocityDesc&,bool istime);
92 
94  const SamplingData<double>& timesamp) const;
96  const SamplingData<double>& depthsamp) const;
97 
98  static bool calcDepths(const ValueSeries<float>& vels,int velsz,
99  const SamplingData<double>&,float* depths);
102  static bool calcDepths(const ValueSeries<float>& vels,int velsz,
103  const ValueSeries<double>& times,
104  double* depths);
108  static bool calcDepths(const ValueSeries<float>& vels,
109  int velsz,const ValueSeries<float>& times,
110  float* depths);
111 
112  static bool calcTimes(const ValueSeries<float>& vels,int velsz,
113  const ValueSeries<float>& depth,float* times);
116  static bool calcTimes(const ValueSeries<float>& vels, int velsz,
117  const SamplingData<double>&, float* times);
119 protected:
120 
121  void calcZ(const float*,int inpsz,
122  ValueSeries<float>&,int outpsz,
123  const SamplingData<double>&,bool istime) const;
124 
125  float firstvel_;
126  float lastvel_;
127 
129  int sz_;
131 };
132 
133 
140 public:
141  virtual ~MoveoutComputer() {}
142 
143  virtual int nrVariables() const = 0;
144  virtual const char* variableName(int) const = 0;
145 
146  virtual bool computeMoveout(const float* variables,
147  int nroffsets,
148  const float* offsets,
149  float* res) const = 0;
150  float findBestVariable(float* variables, int variabletochange,
151  const Interval<float>& searchrg,int nroffsets,
152  const float* offsets, const float* moveout ) const;
156 };
157 
158 
165 public:
166  int nrVariables() const { return 3; }
167  const char* variableName(int idx) const
168  {
169  switch ( idx )
170  {
171  case 0: return sKey::Depth();
172  case 1: return "RMO";
173  case 2: return "Reference offset";
174  };
175 
176  return 0;
177  }
178  bool computeMoveout(const float*,int,const float*,float*) const;
179  static bool computeMoveout(float d0, float rmo, float refoffset,
180  int,const float*,float*);
181 };
182 
183 
191 public:
192  int nrVariables() const { return 3; }
193  const char* variableName( int idx ) const
194  {
195  switch ( idx )
196  {
197  case 0: return sKey::Time();
198  case 1: return "Vrms";
199  case 2: return "Effective anisotrophy";
200  };
201 
202  return 0;
203  }
204  bool computeMoveout(const float*,int,const float*,float*) const;
205  static bool computeMoveout(float t0, float Vrms, float effectiveanisotropy,
206  int,const float*,float*);
207 };
208 
213 mGlobal(Algo) bool computeDix(const float* Vrms, double t0, float v0,
214  const double* t, int nrlayers, float* Vint);
215 
217 mGlobal(Algo) bool computeDix(const float* Vrms, float t0, float v0,
218  const float* t, int nrlayers, float* Vint);
219 
226 public:
227  mDefineFactoryInClass( Vrms2Vint, factory );
228  virtual ~Vrms2Vint() {}
229 
230  virtual bool compute(const float* Vrms, float t0, float v0,
231  const float* t, int nrlayers, float* Vint) = 0;
232 };
233 
234 
241 public:
243  "Dix",
244  toUiString(sFactoryKeyword()));
245 
246  bool compute(const float* Vrms, double t0, float v0,
247  const double* t, int nrlayers, float* Vint)
248  { return computeDix( Vrms, t0, v0, t, nrlayers, Vint ); }
249 
251  bool compute(const float* Vrms, float t0, float v0,
252  const float* t, int nrlayers, float* Vint)
253  { return computeDix( Vrms, t0, v0, t, nrlayers, Vint ); }
255 };
256 
257 
258 
262 mGlobal(Algo) bool computeDix(const float* Vrms,const SamplingData<double>& sd,
263  int nrvels,float* Vint);
264 
269 mGlobal(Algo) bool computeDix(const float* Vrms, double t0, float v0,
270  const double* t, int nrlayers, float* Vint);
271 
273 mGlobal(Algo) bool computeDix(const float* Vrms, float t0, float v0,
274  const float* t, int nrlayers, float* Vint);
275 
276 
279 mGlobal(Algo) bool computeVrms(const float* Vint,const SamplingData<double>& sd,
280  int nrvels, float* Vrms);
281 
286 mGlobal(Algo) bool computeVrms(const float* Vint,double t0,const double* t,
287  int nrlayers, float* Vrms);
288 
290 mGlobal(Algo) bool computeVrms(const float* Vint,float t0,const float* t,
291  int nrlayers, float* Vrms);
292 
293 
298 mGlobal(Algo) bool sampleVrms(const float* Vin,double t0_in,float v0_in,
299  const double* t_in, int nr_in,
300  const SamplingData<double>& sd_out,
301  float* Vout, int nr_out);
302 
304 mGlobal(Algo) bool sampleVrms(const float* Vin,float t0_in,
305  float v0_in,const float* t_in, int nr_in,
306  const SamplingData<double>& sd_out,
307  float* Vout, int nr_out);
308 
310 
311 mGlobal(Algo) bool computeVavg(const float* Vint,const double* t,int nrvels,
312  float* Vavg);
313 
315 mGlobal(Algo) bool computeVavg(const float* Vint, float t0,
316  const float* t, int nrvels, float* Vavg);
317 
319 
320 mGlobal(Algo) bool computeVint(const float* Vavg,const double* t,int nrvels,
321  float* Vint);
322 
324 mGlobal(Algo) bool computeVint(const float* Vavg, float t0,
325  const float* t, int nrvels, float* Vint);
326 
327 
332 mGlobal(Algo) bool sampleVint(const float* Vint,const double* t_in,int nr_in,
333  const SamplingData<double>& sd_out,float* Vout,
334  int nr_out);
335 
337 mGlobal(Algo) bool sampleVint(const float* Vint,const float* t_in,
338  int nr_in,
339  const SamplingData<double>& sd_out, float* Vout,
340  int nr_out);
341 
346 mGlobal(Algo) bool sampleVavg(const float* Vavg,const double* t_in,int nr_in,
347  const SamplingData<double>& sd_out,float* Vout,
348  int nr_out);
349 
351 mGlobal(Algo) bool sampleVavg(const float* Vavg, const float* t_in,
352  int nr_in,
353  const SamplingData<double>& sd_out, float* Vout,
354  int nr_out);
355 
359 mGlobal(Algo) void computeResidualMoveouts(float z0,float rmo,float refoffset,
360  int nroffsets,bool outputdepth,
361  const float* offsets,float* output);
362 
366 mGlobal(Algo) bool fitLinearVelocity( const float* Vint, const float* z_in,
367  int nr_in, const Interval<float>& zlayer,
368  float reference_z, bool zisdepth, float& V_0,
369  float& gradient, float& error);
370 
371 
376 mGlobal(Algo) void resampleZ(const double* zarr,const double* tord_in,int nr_in,
377  const SamplingData<double>& sd_out,int nr_out,
378  double* zsampled);
379 
381 mGlobal(Algo) void resampleZ(const float* zarr,const float* tord_in,
382  int nr_in,
383  const SamplingData<double>& sd_out, int nr_out,
384  float* zsampled);
385 
386 
390 mGlobal(Algo) void sampleEffectiveThomsenPars(const float* vinarr,
391  const double* t_in,int nr_in,const SamplingData<double>& sd_out,
392  int nr_out,float* voutarr);
393 
395 mGlobal(Algo) void sampleEffectiveThomsenPars(const float* vinarr,
396  const float* t_in,int nr_in,const SamplingData<double>& sd_out,
397  int nr_out,float* voutarr);
398 
399 
403 mGlobal(Algo) void sampleIntvThomsenPars(const float* inarr,const double* t_in,
404  int nr_in,const SamplingData<double>& sd_out,
405  int nr_out,float* outarr);
406 
408 mGlobal(Algo) void sampleIntvThomsenPars(const float* inarr,
409  const float* t_in,int nr_in,
410  const SamplingData<double>& sd_out,int nr_out,
411  float* outarr);
412 
413 
414 /* Utility function for Depth and effective Thomsen parameters resampling*/
415 mGlobal(Algo) void resampleContinuousData(const double* in,const double* t_in,
416  int nr_in,const SamplingData<double>& sd_out,
417  int nr_out,double* outarr);
418 
420 mGlobal(Algo) void resampleContinuousData(const float* inarr,
421  const float* t_in,
422  int nr_in,const SamplingData<double>& sd_out,
423  int nr_out,float* outarr);
424 
425 
429 mGlobal(Algo) bool computeLinearT2D( double v0, double dv, double v0depth,
430  const SamplingData<float>& timesampling,
431  int sz, float* res );
432 
436 mGlobal(Algo) bool computeLinearD2T( double v0, double dv, double v0depth,
437  const SamplingData<float>& depthsampling,
438  int sz, float* res );
439 
440 
441 mGlobal(Algo) bool convertToVintIfNeeded(const float* inpvel,
442  const VelocityDesc& veldesc,
443  const StepInterval<float>& zrange,
444  float* outvel);
445 
447  const SamplingData<float>&);
448 
TimeDepthConverter::isOK
mODTextTranslationClass(TimeDepthConverter) public bool isOK() const
ValueSeries
Interface to a series of values.
Definition: odmemory.h:16
TimeDepthModel::getTime
static float getTime(const float *dpths, const float *times, int sz, float depth)
fitLinearVelocity
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)
TimeDepthModel::setModel
bool setModel(const float *dpths, const float *times, int sz)
TimeDepthModel::getTime
float getTime(float depth) const
TimeDepthConverter::calcDepths
static bool calcDepths(const ValueSeries< float > &vels, int velsz, const ValueSeries< double > &times, double *depths)
sKey::Time
FixedString Time()
Definition: keystrs.h:163
TimeDepthModel::getLastTime
float getLastTime() const
factory.h
uistring.h
keystrs.h
RMOComputer
Computes moveout in depth from RMO at a certain reference offset.
Definition: velocitycalc.h:164
mGlobal
#define mGlobal(module)
Definition: commondefs.h:180
TimeDepthConverter::lastvel_
float lastvel_
Definition: velocitycalc.h:126
TimeDepthModel::getDepth
float getDepth(int idx) const
TimeDepthConverter::calcDepths
static bool calcDepths(const ValueSeries< float > &vels, int velsz, const SamplingData< double > &, float *depths)
TimeDepthConverter::isVelocityDescUseable
static bool isVelocityDescUseable(const VelocityDesc &, bool velintime, uiString *errmsg=0)
File::toUiString
Export_Basic uiString toUiString(ViewStyle)
mDefaultFactoryInstantiation
#define mDefaultFactoryInstantiation(baseclss, clss, keywrd, usernm)
Definition: factory.h:288
mExpClass
#define mExpClass(module)
Definition: commondefs.h:177
resampleZ
void resampleZ(const double *zarr, const double *tord_in, int nr_in, const SamplingData< double > &sd_out, int nr_out, double *zsampled)
samplingdata.h
TimeDepthModel::errmsg_
uiString errmsg_
Definition: velocitycalc.h:71
TimeDepthConverter::calcTimes
static bool calcTimes(const ValueSeries< float > &vels, int velsz, const ValueSeries< float > &depth, float *times)
veldesc.h
TimeDepthModel::convertTo
static float convertTo(const float *dpths, const float *times, int sz, float z, bool targetistime)
computeVint
bool computeVint(const float *Vavg, const double *t, int nrvels, float *Vint)
Converts a number of layers with Vavg to Vint velocities.
TimeDepthConverter::regularinput_
bool regularinput_
Definition: velocitycalc.h:128
computeResidualMoveouts
void computeResidualMoveouts(float z0, float rmo, float refoffset, int nroffsets, bool outputdepth, const float *offsets, float *output)
convertToVintIfNeeded
bool convertToVintIfNeeded(const float *inpvel, const VelocityDesc &veldesc, const StepInterval< float > &zrange, float *outvel)
mODTextTranslationClass
#define mODTextTranslationClass(clss)
Definition: uistring.h:40
TimeDepthConverter::calcTimes
static bool calcTimes(const ValueSeries< float > &vels, int velsz, const SamplingData< double > &, float *times)
DixConversion::compute
mStartAllowDeprecatedSection bool compute(const float *Vrms, float t0, float v0, const float *t, int nrlayers, float *Vint)
Definition: velocitycalc.h:251
getDoubleSamplingData
SamplingData< double > getDoubleSamplingData(const SamplingData< float > &)
TimeDepthModel::getDepth
static float getDepth(const float *dpths, const float *times, int sz, float time)
TimeDepthConverter::sz_
int sz_
Definition: velocitycalc.h:129
MoveoutComputer::computeMoveout
virtual bool computeMoveout(const float *variables, int nroffsets, const float *offsets, float *res) const =0
mStartAllowDeprecatedSection
#define mStartAllowDeprecatedSection
Definition: plfdefs.h:232
StepInterval< float >
VelocityDesc
Definition: veldesc.h:38
RMOComputer::computeMoveout
static mODTextTranslationClass(RMOComputer) public bool computeMoveout(float d0, float rmo, float refoffset, int, const float *, float *)
sampleVrms
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)
sampleVint
bool sampleVint(const float *Vint, const double *t_in, int nr_in, const SamplingData< double > &sd_out, float *Vout, int nr_out)
NormalMoveout::computeMoveout
static mODTextTranslationClass(NormalMoveout) public bool computeMoveout(float t0, float Vrms, float effectiveanisotropy, int, const float *, float *)
TimeDepthConverter
Converts between time and depth given a model.
Definition: velocitycalc.h:80
TimeDepthModel::~TimeDepthModel
virtual ~TimeDepthModel()
TimeDepthModel::TimeDepthModel
mODTextTranslationClass(TimeDepthModel) public TimeDepthModel(const TimeDepthModel &)
TimeDepthModel
Converts between time, depth and velocity given a model. The velocity model can be either RMO-velocit...
Definition: velocitycalc.h:31
MoveoutComputer::nrVariables
virtual int nrVariables() const =0
computeVrms
bool computeVrms(const float *Vint, const SamplingData< double > &sd, int nrvels, float *Vrms)
TimeDepthConverter::firstvel_
float firstvel_
Definition: velocitycalc.h:125
MoveoutComputer
Base class for computing a moveout curve.
Definition: velocitycalc.h:139
DixConversion::compute
mODTextTranslationClass(DixConversion) public bool compute(const float *Vrms, double t0, float v0, const double *t, int nrlayers, float *Vint)
Definition: velocitycalc.h:246
SamplingData< double >
mDefineFactoryInClass
#define mDefineFactoryInClass(T, funcname)
Definition: factory.h:425
TimeDepthConverter::calcZ
void calcZ(const float *, int inpsz, ValueSeries< float > &, int outpsz, const SamplingData< double > &, bool istime) const
MoveoutComputer::findBestVariable
float findBestVariable(float *variables, int variabletochange, const Interval< float > &searchrg, int nroffsets, const float *offsets, const float *moveout) const
TimeDepthModel::getVelocity
float getVelocity(float depth) const
TimeDepthModel::getTime
float getTime(int idx) const
sKey::Depth
FixedString Depth()
Definition: keystrs.h:60
NormalMoveout
Computes moveout with anisotropy, according to the equation by Alkhalifah and Tsvankin 1995.
Definition: velocitycalc.h:190
MoveoutComputer::variableName
virtual const char * variableName(int) const =0
TimeDepthConverter::calcDepths
bool calcDepths(ValueSeries< float > &, int sz, const SamplingData< double > &timesamp) const
TimeDepthConverter::sd_
SamplingData< double > sd_
Definition: velocitycalc.h:130
DixConversion
Rms velocity to interval velocity conversion using the Dix formula.
Definition: velocitycalc.h:240
mStopAllowDeprecatedSection
#define mStopAllowDeprecatedSection
Definition: plfdefs.h:233
TimeDepthConverter::setVelocityModel
bool setVelocityModel(const ValueSeries< float > &vels, int sz, const SamplingData< double > &sd, const VelocityDesc &, bool istime)
TimeDepthModel::getDepth
float getDepth(float time) const
sampleEffectiveThomsenPars
void sampleEffectiveThomsenPars(const float *vinarr, const double *t_in, int nr_in, const SamplingData< double > &sd_out, int nr_out, float *voutarr)
TimeDepthModel::size
int size() const
Definition: velocitycalc.h:40
sampleVavg
bool sampleVavg(const float *Vavg, const double *t_in, int nr_in, const SamplingData< double > &sd_out, float *Vout, int nr_out)
uiString
String that is able to hold international (UTF-8) strings for the user interface.
Definition: uistring.h:121
TimeDepthModel::getVelocity
static float getVelocity(const float *dpths, const float *times, int sz, float depth)
TimeDepthModel::errMsg
const char * errMsg() const
MoveoutComputer::mODTextTranslationClass
mODTextTranslationClass(MoveoutComputer) public
Definition: velocitycalc.h:139
Vrms2Vint::compute
virtual bool compute(const float *Vrms, float t0, float v0, const float *t, int nrlayers, float *Vint)=0
TimeDepthModel::getFirstTime
float getFirstTime() const
Vrms2Vint::~Vrms2Vint
virtual mODTextTranslationClass(Vrms2Vint) public ~Vrms2Vint()
Definition: velocitycalc.h:228
computeVavg
bool computeVavg(const float *Vint, const double *t, int nrvels, float *Vavg)
Converts a number of layers with Vint to average velocities.
TimeDepthModel::isOK
virtual bool isOK() const
TimeDepthConverter::calcDepths
static mDeprecatedDef bool calcDepths(const ValueSeries< float > &vels, int velsz, const ValueSeries< float > &times, float *depths)
TimeDepthModel::operator=
TimeDepthModel & operator=(const TimeDepthModel &)
mDeprecatedDef
#define mDeprecatedDef
Definition: plfdefs.h:216
TimeDepthConverter::calcTimes
bool calcTimes(ValueSeries< float > &, int sz, const SamplingData< double > &depthsamp) const
Interval< float >
resampleContinuousData
void resampleContinuousData(const double *in, const double *t_in, int nr_in, const SamplingData< double > &sd_out, int nr_out, double *outarr)
computeDix
bool computeDix(const float *Vrms, double t0, float v0, const double *t, int nrlayers, float *Vint)
computeLinearD2T
bool computeLinearD2T(double v0, double dv, double v0depth, const SamplingData< float > &depthsampling, int sz, float *res)
sampleIntvThomsenPars
void sampleIntvThomsenPars(const float *inarr, const double *t_in, int nr_in, const SamplingData< double > &sd_out, int nr_out, float *outarr)
TimeDepthModel::sz_
int sz_
Definition: velocitycalc.h:66
TimeDepthModel::times_
float * times_
Definition: velocitycalc.h:68
Vrms2Vint
Rms velocity to interval velocity conversion.
Definition: velocitycalc.h:225
computeLinearT2D
bool computeLinearT2D(double v0, double dv, double v0depth, const SamplingData< float > &timesampling, int sz, float *res)
TimeDepthModel::depths_
float * depths_
Definition: velocitycalc.h:69

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