STFINV library: seek source wavelet correction filter

◆ initialize()

void stfinv::STFEngine::initialize ( const stfinv::Tvectoroftriples triples,
const stfinv::Waveform stf,
const stfinv::Tvectorofpairs pairs,
const std::string &  parameters 
)
private

initialize engine.

Definition at line 77 of file stfinvany.cc.

References stfinv::tools::clipstring(), stfinv::STFEngineIdentity::ID, stfinv::STFEngineFDLeastSquares::ID, Mengine, STFINV_abort, STFINV_assert, and STFINV_report_assert.

Referenced by STFEngine().

81  {
82  std::string para=parameters;
83  std::string id=stfinv::tools::clipstring(para, ":");
84  if (id == std::string(stfinv::STFEngineIdentity::ID))
85  {
86  Mengine=new stfinv::STFEngineIdentity(triples, stf, para);
87  }
88  /*
89  else if (id == std::string(stfinv::STFEngineFixedWavelet::ID))
90  {
91  STFINV_assert(pairs.size()==0,
92  "ERROR: engine does not support additional time series pairs");
93  Mengine=new stfinv::STFEngineFixedWavelet(triples, stf, para);
94  }
95  */
96  else if ((id == std::string(stfinv::STFEngineFDLeastSquares::ID))
97  || (id == std::string("fbd")))
98  {
100  "The ID \"fbd\" for this engine is deprecated",
101  "The correct ID of the Fourier domain least "
102  "squares engine is \"" <<
104  "\".\n"
105  "The former ID \"fbd\" may vanish in the future "
106  "and should no longer be used.");
107  if (pairs.size()>0)
108  {
109  Mengine=new stfinv::STFEngineFDLeastSquares(triples, stf,
110  pairs, para);
111  }
112  else
113  {
114  Mengine=new stfinv::STFEngineFDLeastSquares(triples, stf, para);
115  }
116  }
117  else
118  {
119  std::cerr << "ERROR: engine ID " << id << " is unkown!" << std::endl;
120  STFINV_abort("aborting since engine ID is not recognized");
121  }
122  STFINV_assert(Mengine!=0, "engine was not created correctly");
123  }
static const char *const ID
ID used to select thsi engine.
#define STFINV_report_assert(C, M, V)
Check an assertion and report only.
Definition: error.h:164
Engine to apply a scalar factor.
Fourier domain least squares engine.
#define STFINV_assert(C, M)
Check an assertion and report by throwing an exception.
Definition: error.h:140
static const char *const ID
ID used to select this engine.
#define STFINV_abort(M)
Abort and give a message.
Definition: error.h:147
struct CWaveformPair * pairs
Pointer to array of waveform pairs. This actually is a C array for elements of type struct CWaveformP...
Definition: stfinv.h:196
std::string clipstring(std::string &s, const std::string &delim=":")
stfinv::STFBaseEngine * Mengine
Pointer to actual engine.
Definition: stfinvany.h:140
Here is the call graph for this function:
Here is the caller graph for this function: