OpendTect-6_4  6.4
scalingattrib.h
Go to the documentation of this file.
1 #ifndef scalingattrib_h
2 #define scalingattrib_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: N. Hemstra
9  Date: December 2004
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 
16 #include "attributesmod.h"
17 #include "attribprovider.h"
18 
19 namespace Attrib
20 {
21 
39 {
40 public:
41  static void initClass();
42  Scaling(Desc&);
43  static const char* attribName() { return "Scaling"; }
44  static const char* scalingTypeStr() { return "scalingtype"; }
45  static const char* powervalStr() { return "powerval"; }
46  static const char* gateStr() { return "timegate"; }
47  static const char* factorStr() { return "scalefactor"; }
48  static const char* widthStr() { return "width"; }
49  static const char* mutefractionStr() { return "mutefraction"; }
50  static const char* statsTypeStr() { return "statstype"; }
51  static const char* sqrangeStr() { return "sqrange"; }
52  static const char* squntouchedStr() { return "squntouched"; }
53  static const char* statsTypeNamesStr(int type);
54  static const char* scalingTypeNamesStr(int type);
55 
56 protected:
57  ~Scaling() {}
58  static Provider* createInstance(Desc&);
59  static void updateDesc(Desc&);
60 
61  bool allowParallelComputation() const;
62 
63  bool getInputOutput(int input,TypeSet<int>& res) const;
64  bool getInputData(const BinID&,int zintv);
65  bool computeData(const DataHolder&,const BinID& relpos,
66  int z0,int nrsamples,int threadid) const;
67 
68  void getSampleGates(const TypeSet<Interval<float> >& oldtgs,
69  TypeSet< Interval<int> >& newsampgates,
70  int z0,int nrsamples) const;
71  void scaleSqueeze(const DataHolder&, int, int) const;
72  void scaleZN(const DataHolder&, int, int) const;
73  void scaleAGC(const DataHolder&,int z0,int nrsamples) const;
74  void scaleGain(const DataHolder&,int z0,int nrsamples) const;
75  void getScaleFactorsFromStats(
76  const TypeSet<Interval<int> >& gates,
77  TypeSet<float>& factors,int) const;
78  void getTrendsFromStats(
79  const TypeSet<Interval<int> >& gates,int);
80  const Interval<int>* desZSampMargin( int inp, int ) const;
81 
84  float powerval_;
88  int dataidx_;
90 
91  // for Squeeze
94 
95  // for AGC
96  float width_;
99 
100  //for trend removal ( trend of aX+b type )
101  struct Trend
102  {
103  Trend( float a, float b )
104  : a_( a )
105  , b_( b ) {};
106 
107  float valueAtX( float x ) const { return a_ * x + b_; }
108  bool operator==( Trend t ) const
109  { return t.a_==a_
110  && t.b_==b_; }
111 
112  float a_;
113  float b_;
114  };
115 
117 };
118 
119 }; // namespace Attrib
120 
121 #endif
#define mExpClass(module)
Definition: commondefs.h:160
Interval< int > desgate_
Definition: scalingattrib.h:89
static const char * widthStr()
Definition: scalingattrib.h:48
Interval< float > squrg_
Definition: scalingattrib.h:93
float width_
Definition: scalingattrib.h:96
float a_
Definition: scalingattrib.h:112
float valueAtX(float x) const
Definition: scalingattrib.h:107
FixedString Attributes()
Definition: keystrs.h:40
Interval< float > window_
Definition: scalingattrib.h:97
Scaling Attribute Calculates the squared sum of the gate&#39;s samples divided by the number of samples i...
Definition: scalingattrib.h:38
const DataHolder * inputdata_
Definition: scalingattrib.h:87
float powerval_
Definition: scalingattrib.h:84
static const char * powervalStr()
Definition: scalingattrib.h:45
Interval< float > sqrg_
Definition: scalingattrib.h:92
static const char * gateStr()
Definition: scalingattrib.h:46
static const char * statsTypeStr()
Definition: scalingattrib.h:50
static const char * squntouchedStr()
Definition: scalingattrib.h:52
Trend(float a, float b)
Definition: scalingattrib.h:103
Description of an attribute in an Attrib::DescSet. Each attribute has a name (e.g. "Similarity"), a user reference (e.g. "My similarity"), and at least one output. In addition, it may have parameters and inputs. If it has multiple outputs, only one of the outputs are selected.
Definition: attribdesc.h:89
TypeSet< Trend > trends_
Definition: scalingattrib.h:116
TypeSet< Interval< float > > gates_
Definition: scalingattrib.h:85
TypeSet< float > factors_
Definition: scalingattrib.h:86
int dataidx_
Definition: scalingattrib.h:88
Holds the attribute data.
Definition: attribdataholder.h:43
static const char * sqrangeStr()
Definition: scalingattrib.h:51
Positioning in a seismic survey: inline/crossline or lineNr/trcNr.
Definition: binid.h:30
int scalingtype_
Definition: scalingattrib.h:82
static const char * attribName()
Definition: scalingattrib.h:43
~Scaling()
Definition: scalingattrib.h:57
Provides the actual output to ...
Definition: attribprovider.h:44
int statstype_
Definition: scalingattrib.h:83
Definition: scalingattrib.h:101
float b_
Definition: scalingattrib.h:113
static const char * scalingTypeStr()
Definition: scalingattrib.h:44
static const char * mutefractionStr()
Definition: scalingattrib.h:49
bool operator==(Trend t) const
Definition: scalingattrib.h:108
float mutefraction_
Definition: scalingattrib.h:98
static const char * factorStr()
Definition: scalingattrib.h:47
static void initClass()
Semblance Attribute.
Definition: attribdataholder.h:25

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