UNIVERS
15.3
UNIVERS base processing software API
|
#include <trace.hpp>
Classes | |
class | Header |
struct | Window |
Public Types | |
typedef float | AmplT |
typedef float | TimeT |
typedef float | OffsetT |
typedef std::vector< AmplT > | AmplsStorageT |
typedef AmplsStorageT::iterator | iterator |
typedef AmplsStorageT::const_iterator | const_iterator |
Public Member Functions | |
const AmplT & | operator[] (size_t n) const |
AmplT & | operator[] (size_t n) |
Trace & | operator= (const Trace &tr) |
bool | operator== (const Trace &tr) const |
Trace | operator+ (const Trace &tr) const |
Trace | operator- (const Trace &tr) const |
Trace & | operator+= (const Trace &that) |
Trace & | operator-= (const Trace &that) |
Trace & | operator*= (AmplT value) |
Trace & | operator/= (AmplT value) |
Trace () | |
Trace (const Header &hdr) | |
Trace (const Header &hdr, size_t size, AmplT ampl) | |
template<typename Iterator > | |
Trace (const Header &hdr, Iterator first, Iterator last) | |
Trace (const Trace &tr) | |
Trace * | clone () const |
virtual | ~Trace () |
const Header & | header () const |
const_iterator | begin () const |
const_iterator | end () const |
const AmplT & | at (size_t n) const |
size_t | size () const |
TimeT | duration () const |
Header & | header () |
iterator | begin () |
iterator | end () |
AmplT & | at (size_t n) |
void | clear () |
void | resize (size_t n, AmplT ampl=0.) |
void | erase (iterator first, iterator last) |
void | shift (TimeT s) |
void | shift_old (TimeT s) |
void | fill (const AmplT &l) |
const Trace & | set_window (TimeT start, TimeT duration) const |
TimeT | get_window_start () const |
TimeT | get_window_duration () const |
void | remove_window () const |
bool | is_windowed () const |
bool | hasNAN () |
bool | hasInf () |
bool | hasNANInf () |
Static Public Member Functions | |
static void | applyKin (Trace &trace, const std::vector< AmplT > &tsrc, const std::vector< AmplT > &tres, const double &max_shift_ratio=10e+6) |
static void | expand (Trace &trace, size_t n1, size_t n2, Trace::AmplT ampl=0.) |
static void | reduce (Trace &trace, size_t n1, size_t n2) |
Protected Attributes | |
Header | m_hdr |
AmplsStorageT | m_ampls |
std::vector< Window > | m_win_stack |
Trace class contains array of amplitudes and header.
typedef std::vector<AmplT> Trace::AmplsStorageT |
Type for amplitudes storage.
typedef float Trace::AmplT |
Type for amplitudes.
typedef AmplsStorageT::const_iterator Trace::const_iterator |
Constant iterator to amplitude of the trace.
typedef AmplsStorageT::iterator Trace::iterator |
Iterator to amplitude of the trace.
typedef float Trace::OffsetT |
Type for offsets.
typedef float Trace::TimeT |
Type for times.
Trace::Trace | ( | ) |
Default constructor for empty trace with default header.
|
explicit |
Constructs empty trace with provided header.
Constructs trace with provided header and size. All amplitudes will be as provided ampl.
|
inline |
Constructs trace from provided header and set of amplitudes.
Trace::Trace | ( | const Trace & | tr | ) |
Copy constructor.
|
virtual |
Just a destructor.
|
static |
Apply kinematic for provided initial trace. -—tsrc[k]=>tres[k]----------------—>
trace | Initial trace |
tsrc | Source times array |
tres | Result times array |
max_shift_ratio | Maximal permissible neighbouring shifts ratio. |
const AmplT& Trace::at | ( | size_t | n | ) | const |
Access to the n-th amplitude.
AmplT& Trace::at | ( | size_t | n | ) |
n-th amplitude modificators.
const_iterator Trace::begin | ( | ) | const |
Accesors with iterator.
iterator Trace::begin | ( | ) |
Modificators with iterator.
void Trace::clear | ( | ) |
Clear all the amplitudes in the trace. Also remove all windows if defined.
Trace* Trace::clone | ( | ) | const |
Clones this trace to new object should be consequently deleted.
TimeT Trace::duration | ( | ) | const |
Size of the trace in terms of time.
Erase set of amplitudes provided by the iterators.
|
static |
Expand trace.
void Trace::fill | ( | const AmplT & | ampl | ) |
Fill all amplitudes with provided one.
TimeT Trace::get_window_duration | ( | ) | const |
Get current window duration. Return duration of full trace if window not defined.
TimeT Trace::get_window_start | ( | ) | const |
Get current window start time value. Return start time of trace if window not defined.
bool Trace::hasInf | ( | ) |
True if has any Inf sample.
bool Trace::hasNAN | ( | ) |
True if has any NAN sample.
bool Trace::hasNANInf | ( | ) |
True if has any NAN or Inf sample.
bool Trace::is_windowed | ( | ) | const |
True if trace has window.
bool Trace::operator== | ( | const Trace & | tr | ) | const |
Equality of traces.
|
inline |
Access to n-th element.
|
inline |
Access to n-th element for modification.
|
static |
Reduce trace.
void Trace::remove_window | ( | ) | const |
Remove last added window if defined.
void Trace::resize | ( | size_t | n, |
AmplT | ampl = 0. |
||
) |
Resize trace for provided number of samples.
Set window with provided start time and duration.
void Trace::shift | ( | TimeT | s | ) |
Shifts trace to specified amount of time units (s, ms). For positive s shift will be done to the right, otherwise to the left.
void Trace::shift_old | ( | TimeT | s | ) |
The same as shift, but old algorithm is used. DEPRECATED.
size_t Trace::size | ( | ) | const |
Size of the trace.
|
mutableprotected |
Stack of windows of the trace.