Commit 7600395e authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

new code

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.


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 1491
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 84cf3382
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: sffistream.cc,v 1.1 2004-02-14 15:21:20 tforb Exp $
* $Id: sffistream.cc,v 1.2 2004-02-19 16:15:57 tforb Exp $
* \author Thomas Forbriger
* \date 10/02/2004
*
......@@ -19,11 +19,11 @@
#define TF_SFFISTREAM_CC_VERSION \
"TF_SFFISTREAM_CC V1.0 "
#define TF_SFFISTREAM_CC_CVSID \
"$Id: sffistream.cc,v 1.1 2004-02-14 15:21:20 tforb Exp $"
"$Id: sffistream.cc,v 1.2 2004-02-19 16:15:57 tforb Exp $"
#include <sffistream.h>
namespace tf {
namespace sff {
}
......
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: sffistream.h,v 1.1 2004-02-14 15:21:21 tforb Exp $
* $Id: sffistream.h,v 1.2 2004-02-19 16:15:57 tforb Exp $
* \author Thomas Forbriger
* \date 10/02/2004
*
......@@ -23,11 +23,73 @@
#define TF_SFFISTREAM_H_VERSION \
"TF_SFFISTREAM_H V1.0 "
#define TF_SFFISTREAM_H_CVSID \
"$Id: sffistream.h,v 1.1 2004-02-14 15:21:21 tforb Exp $"
"$Id: sffistream.h,v 1.2 2004-02-19 16:15:57 tforb Exp $"
namespace tf {
#include<sffxx.h>
#include<iostream>
#include<new>
}
namespace sff {
namespace helper {
class istream_manager {
public:
istream_manager(std::istream& is);
const TraceHeader& traceheader() const;
const FileHeader& fileheader() const;
const INFO& info() const;
const WID2& wid2() const;
const FREE& filefree() const;
const FREE& tracefree() const;
const SRCE& srce() const;
bool hassrce() const;
bool hasfilefree() const;
bool hastracefree() const;
bool hasinfo() const;
bool last() const;
bool good() const;
void skip() const;
protected:
void settraceheader(const TraceHeader& th);
std::istream& Mis;
private:
FileHeader Mfileheader;
TraceHeader Mtraceheader;
}; // class istream_manager
} // namespace helper
//! SFF input stream
template<class C>
class SFFistream: public helper::istream_manager {
public:
typedef C Tseries;
typedef typename C::Tcoc Tcseries;
typedef helper::istream_manager Tbase;
SFFistream(std::istream& is):
Tbase(is) { read(); }
void skip()
{
Mseries=Tseries();
Tbase::skip();
}
Tseries series() const
{
if (this->Tbase::good()) { read(); }
return (Mseries);
}
private:
void read()
{
InputWaveform<Tseries> waveform(Mis);
Tbase::settraceheader(waveform.header());
Mseries=waveform.series();
}
Tseries Mseries;
}; // class SFFistream
} // namespace helper
#endif // TF_SFFISTREAM_H_VERSION (includeguard)
......
/*! \file filavg.h
* \brief remove average (prototypes)
*
* ----------------------------------------------------------------------------
*
* $Id: filavg.h,v 1.1 2004-02-19 16:15:58 tforb Exp $
* \author Thomas Forbriger
* \date 17/02/2004
*
* remove average (prototypes)
*
* Copyright (c) 2004 by Thomas Forbriger (BFO Schiltach)
*
* REVISIONS and CHANGES
* - 17/02/2004 V1.0 Thomas Forbriger
*
* ============================================================================
*/
// include guard
#ifndef TF_FILAVG_H_VERSION
#define TF_FILAVG_H_VERSION \
"TF_FILAVG_H V1.0 "
#define TF_FILAVG_H_CVSID \
"$Id: filavg.h,v 1.1 2004-02-19 16:15:58 tforb Exp $"
namespace tf {
}
#endif // TF_FILAVG_H_VERSION (includeguard)
/* ----- END OF filavg.h ----- */
/*! \file fildec.h
* \brief simple decimation filter (prototypes)
*
* ----------------------------------------------------------------------------
*
* $Id: fildec.h,v 1.1 2004-02-19 16:15:58 tforb Exp $
* \author Thomas Forbriger
* \date 17/02/2004
*
* simple decimation filter (prototypes)
*
* Copyright (c) 2004 by Thomas Forbriger (BFO Schiltach)
*
* REVISIONS and CHANGES
* - 17/02/2004 V1.0 Thomas Forbriger
*
* ============================================================================
*/
// include guard
#ifndef TF_FILDEC_H_VERSION
#define TF_FILDEC_H_VERSION \
"TF_FILDEC_H V1.0 "
#define TF_FILDEC_H_CVSID \
"$Id: fildec.h,v 1.1 2004-02-19 16:15:58 tforb Exp $"
namespace tf {
}
#endif // TF_FILDEC_H_VERSION (includeguard)
/* ----- END OF fildec.h ----- */
/*! \file filtre.h
* \brief remove trend (prototypes)
*
* ----------------------------------------------------------------------------
*
* $Id: filtre.h,v 1.1 2004-02-19 16:15:59 tforb Exp $
* \author Thomas Forbriger
* \date 17/02/2004
*
* remove trend (prototypes)
*
* Copyright (c) 2004 by Thomas Forbriger (BFO Schiltach)
*
* REVISIONS and CHANGES
* - 17/02/2004 V1.0 Thomas Forbriger
*
* ============================================================================
*/
// include guard
#ifndef TF_FILTRE_H_VERSION
#define TF_FILTRE_H_VERSION \
"TF_FILTRE_H V1.0 "
#define TF_FILTRE_H_CVSID \
"$Id: filtre.h,v 1.1 2004-02-19 16:15:59 tforb Exp $"
namespace tf {
}
#endif // TF_FILTRE_H_VERSION (includeguard)
/* ----- END OF filtre.h ----- */
# ---------------------------------------
#
# $Id: Makefile,v 1.17 2004-02-08 15:35:44 tforb Exp $
# $Id: Makefile,v 1.18 2004-02-19 16:15:59 tforb Exp $
#
# Makefile fuer tools /src/ts/wf
#
......@@ -57,7 +57,7 @@ hamres siggen smoos dise: %: %.o
-L$(LOCLIBDIR)
newprog $@
sigfit: sigfit.o
tidofi fredofi sigfit: %: %.o
$(CXX) -o $@ $^ -I$(LOCINCLUDEDIR) -lsffxx -llinearxx -lgsexx -laff \
-ltfxx -ltime++ -llapack -lblas -lg2c -lm\
-L$(LOCLIBDIR) $(CXXFLAGS) $(FLAGS)
......
/*! \file fredofi.cc
* \brief frequency domain filter
*
* ----------------------------------------------------------------------------
*
* $Id: fredofi.cc,v 1.1 2004-02-19 16:16:00 tforb Exp $
* \author Thomas Forbriger
* \date 17/02/2004
*
* frequency domain filter
*
* Copyright (c) 2004 by Thomas Forbriger (BFO Schiltach)
*
* REVISIONS and CHANGES
* - 17/02/2004 V1.0 Thomas Forbriger
*
* ============================================================================
*/
#define FREDOFI_VERSION \
"FREDOFI V1.0 frequency domain filter"
#define FREDOFI_CVSID \
"$Id: fredofi.cc,v 1.1 2004-02-19 16:16:00 tforb Exp $"
#include <iostream>
#include <tfxx/commandline.h>
using std::cout;
using std::cerr;
using std::endl;
int main(int iargc, char* argv[])
{
// define usage information
char usage_text[]=
{
FREDOFI_VERSION "\n"
"usage: fredofi" "\n"
" or: fredofi --help|-h" "\n"
};
// define full help text
char help_text[]=
{
FREDOFI_CVSID
};
// define commandline options
using namespace tfxx::cmdline;
static Declare options[]=
{
// 0: print help
{"help",arg_no,"-"},
// 1: verbose mode
{"v",arg_no,"-"},
{NULL}
};
// no arguments? print usage...
if (iargc<2)
{
cerr << usage_text << endl;
exit(0);
}
// collect options from commandline
Commandline cmdline(iargc, argv, options);
// help requested? print full help text...
if (cmdline.optset(0))
{
cerr << usage_text << endl;
cerr << help_text << endl;
exit(0);
}
// dummy operation: print option settings
for (int iopt=0; iopt<2; iopt++)
{
cout << "option: '" << options[iopt].opt_string << "'" << endl;
if (cmdline.optset(iopt)) { cout << " option was set"; }
else { cout << "option was not set"; }
cout << endl;
cout << " argument (string): '" << cmdline.string_arg(iopt) << "'" << endl;
cout << " argument (int): '" << cmdline.int_arg(iopt) << "'" << endl;
cout << " argument (long): '" << cmdline.long_arg(iopt) << "'" << endl;
cout << " argument (float): '" << cmdline.float_arg(iopt) << "'" << endl;
cout << " argument (double): '" << cmdline.double_arg(iopt) << "'" << endl;
cout << " argument (bool): '";
if (cmdline.bool_arg(iopt))
{ cout << "true"; } else { cout << "false"; }
cout << "'" << endl;
}
while (cmdline.extra()) { cout << cmdline.next() << endl; }
// dummy operation: print rest of command line
while (cmdline.extra()) { cout << cmdline.next() << endl; }
}
/* ----- END OF fredofi.cc ----- */
/*! \file tidofi.cc
* \brief time domain filter
*
* ----------------------------------------------------------------------------
*
* $Id: tidofi.cc,v 1.1 2004-02-19 16:16:00 tforb Exp $
* \author Thomas Forbriger
* \date 17/02/2004
*
* time domain filter
*
* Copyright (c) 2004 by Thomas Forbriger (BFO Schiltach)
*
* REVISIONS and CHANGES
* - 17/02/2004 V1.0 Thomas Forbriger
*
* ============================================================================
*/
#define TIDOFI_VERSION \
"TIDOFI V1.0 time domain filter"
#define TIDOFI_CVSID \
"$Id: tidofi.cc,v 1.1 2004-02-19 16:16:00 tforb Exp $"
#include <iostream>
#include <tfxx/commandline.h>
using std::cout;
using std::cerr;
using std::endl;
int main(int iargc, char* argv[])
{
// define usage information
char usage_text[]=
{
TIDOFI_VERSION "\n"
"usage: tidofi" "\n"
" or: tidofi --help|-h" "\n"
};
// define full help text
char help_text[]=
{
TIDOFI_CVSID
};
// define commandline options
using namespace tfxx::cmdline;
static Declare options[]=
{
// 0: print help
{"help",arg_no,"-"},
// 1: verbose mode
{"v",arg_no,"-"},
{NULL}
};
// no arguments? print usage...
if (iargc<2)
{
cerr << usage_text << endl;
exit(0);
}
// collect options from commandline
Commandline cmdline(iargc, argv, options);
// help requested? print full help text...
if (cmdline.optset(0))
{
cerr << usage_text << endl;
cerr << help_text << endl;
exit(0);
}
// dummy operation: print option settings
for (int iopt=0; iopt<2; iopt++)
{
cout << "option: '" << options[iopt].opt_string << "'" << endl;
if (cmdline.optset(iopt)) { cout << " option was set"; }
else { cout << "option was not set"; }
cout << endl;
cout << " argument (string): '" << cmdline.string_arg(iopt) << "'" << endl;
cout << " argument (int): '" << cmdline.int_arg(iopt) << "'" << endl;
cout << " argument (long): '" << cmdline.long_arg(iopt) << "'" << endl;
cout << " argument (float): '" << cmdline.float_arg(iopt) << "'" << endl;
cout << " argument (double): '" << cmdline.double_arg(iopt) << "'" << endl;
cout << " argument (bool): '";
if (cmdline.bool_arg(iopt))
{ cout << "true"; } else { cout << "false"; }
cout << "'" << endl;
}
while (cmdline.extra()) { cout << cmdline.next() << endl; }
// dummy operation: print rest of command line
while (cmdline.extra()) { cout << cmdline.next() << endl; }
}
/* ----- END OF tidofi.cc ----- */
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