Commit 445b8ea4 authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

commiting waiting additions and modifications...

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.
no clear status...


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 3924
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent edc04c4e
...@@ -206,7 +206,15 @@ DOXYWWWPATH=$(TF_WWWBASEDIR)/libstfinv ...@@ -206,7 +206,15 @@ DOXYWWWPATH=$(TF_WWWBASEDIR)/libstfinv
doxyclean: ;/bin/rm -rfv $(DOXYWWWPATH) doxydoc.xxx doxyclean: ;/bin/rm -rfv $(DOXYWWWPATH) doxydoc.xxx
DOXYSRC=$(LIBCCSRC) $(LIBCSRC) $(LIBHEADERS) README $(TESTCCSRC) $(TESTCSRC) onlinehelp.xxx: onlinehelp
echo '/*! \page page_help Online help texts' > $@
echo '\code' >> $@
./$< -help 2>&1 >> $@ 2>&1
echo '\endcode' >> $@
echo '*/' >> $@
DOXYSRC=$(LIBCCSRC) $(LIBCSRC) $(LIBHEADERS) README $(TESTCCSRC) $(TESTCSRC) \
onlinehelp.xxx
PWD=$(shell env pwd) PWD=$(shell env pwd)
# create doxygen intermediate configuration # create doxygen intermediate configuration
......
...@@ -110,6 +110,25 @@ $Id$ ...@@ -110,6 +110,25 @@ $Id$
Online help is made available through stfinv::STFEngine::help() and Online help is made available through stfinv::STFEngine::help() and
stfinv::help(). stfinv::help().
\todo
Engines I consider to implement:
- blind deconvolution in the Fourier domain:
stfinv::STFEngineBlindDeconvolution
- stf which just applies a scalar factor:
stfinv::STFEngineIdentity
- stf read from file (always the same stf, independent of data and
synthetics):
stfinv::STFEngineFixedWavelet
- stf which normalizes the synthetics in the Fourier domain; this ensures
that data and synthetic always contain the same signal energy; this avoid
a zero stf during the first iterations starting from a new inappropriate
initial model:
stfinv::STFEngineNormalize
- causal and time limited stf as found by convolution condition in the time
domain; this is a solution to a system of linear equations and will
requires LAPACK:
stfinv::STFEngineFiniteCausal
\date 08.05.2011 \date 08.05.2011
*/ */
......
...@@ -89,7 +89,7 @@ WARN_LOGFILE = ...@@ -89,7 +89,7 @@ WARN_LOGFILE =
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
INPUT = ./ INPUT = ./
INPUT_ENCODING = UTF-8 INPUT_ENCODING = UTF-8
FILE_PATTERNS = README \ FILE_PATTERNS = README onlinehelp.xxx \
*.h \ *.h \
*.cc *.cc
RECURSIVE = YES RECURSIVE = YES
......
...@@ -38,7 +38,6 @@ ...@@ -38,7 +38,6 @@
#define STFINV_PARAMETERHANDLER_CC_CVSID \ #define STFINV_PARAMETERHANDLER_CC_CVSID \
"$Id$" "$Id$"
#include<iostream>
#include <stfinv/parameterhandler.h> #include <stfinv/parameterhandler.h>
std::string stfinv::tools::clipstring(std::string& s, const std::string& delim) std::string stfinv::tools::clipstring(std::string& s, const std::string& delim)
...@@ -53,6 +52,23 @@ std::string stfinv::tools::clipstring(std::string& s, const std::string& delim) ...@@ -53,6 +52,23 @@ std::string stfinv::tools::clipstring(std::string& s, const std::string& delim)
s.erase(); s.erase();
} }
return(result); return(result);
} } // std::string stfinv::tools::clipstring^
/*----------------------------------------------------------------------*/
stfinv::tools::Tparamap stfinv::tools::makeparamap(const std::string& p,
const std::string& delimiter,
const std::string& assign)
{
std::string pstring=p;
stfinv::tools::Tparamap retval;
while (pstring.length()>0)
{
std::string para=stfinv::tools::clipstring(pstring, delimiter);
std::string key=stfinv::tools::clipstring(para, assign);
retval.insert(make_pair(key, para));
}
return retval;
} // stfinv::tools::Tparamap stfinv::tools::makeparamap()
/* ----- END OF parameterhandler.cc ----- */ /* ----- END OF parameterhandler.cc ----- */
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
"$Id$" "$Id$"
#include <string> #include <string>
#include <map>
namespace stfinv { namespace stfinv {
...@@ -64,6 +65,37 @@ namespace stfinv { ...@@ -64,6 +65,37 @@ namespace stfinv {
*/ */
std::string clipstring(std::string& s, const std::string& delim=":"); std::string clipstring(std::string& s, const std::string& delim=":");
/*----------------------------------------------------------------------*/
/*! \brief A map to store parameters.
* \ingroup tools
*/
typedef std::map<std::string,std::string> Tparamap;
/*----------------------------------------------------------------------*/
/*! \brief Create a parameter map from a parameter string
* \ingroup tools
*
* \para p parameter string
* \para delimiter delimiter which separates two parameters
* \para assign symbol seprating key and value
* \return a multimap created from the parameter string
*/
Tparamap makeparamap(const std::string& p,
const std::string& delimiter=":",
const std::string& assign="=");
/*----------------------------------------------------------------------*/
/*! replace comma by whitespace
* \ingroup tools
*
* \param s input string
* \return input string with all commas replaced by whitespace
*/
std::string commatospace(const std::string& s);
} // namespace tools } // namespace tools
} // namespace stfinv } // namespace stfinv
......
...@@ -113,7 +113,7 @@ namespace stfinv { ...@@ -113,7 +113,7 @@ namespace stfinv {
* \ingroup cxxinterface * \ingroup cxxinterface
*/ */
class STFBaseEngine { class STFBaseEngine {
public: protected:
/*! \brief Constructor. /*! \brief Constructor.
*/ */
STFBaseEngine(const stfinv::Tvectoroftriples& triples, STFBaseEngine(const stfinv::Tvectoroftriples& triples,
...@@ -123,6 +123,7 @@ namespace stfinv { ...@@ -123,6 +123,7 @@ namespace stfinv {
{ {
this->checkconsistency(); this->checkconsistency();
} }
public:
//! \brief abstract base requires virtual destructor //! \brief abstract base requires virtual destructor
virtual ~STFBaseEngine() { } virtual ~STFBaseEngine() { }
//! \brief Start engine and return source time function. //! \brief Start engine and return source time function.
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#define STFINV_STFINVBLINDDECONV_CC_CVSID \ #define STFINV_STFINVBLINDDECONV_CC_CVSID \
"$Id$" "$Id$"
#include <iostream>
#include <stfinv/stfinvblinddeconv.h> #include <stfinv/stfinvblinddeconv.h>
namespace stfinv { namespace stfinv {
...@@ -49,6 +50,13 @@ namespace stfinv { ...@@ -49,6 +50,13 @@ namespace stfinv {
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
stfinv::Waveform STFEngineBlindDeconvolution::run()
{
STFINV_abort("STFEngineBlindDeconvolution::run not yet implemented");
} // void STFEngineBlindDeconvolution::run()
/*----------------------------------------------------------------------*/
void STFEngineBlindDeconvolution::help(std::ostream& os) const void STFEngineBlindDeconvolution::help(std::ostream& os) const
{ {
STFEngineBlindDeconvolution::classhelp(os); STFEngineBlindDeconvolution::classhelp(os);
......
...@@ -42,17 +42,17 @@ ...@@ -42,17 +42,17 @@
#define STFINV_STFINVBLINDDECONV_H_CVSID \ #define STFINV_STFINVBLINDDECONV_H_CVSID \
"$Id$" "$Id$"
#include<stfinv/stfinvbase.h> #include<stfinv/stfinvfourier.h>
namespace stfinv { namespace stfinv {
/*! \brief Blind deconvolution engine /*! \brief Blind deconvolution engine
* \ingroup engines * \ingroup engines
*/ */
class STFEngineBlindDeconvolution: public stfinv::STFBaseEngine { class STFEngineBlindDeconvolution: public stfinv::STFFourierDomainEngine {
public: public:
//! \brief typedef to refer to base class //! \brief typedef to refer to base class
typedef stfinv::STFBaseEngine Tbase; typedef stfinv::STFFourierDomainEngine Tbase;
//! \brief ID used to select thsi engine //! \brief ID used to select thsi engine
static const char* const ID; static const char* const ID;
//! \brief short description of this engine //! \brief short description of this engine
......
...@@ -49,6 +49,13 @@ namespace stfinv { ...@@ -49,6 +49,13 @@ namespace stfinv {
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
stfinv::Waveform STFEngineFixedWavelet::run()
{
STFINV_abort("STFEngineFixedWavelet::run not yet implemented");
} // void STFEngineFixedWavelet::run()
/*----------------------------------------------------------------------*/
void STFEngineFixedWavelet::help(std::ostream& os) const void STFEngineFixedWavelet::help(std::ostream& os) const
{ {
STFEngineFixedWavelet::classhelp(os); STFEngineFixedWavelet::classhelp(os);
......
...@@ -42,17 +42,17 @@ ...@@ -42,17 +42,17 @@
#define STFINV_STFINVFIXEDSTF_H_CVSID \ #define STFINV_STFINVFIXEDSTF_H_CVSID \
"$Id$" "$Id$"
#include<stfinv/stfinvbase.h> #include<stfinv/stfinvfourier.h>
namespace stfinv { namespace stfinv {
/*! \brief Engine to provide a fixed wavelet /*! \brief Engine to provide a fixed wavelet
* \ingroup engines * \ingroup engines
*/ */
class STFEngineFixedWavelet: public stfinv::STFBaseEngine { class STFEngineFixedWavelet: public stfinv::STFFourierDomainEngine {
public: public:
//! \brief typedef to refer to base class //! \brief typedef to refer to base class
typedef stfinv::STFBaseEngine Tbase; typedef stfinv::STFFourierDomainEngine Tbase;
//! \brief ID used to select thsi engine //! \brief ID used to select thsi engine
static const char* const ID; static const char* const ID;
//! \brief short description of this engine //! \brief short description of this engine
......
/*! \file stfinvfourier.cc
* \brief a base class for all engines which operate in the Fourier domain (implementation)
*
* ----------------------------------------------------------------------------
*
* $Id$
* \author Thomas Forbriger
* \date 08/05/2011
*
* a base class for all engines which operate in the Fourier domain (implementation)
*
* Copyright (c) 2011 by Thomas Forbriger (BFO Schiltach)
*
* ----
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* ----
*
*
* REVISIONS and CHANGES
* - 08/05/2011 V1.0 Thomas Forbriger
*
* ============================================================================
*/
#define STFINV_STFINVFOURIER_CC_VERSION \
"STFINV_STFINVFOURIER_CC V1.0 "
#define STFINV_STFINVFOURIER_CC_CVSID \
"$Id$"
#include <stfinv/stfinvfourier.h>
namespace stfinv {
/*----------------------------------------------------------------------*/
stfinv::Waveform STFFourierDomainEngine::run()
{
STFINV_abort("STFFourierDomainEngine::run not yet implemented");
} // void STFFourierDomainEngine::run()
/*----------------------------------------------------------------------*/
void STFFourierDomainEngine::help(std::ostream& os) const
{
STFFourierDomainEngine::classhelp(os);
} // void STFFourierDomainEngine::help(std::ostream& os) const
/*----------------------------------------------------------------------*/
void STFFourierDomainEngine::classhelp(std::ostream& os)
{
os << "This class is not yet implemented." << std::endl;
os << "Online help is not yet provided." << std::endl;
} // void STFFourierDomainEngine::classhelp(std::ostream& os)
} // namespace stfinv
/* ----- END OF stfinvfourier.cc ----- */
/*! \file stfinvfourier.h
* \brief a base class for all engines which operate in the Fourier domain (prototypes)
*
* ----------------------------------------------------------------------------
*
* $Id$
* \author Thomas Forbriger
* \date 08/05/2011
*
* a base class for all engines which operate in the Fourier domain (prototypes)
*
* Copyright (c) 2011 by Thomas Forbriger (BFO Schiltach)
*
* ----
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* ----
*
*
* REVISIONS and CHANGES
* - 08/05/2011 V1.0 Thomas Forbriger
*
* ============================================================================
*/
// include guard
#ifndef STFINV_STFINVFOURIER_H_VERSION
#define STFINV_STFINVFOURIER_H_VERSION \
"STFINV_STFINVFOURIER_H V1.0 "
#define STFINV_STFINVFOURIER_H_CVSID \
"$Id$"
#include <stfinv/stfinvbase.h>
namespace stfinv {
/*! \brief Base class for all engines which operate in the Fourier domain
*
* This is just a base class.
* The constructor is protected and should only be called from a derived
* class.
*/
class STFFourierDomainEngine: public stfinv::STFBaseEngine {
public:
//! \brief typedef to refer to base class
typedef stfinv::STFBaseEngine Tbase;
protected:
/*! \brief Constructor.
*/
STFFourierDomainEngine(const stfinv::Tvectoroftriples& triples,
const stfinv::Waveform& stf,
const std::string& parameters)
:Tbase(triples, stf, parameters) { }
//! \brief abstract base requires virtual destructor
public:
virtual ~STFFourierDomainEngine() { }
//! \brief Start engine and return source time function.
virtual stfinv::Waveform run();
//! \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);
}; // class STFFourierDomainEngine
}
#endif // STFINV_STFINVFOURIER_H_VERSION (includeguard)
/* ----- END OF stfinvfourier.h ----- */
...@@ -49,6 +49,13 @@ namespace stfinv { ...@@ -49,6 +49,13 @@ namespace stfinv {
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
stfinv::Waveform STFEngineIdentity::run()
{
STFINV_abort("STFEngineIdentity::run not yet implemented");
} // void STFEngineIdentity::run()
/*----------------------------------------------------------------------*/
void STFEngineIdentity::help(std::ostream& os) const void STFEngineIdentity::help(std::ostream& os) const
{ {
STFEngineIdentity::classhelp(os); STFEngineIdentity::classhelp(os);
......
/*! \file stfinvnormalize.cc
* \brief a Fourier domain engine which finds a normalizing source wavelet (implementation)
*
* ----------------------------------------------------------------------------
*
* $Id$
* \author Thomas Forbriger
* \date 08/05/2011
*
* a Fourier domain engine which finds a normalizing source wavelet (implementation)
*
* Copyright (c) 2011 by Thomas Forbriger (BFO Schiltach)
*
* ----
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* ----
*
*
* REVISIONS and CHANGES
* - 08/05/2011 V1.0 Thomas Forbriger
*
* ============================================================================
*/
#define STFINV_STFINVNORMALIZE_CC_VERSION \
"STFINV_STFINVNORMALIZE_CC V1.0 "
#define STFINV_STFINVNORMALIZE_CC_CVSID \
"$Id$"
#include <stfinv/stfinvnormalize.h>
namespace stfinv {
const char* const STFEngineNormalize::ID="fbd";
const char* const STFEngineNormalize::description
="blind deconvolution in the frequency domain";
/*----------------------------------------------------------------------*/
void STFEngineNormalize::help(std::ostream& os) const
{
STFEngineNormalize::classhelp(os);
} // void STFEngineNormalize::help(std::ostream& os) const
/*----------------------------------------------------------------------*/
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;
} // void STFEngineNormalize::classhelp(std::ostream& os)
} // namespace stfinv
/* ----- END OF stfinvnormalize.cc ----- */
/*! \file stfinvnormalize.h
* \brief a Fourier domain engine which finds a normalizing source wavelet (prototypes)
*
* ----------------------------------------------------------------------------
*
* $Id$
* \author Thomas Forbriger
* \date 08/05/2011
*
* a Fourier domain engine which finds a normalizing source wavelet (prototypes)
*
* Copyright (c) 2011 by Thomas Forbriger (BFO Schiltach)
*
* ----
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* ----
*
*
* REVISIONS and CHANGES
* - 08/05/2011 V1.0 Thomas Forbriger
*
* ============================================================================
*/
// include guard
#ifndef STFINV_STFINVNORMALIZE_H_VERSION
#define STFINV_STFINVNORMALIZE_H_VERSION \
"STFINV_STFINVNORMALIZE_H V1.0 "
#define STFINV_STFINVNORMALIZE_H_CVSID \
"$Id$"
#include<stfinv/stfinvfourier.h>
namespace stfinv {
/*! \brief Blind deconvolution engine
* \ingroup engines
*/
class STFEngineNormalize: public stfinv::STFFourierDomainEngine {
public:
//! \brief typedef to refer to base class
typedef stfinv::STFFourierDomainEngine Tbase;
//! \brief ID used to select thsi engine
static const char* const ID;
//! \brief short description of this engine
static const char* const description;
/*! \brief Constructor.
*/
STFEngineNormalize(const stfinv::Tvectoroftriples& triples,
const stfinv::Waveform& stf,
const std::string& parameters)
:Tbase(triples, stf, parameters) { }
//! \brief abstract base requires virtual destructor
virtual ~STFEngineNormalize() { }
//! \brief Start engine and return source time function.
virtual stfinv::Waveform run();
//! \brief print online help
virtual void help(std::ostream& os=std::cout) const;
//! \brief print online help