STFINV library: seek source wavelet correction filter

◆ initialize()

void stfinv::STFBaseEngine::initialize ( const std::string &  parameters)
private

initialize base class

  1. The STFBaseEngine::initialize() function parses the parameter string. Parsed values are stored in Mparamap.
  2. Extract settings for parameters:
    • DEBUG: set debug output level
    • verbose: activate verbose output
    • exp: set power-law exponent and store weights in member data Mweights
  3. Check consistency of data
  4. Align index ranges of aff::Series objects such that the first element (sample) has index zero

Definition at line 91 of file stfinvbase.cc.

References checkconsistency(), Mdebug, Mpairs, Mstf, Mtriples, Mverbose, Mweights, parameter(), parameterisset(), parseparameters(), stfinv::Waveform::series, and STFINV_debug.

Referenced by STFBaseEngine().

92  {
93  this->parseparameters(parameters);
94 
95  // extract parameters
96  {
97  std::istringstream is(this->parameter("DEBUG","0"));
98  is >> Mdebug;
99  }
100  STFINV_debug(Mdebug>0, "STFBaseEngine::STFBaseEngine",
101  "initializing base class");
102  Mverbose=(this->parameter("verbose","false")=="true");
103  if (this->parameterisset("exp"))
104  {
105  double k;
106  std::istringstream is(this->parameter("exp","0."));
107  is >> k;
108  for (unsigned int i=0; i<Mtriples.size(); ++i)
109  {
110  double offset=Mtriples[i].offset();
111  Mweights(i)=pow(offset,k);
112  }
113  }
114  else
115  {
116  Mweights=1.;
117  }
118 
119  this->checkconsistency();
120 
121  // align index ranges; first index will be zero
122  if (Mstf.series.first()!=0) { Mstf.series.shift(-Mstf.series.first()); }
123 
124  {
125  stfinv::Tvectoroftriples::iterator I=Mtriples.begin();
126  while (I!=Mtriples.end())
127  {
128  if (I->data.first()!=0) { I->data.shift(-(I->data.first())); }
129  if (I->synthetics.first()!=0)
130  { I->synthetics.shift(-(I->synthetics.first())); }
131  if (I->convolvedsynthetics.first()!=0)
132  { I->convolvedsynthetics.shift(-(I->convolvedsynthetics.first())); }
133  ++I;
134  } // while (I!=Mtriples.end())
135  }
136 
137  {
138  stfinv::Tvectorofpairs::iterator I=Mpairs.begin();
139  while (I!=Mpairs.end())
140  {
141  if (I->synthetics.first()!=0)
142  { I->synthetics.shift(-(I->synthetics.first())); }
143  if (I->convolvedsynthetics.first()!=0)
144  { I->convolvedsynthetics.shift(-(I->convolvedsynthetics.first())); }
145  ++I;
146  } // while (I!=Mpairs.end())
147  }
148  } // void STFBaseEngine::initialize(const std::string& parameters)
bool parameterisset(const std::string &key) const
check is parameter was set by user
Definition: stfinvbase.cc:266
void parseparameters(std::string parameters)
parse parameters and store them in Mparamap
Definition: stfinvbase.cc:241
int Mverbose
verbose level
Definition: stfinvbase.h:338
stfinv::Waveform Mstf
source correction filter.
Definition: stfinvbase.h:332
std::string parameter(const std::string &key, const std::string &defvalue="false") const
return the value of a parameters
Definition: stfinvbase.cc:279
Tseries series
Time series of waveform.
Definition: stfinvbase.h:117
stfinv::Tvectoroftriples Mtriples
Waveform triples.
Definition: stfinvbase.h:330
int Mdebug
debug level
Definition: stfinvbase.h:336
aff::Series< double > Mweights
Weights.
Definition: stfinvbase.h:346
stfinv::Tvectorofpairs Mpairs
Waveform pairs.
Definition: stfinvbase.h:334
void checkconsistency() const
Check consistency of data members.
Definition: stfinvbase.cc:159
#define STFINV_debug(C, N, M)
produce debug output
Definition: debug.h:49
Here is the call graph for this function:
Here is the caller graph for this function: