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

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