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
7083166f
Commit
7083166f
authored
Feb 14, 2019
by
thomas.forbriger
Browse files
croposp [WP]: provide all commandline parameters to output function
parent
b2d40aea
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/ts/croposp/croposp.cc
View file @
7083166f
...
...
@@ -47,22 +47,6 @@ using std::cout;
using
std
::
cerr
;
using
std
::
endl
;
struct
Options
{
bool
verbose
,
trim
,
debug
,
overwrite
;
std
::
string
inputformat
,
labelpattern
;
double
datetolerance
;
bool
logscale
;
unsigned
int
n_per_decade
;
unsigned
int
nsegments
,
divisor
,
padfactor
;
double
overlap
;
bool
compute_psd
,
compute_npsd
,
compute_coherency
,
compute_transfer
;
bool
compute_phase
;
std
::
string
outfile_psd
,
outfile_npsd
,
outfile_coherency
,
outfile_transfer
;
std
::
string
outfile_phase
;
std
::
string
prefix_psd
,
prefix_npsd
,
prefix_transfer
;
std
::
string
prefix_phase
,
prefix_coherency
;
};
// struct Options
/* ====================================================================== */
// define usage information
...
...
@@ -236,7 +220,7 @@ int main(int iargc, char* argv[])
exit
(
0
);
}
Options
opt
;
croposp
::
Options
opt
;
opt
.
verbose
=
cmdline
.
optset
(
1
);
opt
.
inputformat
=
cmdline
.
string_arg
(
2
);
opt
.
trim
=
cmdline
.
optset
(
3
);
...
...
@@ -469,10 +453,7 @@ int main(int iargc, char* argv[])
{
write_named_series
(
opt
.
outfile_psd
,
"total power spectral density of signals"
,
frequencies
,
PSD_vector
,
opt
.
verbose
,
opt
.
overwrite
);
frequencies
,
PSD_vector
,
opt
);
}
// if (opt.compute_psd)
}
// if (opt.compute_psd || opt.compute_npsd ||
// opt.compute_coherency)
...
...
@@ -617,10 +598,7 @@ int main(int iargc, char* argv[])
write_named_series
(
opt
.
outfile_coherency
,
"coherency of pairs of signals"
,
frequencies
,
coherency_vector
,
opt
.
verbose
,
opt
.
overwrite
);
frequencies
,
coherency_vector
,
opt
);
}
// if (opt.compute_coherency)
...
...
@@ -673,10 +651,7 @@ int main(int iargc, char* argv[])
write_named_series
(
opt
.
outfile_phase
,
"phase transfer function of pairs of signals"
,
frequencies
,
phase_vector
,
opt
.
verbose
,
opt
.
overwrite
);
frequencies
,
phase_vector
,
opt
);
}
// if (opt.compute_phase)
...
...
@@ -727,10 +702,7 @@ int main(int iargc, char* argv[])
write_named_series
(
opt
.
outfile_transfer
,
"amplitude transfer ratio of pairs of signals"
,
frequencies
,
transfer_vector
,
opt
.
verbose
,
opt
.
overwrite
);
frequencies
,
transfer_vector
,
opt
);
}
// if (opt.compute_transfer)
...
...
@@ -813,10 +785,7 @@ int main(int iargc, char* argv[])
write_named_series
(
opt
.
outfile_npsd
,
"power spectral density of incoherent component"
,
frequencies
,
npsd_vector
,
opt
.
verbose
,
opt
.
overwrite
);
frequencies
,
npsd_vector
,
opt
);
}
// if (opt.compute_npsd)
...
...
src/ts/croposp/croposp.h
View file @
7083166f
...
...
@@ -49,6 +49,23 @@
namespace
croposp
{
// a structure to hold all commanline parameters
struct
Options
{
bool
verbose
,
trim
,
debug
,
overwrite
;
std
::
string
inputformat
,
labelpattern
;
double
datetolerance
;
bool
logscale
;
unsigned
int
n_per_decade
;
unsigned
int
nsegments
,
divisor
,
padfactor
;
double
overlap
;
bool
compute_psd
,
compute_npsd
,
compute_coherency
,
compute_transfer
;
bool
compute_phase
;
std
::
string
outfile_psd
,
outfile_npsd
,
outfile_coherency
,
outfile_transfer
;
std
::
string
outfile_phase
;
std
::
string
prefix_psd
,
prefix_npsd
,
prefix_transfer
;
std
::
string
prefix_phase
,
prefix_coherency
;
};
// struct Options
// a struct to hold meta data
struct
Meta
{
tfxx
::
cmdline
::
Filename
filearguments
;
...
...
@@ -139,8 +156,7 @@ namespace croposp {
const
std
::
string
&
comment
,
psd
::
TDseries
f
,
const
TNamedSeriesVector
&
nsv
,
const
bool
&
verbose
,
const
bool
&
overwrite
=
true
);
const
Options
&
opt
);
}
// namespace croposp
...
...
src/ts/croposp/write_named_series.cc
View file @
7083166f
...
...
@@ -46,16 +46,15 @@ namespace croposp {
const
std
::
string
&
comment
,
psd
::
TDseries
f
,
const
TNamedSeriesVector
&
nsv
,
const
bool
&
verbose
,
const
bool
&
overwrite
)
const
Options
&
opt
)
{
if
(
verbose
)
if
(
opt
.
verbose
)
{
cout
<<
endl
<<
"output to file "
<<
filename
<<
":"
<<
endl
<<
comment
<<
endl
;
}
if
(
!
overwrite
)
if
(
!
opt
.
overwrite
)
{
std
::
ifstream
file
(
filename
.
c_str
(),
std
::
ios_base
::
in
);
TFXX_assert
((
!
file
.
good
()),
"ERROR: output file exists!"
);
...
...
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