Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Seitosh
Seitosh
Commits
91e80cf6
Commit
91e80cf6
authored
Dec 29, 2018
by
thomas.forbriger
Browse files
croposp [WP]: extract traces into time series collection
parent
9b4f0b37
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/ts/wf/croposp.cc
View file @
91e80cf6
...
...
@@ -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 ----- */
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment