OpendTect  6.3
wavelet.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: A.H. Bril
8  Date: 24-3-1996
9 ________________________________________________________________________
10 
11 -*/
12 
13 #include "seiscommon.h"
14 #include "sharedobject.h"
15 #include "mathfunc.h"
16 #include "ranges.h"
17 #include "valseries.h"
18 template <class T> class TypeSet;
19 template <class T> class ValueSeriesInterpolator;
20 
21 
23 {
24 public:
25 
26  typedef int size_type;
27  typedef size_type IdxType;
28  typedef float ValueType;
29  typedef float ZType;
30 
31  Wavelet(const char* nm=0);
32  Wavelet(bool ricker_else_sinc,ValueType fpeak,
33  ValueType sample_intv=mUdf(ValueType),
34  ValueType scale=1);
37 
38  mImplSimpleMonitoredGetSet(inline,sampleRate,setSampleRate,
39  ZType,dpos_,cParChange())
40  mImplSimpleMonitoredGetSet(inline,centerSample,setCenterSample,
41  IdxType,cidx_,cParChange())
42  size_type size() const;
43  inline bool isEmpty() const { return size() < 1; }
44  bool validIdx(IdxType) const;
45  ValueType get(IdxType) const;
46  ValueType getValue(ZType) const;
47  void set(IdxType,ValueType);
48  ValueType* getSamples() const;
49  void getSamples(ValueType*) const;
50  void getSamples(TypeSet<ValueType>&) const;
51  void setSamples(const ValueType*,size_type);
52  void setSamples(const TypeSet<ValueType>&);
53  const ValueSeriesInterpolator<ValueType>& interpolator() const;
54  void setInterpolator(ValueSeriesInterpolator<ValueType>*);
56  void reSize(size_type,ValueType val=0.f);
57 
58  StepInterval<ZType> samplePositions() const;
59  IdxType nearestSample(ZType) const;
60  bool hasSymmetricalSamples() const;
61 
62  bool reSample(ZType);
63  bool reSampleTime(ZType);
64  void ensureSymmetricalSamples();
66  // for better results
67  void transform(ValueType b,ValueType a);
69  void normalize();
70  bool trimPaddedZeros();
71  ValueType getExtrValue(bool ismax = true) const;
72  void getExtrValues(Interval<ZType>&) const;
73  int getPos(ZType val,bool closetocenteronly=false) const;
74 
75  static ChangeType cParChange() { return 2; }
76  static ChangeType cSampleChange() { return 3; }
77 
78 protected:
79 
80  virtual ~Wavelet();
81 
82  ValueType* samps_;
83  size_type sz_;
84  ZType dpos_;
85  IdxType cidx_;
86 
88 
89  void doReSize(int);
90  StepInterval<ZType> gtSamplePositions() const;
91 
92  friend class WaveletValueSeries;
93 
94 };
95 
96 
100 {
101 public:
102 
103  WaveletValueSeries(const Wavelet&);
104 
105  virtual ValueType value(od_int64) const;
106  virtual bool writable() const { return true; }
107  virtual void setValue(od_int64 idx,ValueType);
108  virtual ValueType* arr();
109  virtual const ValueType* arr() const;
110 
112  { return new WaveletValueSeries( *wv_ ); }
113 
114 protected:
115 
118 
119 };
120 
125 {
126 public:
127  WaveletFunction(const Wavelet&);
128 
129  float getValue( float z ) const { return wv_->getValue(z); }
130  float getValue( const float* p ) const { return getValue(*p); }
131 
132 protected:
133 
136 
137 };
virtual ValueType * arr()
#define mExpClass(module)
Definition: commondefs.h:157
int size_type
Definition: wavelet.h:26
Seismics.
Definition: segydirectdef.h:20
float getValue(const float *p) const
Definition: wavelet.h:130
int ChangeType
Definition: monitorable.h:80
ValueSeries< ValueType > * clone() const
Definition: wavelet.h:111
short IdxType
Definition: seisblocksdata.h:39
IdxType cidx_
The index at pos == 0.
Definition: wavelet.h:85
#define od_int64
Definition: plftypes.h:34
Definition: sharedobject.h:18
size_type IdxType
Definition: wavelet.h:27
Definition: wavelet.h:22
Mathematical function.
Definition: mathfunc.h:59
protects a Monitorable against change.
Definition: monitorable.h:252
virtual bool writable() const
Definition: wavelet.h:106
RefMan< Wavelet > wv_
Definition: wavelet.h:116
#define mDeclMonitorableAssignment(clss)
like mDeclAbstractMonitorableAssignment but for non-abstract subclasses. Implements the clone() metho...
Definition: monitor.h:111
#define mDeclInstanceCreatedNotifierAccess(clss)
Definition: notify.h:235
ConstRefMan< Wavelet > wv_
Definition: wavelet.h:134
Set of (small) copyable elements.
Definition: commontypes.h:26
#define mImplSimpleMonitoredGetSet(pfx, fnnmget, fnnmset, typ, memb, chgtyp)
Defines simple MT-safe copyable member access.
Definition: monitor.h:39
WaveletValueSeries(const Wavelet &)
static ChangeType cParChange()
Definition: wavelet.h:75
float ValueType
Definition: coltab.h:23
#define mUdf(type)
Use this macro to get the undefined for simple types.
Definition: undefval.h:270
Interface to a series of values.
Definition: odmemory.h:15
Definition: valseriesinterpol.h:24
Interval with step.
Definition: commontypes.h:29
ZType dpos_
delta Z, sample interval
Definition: wavelet.h:84
static ChangeType cSampleChange()
Definition: wavelet.h:76
MonitorLock ml_
Definition: wavelet.h:135
virtual void setValue(od_int64 idx, ValueType)
virtual ValueType value(od_int64) const
bool isEmpty(const char *)
MonitorLock ml_
Definition: wavelet.h:117
float getValue(float z) const
Definition: wavelet.h:129
ValueType * samps_
Definition: wavelet.h:82
size_type sz_
Definition: wavelet.h:83
ValueSeriesInterpolator< ValueType > * intpol_
Definition: wavelet.h:87
float ValueType
Definition: wavelet.h:28
Definition: wavelet.h:124
float ZType
Definition: wavelet.h:29
void reSample(const FloatMathFunction &input, const A &samplevals, B &output, int nrsamples)
Definition: genericnumer.h:201
Definition: wavelet.h:99

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