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
fb11f818
Commit
fb11f818
authored
Dec 29, 2018
by
thomas.forbriger
Browse files
croposp [WP]: outline file reading
parent
ffa609a3
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/ts/wf/Makefile
View file @
fb11f818
...
...
@@ -48,13 +48,14 @@
# 01/02/2014 thof: rewrite all linker rules with libraries in
# proper order
# 19/03/2016 thof: tidofi requires libgsl for filter GaussianNoise
# 25/12/2018 thof: add new program croposp
#
# ============================================================================
PROGRAMS
=
tsfilt stufi rotate coro xyz2uvw susei suseix evelo
\
smoos dise foutra teseco resaseda gatherdiff
\
autocorr cross tidofi sigfit noisymize sigval fidasexx soutifu
\
deconv geophone sigscale tisli suspect evelox
deconv geophone sigscale tisli suspect evelox
croposp
.PHONY
:
all
all
:
install doc
...
...
@@ -235,7 +236,7 @@ noisymize: \
$(LINK.cpp)
$^
$(LOADLIBES)
$(LDLIBS)
-o
$@
\
$(LIBTSIOXX)
cross fregra foutra deconv
:
\
croposp
cross fregra foutra deconv
:
\
%: %.o
$(LINK.cpp)
$^
$(LOADLIBES)
$(LDLIBS)
-o
$@
\
-lfourierxx
$(LIBTSIOXX)
-lfftw3
...
...
src/ts/wf/croposp.cc
View file @
fb11f818
...
...
@@ -26,6 +26,11 @@ using std::cout;
using
std
::
cerr
;
using
std
::
endl
;
struct
Options
{
bool
verbose
;
std
::
string
inputformat
;
};
// struct Options
int
main
(
int
iargc
,
char
*
argv
[])
{
...
...
@@ -40,7 +45,11 @@ int main(int iargc, char* argv[])
// define full help text
char
help_text
[]
=
{
" "
"-verbose verbose
\n
"
"-itype f input file format
\n
"
"
\n
"
"t:sel trace selection
\n
"
"f:format file format
\n
"
};
// define commandline options
...
...
@@ -50,15 +59,18 @@ int main(int iargc, char* argv[])
// 0: print help
{
"help"
,
arg_no
,
"-"
},
// 1: verbose mode
{
"v"
,
arg_no
,
"-"
},
{
"verbose"
,
arg_no
,
"-"
},
// 2: default input file format
{
"itype"
,
arg_yes
,
"sff"
},
{
NULL
}
};
// define command line keys for input files
static
const
char
tracekey
[]
=
"t"
;
static
const
char
formatkey
[]
=
"f"
;
// define commandline argument modifier keys
static
const
char
*
cmdlinekeys
[]
=
{
tracekey
,
0
};
static
const
char
*
cmdlinekeys
[]
=
{
tracekey
,
formatkey
,
0
};
// no arguments? print usage...
if
(
iargc
<
2
)
...
...
@@ -77,11 +89,29 @@ int main(int iargc, char* argv[])
cerr
<<
help_text
<<
endl
;
exit
(
0
);
}
Options
opt
;
opt
.
verbose
=
cmdline
.
optset
(
1
);
opt
.
inputformat
=
cmdline
.
string_arg
(
2
);
// extract commandline arguments
TFXX_assert
(
cmdline
.
extra
(),
"missing input file"
);
tfxx
::
cmdline
::
Tparsed
arguments
=
parse_cmdline
(
cmdline
,
cmdlinekeys
);
ts
::
sff
::
TDFileList
input_file_list
;
tfxx
::
cmdline
::
Tparsed
::
const_iterator
file
=
arguments
.
begin
();
while
(
file
!=
arguments
.
end
())
{
std
::
string
format
=
opt
.
inputformat
;
if
(
file
->
haskey
(
formatkey
))
{
format
=
file
->
value
(
formatkey
);
}
input_file_list
.
push_back
(
ts
::
sff
::
readDSFF
(
*
file
,
opt
.
verbose
,
tracekey
,
format
));
++
file
;
}
}
// 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