STFINV library: seek source wavelet correction filter
stfinv::STFBaseEngine Class Reference

Abstract base class for engines to derive source correction filter. More...

#include <stfinvbase.h>

Inheritance diagram for stfinv::STFBaseEngine:
Collaboration diagram for stfinv::STFBaseEngine:

Public Member Functions

virtual ~STFBaseEngine ()
 abstract base requires virtual destructor More...
 
Shape query functions
unsigned int nsamples () const
 return number of samples used in time series More...
 
unsigned int nreceivers () const
 return number of receiver signals in use More...
 
unsigned int npairs () const
 return number of additional signals to be convolved More...
 
double dt () const
 return sampling interval More...
 
Data query functions
Tseries stf () const
 return source correction filter series More...
 
Tseries::Tcoc recording (const unsigned int &i) const
 return recorded data at receiver i More...
 
Tseries::Tcoc synthetic (const unsigned int &i) const
 return synthetic data at receiver i More...
 
Tseries convolvedsynthetic (const unsigned int &i) const
 return synthetic data convolved with stf at receiver i More...
 
Tseries::Tcoc series (const unsigned int &i) const
 return synthetic data of pair i More...
 
Tseries convolvedseries (const unsigned int &i) const
 return synthetic data convolved with stf for pair i More...
 

Protected Member Functions

 STFBaseEngine (const stfinv::Tvectoroftriples &triples, const stfinv::Waveform &stf, const std::string &parameters)
 Constructor. More...
 
 STFBaseEngine (const stfinv::Tvectoroftriples &triples, const stfinv::Waveform &stf, const stfinv::Tvectorofpairs &pairs, const std::string &parameters)
 Constructor. This constructor additionally takes a vector of time series pairs. In this vector references to synthetic time series data can be passed, which are not used in the process of determining the optimal source correction filter but which are convolved with the new source correction filter on the fly. More...
 
Functions presented to derived classes
std::string parameter (const std::string &key, const std::string &defvalue="false") const
 return the value of a parameters More...
 
bool parameterisset (const std::string &key) const
 check is parameter was set by user More...
 
void checkreceiverindex (const unsigned int &i) const
 check for vaid receiver index More...
 
void checkseriesindex (const unsigned int &i) const
 check for vaid index off additional time series pair More...
 
virtual void exec ()
 Virtual function to run engine. More...
 
double weight (const unsigned int &i) const
 return weight for signal at receiver i More...
 
aff::Series< double > weights () const
 return weights array More...
 

Protected Attributes

int Mdebug
 debug level More...
 
stfinv::Tvectorofpairs Mpairs
 Waveform pairs. More...
 
stfinv::Waveform Mstf
 source correction filter. More...
 
stfinv::Tvectoroftriples Mtriples
 Waveform triples. More...
 
int Mverbose
 verbose level More...
 

Private Member Functions

Functions implementing base class operation
void initialize (const std::string &parameters)
 initialize base class More...
 
void parseparameters (std::string parameters)
 parse parameters and store them in Mparamap More...
 
void checkconsistency () const
 Check consistency of data members. More...
 
void setweights (const double &k)
 Set weights according to exponent. More...
 

Private Attributes

stfinv::tools::Tparamap Mparamap
 Parameter map. More...
 
aff::Series< double > Mweights
 Weights. More...
 

Basic interface for users

See also
Information for users of libstfinv (programmers)
stfinv::Waveform run ()
 Start engine and return reference to source correction filter. More...
 
virtual void help (std::ostream &os=std::cout) const
 print online help More...
 
virtual void usage (std::ostream &os=std::cout) const
 print detailed description More...
 
virtual const char * name () const
 return name of engine More...
 
static void classhelp (std::ostream &os=std::cout)
 print online help More...
 
static void classusage (std::ostream &os=std::cout)
 print detailed description More...
 

Detailed Description

Abstract base class for engines to derive source correction filter.

What STFBaseEngine does for you
The base class takes care of parameter reading. It parses the parameter string passed to its constructor and provides the values through protected member functions:
The funtion STFBaseEngine::run is called by the user and passes execution to the virtual function STFBaseEngine::exec which ensures that the exec() funtion of the appropriate child class is called to initiate processing.
Initialization of engines
The following happens in a sequence, when engines are initialized:
  1. The desired engine ins initialized either by the user directly or within the frame of STFEngine.
  2. The constructor of this engine immediatly calls teh constructor of its base class. This again calls the constructor of its base class such passing down initialization to STFBaseEngine::STFBaseEngine
  3. The constructor of STFBaseEngine takes the references to the storage locations for signal data as well as a parameter string.
    1. It fills its own references to the data storage locations and checks the consistency of parameters passed (size of arrays, sampling rates, etc).
    2. It then parses the parameter string and places its contents in the Mparamap parameter map.
    3. Then the base class parameters are set either from defaults or form values in the parameter map.
  4. Initialization then continues at the next higher level in the class hierarchy.
    1. In the next level constructor additional workspace can be allocated based on the already available references to signal data and parameter values.
    2. Further level specific parameters are set due to defaults or values passed in the parameter string.
Handling of parameters
See STFBaseEngine::parameter() and STFBaseEngine::parameterisset() for a description on how parameters are handled within engine classes.
Data
  • recordings are understood as recorded waveforms. The number of available traces is returned by nreceivers()
  • synthetics are understood as synthetic waveforms generated with a generic source time function. For each trace of recordings there must be a matching trace of synthetics and vice versa.
  • convolvedsynthetics are produced from synthetics as a result of the application of the source wavelet correction filter.
  • series are additional synthetic time series, not used to construct the source-wavelet correction filter. The number of additional series traces is returned by npairs().
  • convolvedseries are produced from series as a result of the application of the source wavelet correction filter.
See also
Initialization of classes
Todo:
The base class should provide a "log to file" option such that applied weights and signal energies could be reported.

Definition at line 208 of file stfinvbase.h.


The documentation for this class was generated from the following files: