OpendTect  6.6
ailayer.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
8  Date: Nov 2010
9  RCS: $Id$
10 ________________________________________________________________________
11 
12 -*/
13 
14 #include "algomod.h"
15 #include "gendefs.h"
16 #include "math.h"
17 #include "ranges.h"
18 #include "survinfo.h"
19 #include "typeset.h"
20 
21 template <class T> class Array2DImpl;
22 
23 mGlobal(Algo) inline float cMinLayerThickness() { return 1e-4f; }
24 mGlobal(Algo) inline const Interval<float> validThicknessRange();
25 mGlobal(Algo) inline const Interval<float> validDensityRange();
26 mGlobal(Algo) inline const Interval<float> validVelocityRange();
27 mGlobal(Algo) inline const Interval<float> validImpRange();
28 
29 
36 {
37 public:
38  AILayer( float thkness, float vel, float den )
39  : thickness_(thkness), vel_(vel), den_(den) {}
40 
41  //Velocity will be computed using Gardner equation
42  //in case density is undef.
43  AILayer(float thkness,float ai, float den,
44  bool needcompthkness);
45 
46  bool operator ==( const AILayer& p ) const
47  { return thickness_ == p.thickness_; }
48 
49  float thickness_;
50  float vel_;
51  float den_;
52 
53  float getAI() const;
54  bool isOK(bool dodencheck=true) const;
55  bool isValidVel() const;
56  bool isValidDen() const;
57 
58  //Compute Den from Gardner
59  bool fillDenWithVp(bool onlyinvalid);
60 
61 };
62 
63 
65 
66 mGlobal(Algo) float getLayerDepth(const AIModel& mod,int layer);
67 
68 
69 
75 {
76 public:
77  ElasticLayer(float thkness,float pvel,float svel,float den);
78 
79  //To be used only for 0 offsets
81  ElasticLayer(float thkness,float ai,float si,
82  float den,bool needcompthkness);
83 
84  bool operator ==( const ElasticLayer& p ) const
85  { return thickness_ == p.thickness_; }
86 
87  float svel_;
88  float getSI() const;
89 
90  bool isOK(bool dodencheck=true,bool dosvelcheck=true) const;
91  bool isValidVs() const;
92 
93  //Compute Vs from Castagna
94  bool fillVsWithVp(bool onlyinvalid);
95 };
96 
97 
100 {
101 public:
102 
106  int isOK(bool dodencheck=true,bool dosvelcheck=true) const;
107 
110  bool getValues(bool isden,bool issvel,TypeSet<float>&) const;
111 
114  bool getValues(bool vel,bool den,bool svel,
115  Array2DImpl<float>&) const;
116 
117  void checkAndClean(int& firsterroridx,bool dodencheck=true,
118  bool dosvelcheck=true,bool onlyinvalid=false);
119 
122  void interpolate(bool dovp,bool doden,bool dovs);
123 
127  void upscale(float maxthickness);
128 
132  void upscaleByN(int nblock);
133 
137  void setMaxThickness(float maxthickness);
138 
142 
148  void block(float relthreshold,bool pvelonly);
149 
157 
158  /* computes an upscaled elastic layer from an elastic model
159  using backus upscaling method. The thickness of the input and
160  output remains constant.
161  returns false if the input model does not contain a single
162  valid input layer
163  \param theta Incidence angle in radians */
164 
165  bool getUpscaledBackus(ElasticLayer& outlay,float theta=0.) const;
166 
167  bool createFromVel(const StepInterval<float>& zrange,
168  const float* pvel, const float* svel=0,
169  const float* den=0);
170 
171  bool createFromAI(const StepInterval<float>& zrange,const float* ai,
172  const float* si =0,const float* den =0);
173 
174  /* Return depth of the middle of the layer */
175 
176  float getLayerDepth(int layerix) const;
177 
178 
180  Interval<float>& timerg,bool usevs=false);
181 
182  void getTimeSampling(Interval<float>&,bool usevs=false) const;
183 
184 
185 protected:
186 
189  bool getRatioValues(bool vel,bool den,bool svel,
190  Array2DImpl<float>& ratiovals,
191  Array2DImpl<float>* vals=0) const;
192 
193  /* Gives layer index distributions of similar properties */
194 
195  bool doBlocking(float threshold,bool pvelonly,
196  TypeSet<Interval<int> >& blocks) const;
197 
198  /* If a layer thickness is strictly identical to zstep,
199  maybe split that layer over the last/previous layers */
200 
201  void removeSpuriousLayers(float zstep);
202 
203 
204 };
205 
207 { return Interval<float> ( cMinLayerThickness(), mUdf(float) ); }
208 
210 { return Interval<float> ( 100.f, 10000.f ); }
211 
213 { return Interval<float> ( 10.f, 10000.f ); }
214 
216 {
217  return Interval<float> (
218  validDensityRange().start*validVelocityRange().start,
219  validDensityRange().stop*validVelocityRange().stop );
220 }
221 
ElasticLayer::isOK
bool isOK(bool dodencheck=true, bool dosvelcheck=true) const
mGlobal
#define mGlobal(module)
Definition: commondefs.h:180
AILayer::AILayer
AILayer(float thkness, float ai, float den, bool needcompthkness)
mExpClass
#define mExpClass(module)
Definition: commondefs.h:177
AILayer::isValidDen
bool isValidDen() const
ElasticModel
A table of elastic prop layers with processing utilities.
Definition: ailayer.h:100
ElasticLayer::ElasticLayer
ElasticLayer(const AILayer &)
ElasticModel::createFromAI
bool createFromAI(const StepInterval< float > &zrange, const float *ai, const float *si=0, const float *den=0)
ElasticLayer::svel_
float svel_
Definition: ailayer.h:87
validThicknessRange
const Interval< float > validThicknessRange()
Definition: ailayer.h:206
typeset.h
ElasticLayer::isValidVs
bool isValidVs() const
operator==
bool operator==(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:81
cMinLayerThickness
float cMinLayerThickness()
Definition: ailayer.h:23
ElasticModel::createFromVel
bool createFromVel(const StepInterval< float > &zrange, const float *pvel, const float *svel=0, const float *den=0)
ElasticModel::doBlocking
bool doBlocking(float threshold, bool pvelonly, TypeSet< Interval< int > > &blocks) const
AILayer::AILayer
AILayer(float thkness, float vel, float den)
Definition: ailayer.h:38
AILayer
Acoustic Impedance layer.
Definition: ailayer.h:36
ElasticLayer
A table of elastic prop layers.
Definition: ailayer.h:75
ElasticModel::getUpscaledByThicknessAvg
bool getUpscaledByThicknessAvg(ElasticLayer &outlay) const
StepInterval< float >
validDensityRange
const Interval< float > validDensityRange()
Definition: ailayer.h:209
validImpRange
const Interval< float > validImpRange()
Definition: ailayer.h:215
ElasticModel::upscale
void upscale(float maxthickness)
ElasticLayer::getSI
float getSI() const
ElasticModel::removeSpuriousLayers
void removeSpuriousLayers(float zstep)
ElasticModel::checkAndClean
void checkAndClean(int &firsterroridx, bool dodencheck=true, bool dosvelcheck=true, bool onlyinvalid=false)
ElasticModel::getTimeSampling
static bool getTimeSampling(const TypeSet< ElasticModel > &, Interval< float > &timerg, bool usevs=false)
AILayer::isValidVel
bool isValidVel() const
AILayer::den_
float den_
Definition: ailayer.h:51
AILayer::thickness_
float thickness_
Definition: ailayer.h:49
AILayer::isOK
bool isOK(bool dodencheck=true) const
ElasticLayer::ElasticLayer
ElasticLayer(float thkness, float pvel, float svel, float den)
ElasticModel::isOK
int isOK(bool dodencheck=true, bool dosvelcheck=true) const
gendefs.h
ElasticModel::interpolate
void interpolate(bool dovp, bool doden, bool dovs)
ElasticModel::mergeSameLayers
void mergeSameLayers()
ElasticModel::getValues
bool getValues(bool vel, bool den, bool svel, Array2DImpl< float > &) const
ElasticLayer::fillVsWithVp
bool fillVsWithVp(bool onlyinvalid)
AIModel
TypeSet< AILayer > AIModel
Definition: ailayer.h:64
AILayer::getAI
float getAI() const
AILayer::vel_
float vel_
Definition: ailayer.h:50
survinfo.h
Array2DImpl
Implementation of Array2D.
Definition: arrayndimpl.h:102
AILayer::fillDenWithVp
bool fillDenWithVp(bool onlyinvalid)
ElasticLayer::ElasticLayer
ElasticLayer(float thkness, float ai, float si, float den, bool needcompthkness)
mUdf
#define mUdf(type)
Use this macro to get the undefined for simple types.
Definition: undefval.h:274
ElasticModel::upscaleByN
void upscaleByN(int nblock)
ElasticModel::getTimeSampling
void getTimeSampling(Interval< float > &, bool usevs=false) const
ranges.h
ElasticModel::getRatioValues
bool getRatioValues(bool vel, bool den, bool svel, Array2DImpl< float > &ratiovals, Array2DImpl< float > *vals=0) const
getLayerDepth
float getLayerDepth(const AIModel &mod, int layer)
Interval< float >
ElasticModel::getLayerDepth
float getLayerDepth(int layerix) const
ElasticModel::block
void block(float relthreshold, bool pvelonly)
ElasticModel::getValues
bool getValues(bool isden, bool issvel, TypeSet< float > &) const
validVelocityRange
const Interval< float > validVelocityRange()
Definition: ailayer.h:212
ElasticModel::getUpscaledBackus
bool getUpscaledBackus(ElasticLayer &outlay, float theta=0.) const
TypeSet
Sets of (small) copyable elements.
Definition: commontypes.h:29
ElasticModel::setMaxThickness
void setMaxThickness(float maxthickness)

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