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

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