33 &
'TSFILT V1.0 filter a time series given as a signal table')
35 character*80 infile, outfile, filtfile
37 parameter(lui=10,luo=11,luf=12)
39 parameter(msamp=1000000)
44 double precision x(msamp),t(msamp)
46 integer maxopt, lastarg, iargc
49 character*2 optid(maxopt)
50 character*40 optarg(maxopt)
51 logical optset(maxopt), opthasarg(maxopt)
53 logical debug, verbose
55 data optid/2h-d, 2h-v/
56 data opthasarg/2*.false./
64 if (iargc().eq.1)
call getarg(1, argument)
65 if ((argument(1:5).eq.
'-help').or.(iargc().lt.3))
then 67 print *,
'Usage: tsfilt infile outfile filtfile' 68 print *,
' or: tsfilt -help' 69 if (argument(1:5).ne.
'-help')
70 & stop
'ERROR: wrong number of arguments' 72 print *,
'infile input signal' 73 print *,
'outfile output signal' 74 print *,
'filtfile seife control file (see stufi)' 76 print *,
'infile and outfile are two-column ASCII data files.' 77 print *,
'The first column contains time in seconds, the' 78 print *,
'second column provides the respective sample values.' 79 print *,
'Sampling is assumed to be equidistant. This' 80 print *,
'assumption is not(!) checked against actual sample' 81 print *,
'times. The time of first sample and the sampling' 82 print *,
'interval are derived from the first two time' 90 call getarg(2,outfile)
91 call getarg(3,filtfile)
93 call tf_cmdline(1, lastarg, maxopt, optid,
94 & optarg, optset, opthasarg)
101 open(lui,file=infile)
102 1
read(lui, *, err=99, end=2) t(nsamp),x(nsamp)
113 open(luf,file=filtfile)
114 3
read(luf,
'(a120)') msg
115 if (msg(1:3).eq.
'end')
goto 4
118 call seife(typ, par, nsamp, dt, tmin, tsec, x, msg)
119 print *,msg(1:tfstr_trimlen(msg))
123 open(luo,file=outfile)
125 write(luo, 50) tmin*60.+tsec+(i-1)*dt,x(i)
130 50
format(2(2x,g20.14))
131 99 stop
'ERROR: reading data'