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

proceeding

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: 2219
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 4014080a
......@@ -4,7 +4,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: readtsdata.cc,v 1.3 2007-02-05 14:08:44 tforb Exp $
* $Id: readtsdata.cc,v 1.4 2007-02-12 10:27:03 tforb Exp $
* \author Thomas Forbriger
* \date 31/01/2007
*
......@@ -37,12 +37,75 @@
#define TF_READTSDATA_CC_VERSION \
"TF_READTSDATA_CC V1.0 "
#define TF_READTSDATA_CC_CVSID \
"$Id: readtsdata.cc,v 1.3 2007-02-05 14:08:44 tforb Exp $"
"$Id: readtsdata.cc,v 1.4 2007-02-12 10:27:03 tforb Exp $"
#include <tfxx/readtsdata.h>
namespace tf {
namespace tfxx {
namespace tsio {
}
//! read complete SFF file
DFile readDSFF(const std::string& filename)
{
DFile::Trangelist rangelist;
return (readDSFF(filename, rangelist));
}
/*----------------------------------------------------------------------*/
//! read complete SFF file with trace selection
DFile readDSFF(const std::string& filename,
const DFile::Trangelist& selection,
const bool& verbose,
const datread::Eformat& format)
{
DFile retval;
retval.arguments.name=filename;
if (verbose)
{
std::cout << "open input file " << filename << std::endl;
}
std::ifstream ifs(filename.c_str());
datread::ianystream is(ifs, format);
retval.data.read(is.idatstream(), selection, verbose);
return(retval);
}
/*----------------------------------------------------------------------*/
//! read complete SFF file with trace selection
DFile readDSFF(const tfxx::cmdline::Filename& filename,
const bool& verbose,
Ttracelistkey tracekey,
const datread::Eformat& format)
{
DFile::Trangelist selection=
tfxx::string::rangelist<DFile::Trangelist::Tvalue>(
filename.value(tracekey));
DFile retval=readDSFF(filename.name, selection, verbose, format);
retval.arguments=filename;
return(retval);
}
/*----------------------------------------------------------------------*/
//! read complete list of SFF files with trace selection
TDFileList readDSFF(const tfxx::cmdline::Tparsed& flist,
const bool& verbose,
Ttracelistkey tracekey,
const datread::Eformat& format)
{
TDFileList retval;
tfxx::cmdline::Tparsed::const_iterator file=flist.begin();
while (file != flist.end())
{
retval.push_back(readDSFF(*file, verbose, tracekey, format));
++file;
}
return(retval);
}
} // namespace tsio
} // namespace tfxx
/* ----- END OF readtsdata.cc ----- */
......@@ -4,7 +4,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: readtsdata.h,v 1.3 2007-02-09 08:50:21 tforb Exp $
* $Id: readtsdata.h,v 1.4 2007-02-12 10:27:04 tforb Exp $
* \author Thomas Forbriger
* \date 31/01/2007
*
......@@ -41,7 +41,15 @@
#define TF_READTSDATA_H_VERSION \
"TF_READTSDATA_H V1.0 "
#define TF_READTSDATA_H_CVSID \
"$Id: readtsdata.h,v 1.3 2007-02-09 08:50:21 tforb Exp $"
"$Id: readtsdata.h,v 1.4 2007-02-12 10:27:04 tforb Exp $"
#include<tfxx/rangelist.h>
#include<tfxx/xcmdline.h>
#include<tfxx/rangestring.h>
#include<datreadxx/readany.h>
#include<tsxx/sffheaders.h>
#include<iostream>
#include<fstream>
/*! \defgroup group_readtsdata Reading of time series data.
* \brief Read a complete set of time series including the selection of
......@@ -69,30 +77,47 @@ namespace tfxx {
typedef tfxx::RangeList<int> Ttracelist;
//! type of trace selection key
typedef const char[] Ttracelistkey;
typedef const char* Ttracelistkey;
//! structure to contain file data together with command line arguments
struct File {
struct DFile {
// provides reading into doubles
typedef double Tvalue;
// container to be used
typedef aff::Series<Tvalue> Tseries;
// file container
typedef ts::sff::File<Tseries> Tfile;
//! rangelist
typedef Tfile::Trangelist Trangelist;
// command line arguments
tfxx::cmdline::Filename arguments;
// container to hold samples
ts::sff::File<C> data;
ts::sff::File<Tseries> data;
}; // struct File
//! complete list of files
typedef std::list<DFile> TDFileList;
//! read complete SFF file
readSFF(const std::string& filename);
DFile readDSFF(const std::string& filename);
//! read complete SFF file with trace selection
readSFF(const std::string& filename,
const Ttracelist& selection);
DFile readDSFF(const std::string& filename,
const DFile::Trangelist& selection,
const bool& verbose=false,
const datread::Eformat& format=datread::Fsff);
//! read complete SFF file with trace selection
readSFF(const tfxx::cmdline::Filename& filename,
const Tracelistkey="t");
DFile readDSFF(const tfxx::cmdline::Filename& filename,
const bool& verbose=false,
Ttracelistkey="t",
const datread::Eformat& format=datread::Fsff);
//! read complete list of SFF files with trace selection
readSFF(const tfxx::cmdline::Tparsed& flist,
const Tracelistkey="t");
TDFileList readDSFF(const tfxx::cmdline::Tparsed& flist,
const bool& verbose=false,
Ttracelistkey="t",
const datread::Eformat& format=datread::Fsff);
} // namespace tsio
......
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