Commit 91e80cf6 authored by thomas.forbriger's avatar thomas.forbriger
Browse files

croposp [WP]: extract traces into time series collection

parent 9b4f0b37
......@@ -21,6 +21,7 @@
#include <iostream>
#include <tfxx/commandline.h>
#include <tsioxx/cmdlinefiles.h>
#include <tsxx/tscollection.h>
using std::cout;
using std::cerr;
......@@ -98,6 +99,11 @@ int main(int iargc, char* argv[])
TFXX_assert(cmdline.extra(), "missing input file");
tfxx::cmdline::Tparsed arguments=parse_cmdline(cmdline, cmdlinekeys);
// read data files
if (opt.verbose)
{
cout << "Read time series data" << endl;
}
ts::sff::TDFileList input_file_list;
tfxx::cmdline::Tparsed::const_iterator file=arguments.begin();
while (file != arguments.end())
......@@ -112,6 +118,42 @@ int main(int iargc, char* argv[])
++file;
}
// collect traces
typedef ts::TimeSeriesCollection<double> TCollection;
TCollection list_of_series;
typedef ts::sff::DFile::Tfile Tfile;
typedef Tfile::Ttracevector Ttracevector;
ts::sff::TDFileList::const_iterator i_file=input_file_list.begin();
while (i_file != input_file_list.end())
{
Ttracevector::const_iterator i_trace=i_file->data.begin();
while (i_trace != i_file->data.end())
{
list_of_series.push_back(*i_trace);
++i_trace;
}
++i_file;
}
// report traces
if (opt.verbose)
{
cout << "Time series to be analyzed:" << endl;
TCollection::const_iterator i_series=list_of_series.begin();
while (i_series != list_of_series.end())
{
cout << " "
<< i_series->header.station << " "
<< i_series->header.channel << " "
<< i_series->header.auxid << " "
<< "dt=" << i_series->header.dt << "s "
<< "begin: " << i_series->header.date.timestring() << " "
<< "n: " << i_series->header.nsamples
<< endl;
++i_series;
}
}
} // main()
/* ----- END OF croposp.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