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

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