Commit 8c95367b authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

identity engine in its basic functionality is fully implemented

This is a legacy commit from before 2015-03-01.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.
first tests of the library could be done


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 3986
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent d9e01a27
......@@ -71,7 +71,7 @@ namespace stfinv {
os << STFEngineBlindDeconvolution::description << "\n" << std::endl;
os << "This class is not yet implemented." << std::endl;
os << "Online help is not yet provided." << std::endl;
STFFourierDomainEngine::classhelp(os);
Tbase::classhelp(os);
} // void STFEngineBlindDeconvolution::classhelp(std::ostream& os)
/*----------------------------------------------------------------------*/
......
......@@ -69,7 +69,7 @@ namespace stfinv {
os << STFEngineFixedWavelet::description << "\n" << std::endl;
os << "This class is not yet implemented." << std::endl;
os << "Online help is not yet provided." << std::endl;
STFFourierDomainEngine::classhelp(os);
Tbase::classhelp(os);
} // void STFEngineFixedWavelet::classhelp(std::ostream& os)
/*----------------------------------------------------------------------*/
......
......@@ -100,7 +100,7 @@ namespace stfinv {
<< "is set, N will be the next power of 2 larger than M*f. Else if\n"
<< "fdiv is set, N will be the next integer multiple of d larger\n"
<< "than M*f." << std::endl;
STFBaseEngine::classhelp(os);
Tbase::classhelp(os);
} // void STFFourierDomainEngine::classhelp(std::ostream& os)
/*----------------------------------------------------------------------*/
......
......@@ -49,35 +49,59 @@ namespace stfinv {
/*----------------------------------------------------------------------*/
void STFEngineIdentity::exec()
void STFEngineIdentity::help(std::ostream& os) const
{
STFINV_abort("STFEngineIdentity::run not yet implemented");
} // void STFEngineIdentity::exec()
STFEngineIdentity::classhelp(os);
} // void STFEngineIdentity::help(std::ostream& os) const
/*----------------------------------------------------------------------*/
void STFEngineIdentity::help(std::ostream& os) const
const char* STFEngineIdentity::name() const
{
STFEngineIdentity::classhelp(os);
} // void STFEngineIdentity::help(std::ostream& os) const
return("STFEngineIdentity");
} // const char const* STFEngineIdentity::name() const
/*----------------------------------------------------------------------*/
void STFEngineIdentity::classhelp(std::ostream& os)
void STFEngineIdentity::initialize()
{
os << "class STFEngineIdentity (" << STFEngineIdentity::ID << ")\n";
os << STFEngineIdentity::description << "\n" << std::endl;
os << "This class is not yet implemented." << std::endl;
os << "Online help is not yet provided." << std::endl;
STFBaseEngine::classhelp(os);
} // void STFEngineIdentity::classhelp(std::ostream& os)
// scale energy
Mscaleenergy=(this->parameter("scaleenergy","false")=="true");
} // void STFEngineIdentity::initialize()
/*----------------------------------------------------------------------*/
const char* STFEngineIdentity::name() const
void STFEngineIdentity::exec()
{
return("STFEngineIdentity");
} // const char const* STFEngineIdentity::name() const
STFINV_assert(!Mscaleenergy,
"ERROR: energy scaling not yet implemented");
Tseries stf=this->stf();
stf=0.;
stf(0)=1.;
for (unsigned int i=0; i<this->nreceivers(); ++i)
{
Tseries::Tcoc synthetic=this->synthetic(i);
Tseries convolvedsynthetic=this->convolvedsynthetic(i);
convolvedsynthetic.copyin(synthetic);
}
} // void STFEngineIdentity::exec()
/*----------------------------------------------------------------------*/
void STFEngineIdentity::classhelp(std::ostream& os)
{
os << "class STFEngineIdentity ("
<< STFEngineIdentity::ID << ")\n";
os << STFEngineIdentity::description << "\n" << std::endl;
os << "This engine convolves the synthetic data with a discrete delta\n"
<< "pulse so to speak. Optionally the delta-peak ist scale such that\n"
<< "the convolved synthetics will be of equal scaled energy as the\n"
<< "recordings.\n";
os << "Options and parameters in common for Fourier engines:\n"
<< "scaleenergy if flag is set: scale energy"
<< std::endl;
Tbase::classhelp(os);
} // void STFEngineIdentity::classhelp(std::ostream& os)
} // namespace stfinv
......
......@@ -68,7 +68,9 @@ namespace stfinv {
STFEngineIdentity(const stfinv::Tvectoroftriples& triples,
const stfinv::Waveform& stf,
const std::string& parameters)
:Tbase(triples, stf, parameters) { }
: Tbase(triples, stf, parameters),
Mscaleenergy(false)
{ this->initialize(); }
//! \brief abstract base requires virtual destructor
virtual ~STFEngineIdentity() { }
//! \brief Start engine
......@@ -81,7 +83,12 @@ namespace stfinv {
virtual const char* name() const;
private:
//! \brief initialize work space
void initialize() { }
void initialize();
// member data
private:
//! \brief scale energy
bool Mscaleenergy;
}; // class STFEngineIdentity
} // namespace stfinv
......
......@@ -56,23 +56,38 @@ namespace stfinv {
/*----------------------------------------------------------------------*/
const char* STFEngineNormalize::name() const
{
return("STFEngineNormalize");
} // const char const* STFEngineNormalize::name() const
/*----------------------------------------------------------------------*/
void STFEngineNormalize::initialize()
{
STFINV_illegal;
} // void STFEngineNormalize::initialize()
/*----------------------------------------------------------------------*/
void STFEngineNormalize::exec()
{
STFINV_illegal;
} // void STFEngineNormalize::exec()
/*----------------------------------------------------------------------*/
void STFEngineNormalize::classhelp(std::ostream& os)
{
os << "class STFEngineNormalize ("
<< STFEngineNormalize::ID << ")\n";
os << STFEngineNormalize::description << "\n" << std::endl;
os << "This class is not yet implemented." << std::endl;
os << "Online help is not yet provided." << std::endl;
STFFourierDomainEngine::classhelp(os);
os << "Options and parameters in common for Fourier engines:\n"
<< "NOT YET IMPLEMENTED"
<< std::endl;
Tbase::classhelp(os);
} // void STFEngineNormalize::classhelp(std::ostream& os)
/*----------------------------------------------------------------------*/
const char* STFEngineNormalize::name() const
{
return("STFEngineNormalize");
} // const char const* STFEngineNormalize::name() const
} // namespace stfinv
/* ----- END OF stfinvnormalize.cc ----- */
......@@ -60,22 +60,26 @@ namespace stfinv {
/*! \brief Constructor.
*/
STFEngineNormalize(const stfinv::Tvectoroftriples& triples,
const stfinv::Waveform& stf,
const std::string& parameters)
:Tbase(triples, stf, parameters) { }
const stfinv::Waveform& stf,
const std::string& parameters)
: Tbase(triples, stf, parameters)
{ this->initialize(); }
//! \brief abstract base requires virtual destructor
virtual ~STFEngineNormalize() { }
//! \brief Start engine
virtual void exec() { STFINV_baseillegal; }
virtual void exec();
//! \brief print online help
virtual void help(std::ostream& os=std::cout) const;
//! \brief print online help
static void classhelp(std::ostream& os=std::cout);
//! \brief return name of engine
virtual const char* name() const;
protected:
private:
//! \brief initialize work space
void initialize() { }
void initialize();
// member data
private:
}; // class STFEngineNormalize
} // namespace stfinv
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment