Commit 9ddafdec authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

new filter program

This is a legacy commit from before 2015-03-01.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 863
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent f3871fa1
# ---------------------------------------
#
# $Id: Makefile,v 1.13 2001-10-25 22:02:03 forbrig Exp $
# $Id: Makefile,v 1.14 2002-05-24 19:37:41 forbrig Exp $
#
# Makefile fuer tools /src/ts/wf
#
# 22/01/2001 introduced smoos and did some "tidy up"
# 24/10/2001 introduced siggen
# 24/05/2001 introduced tsfilt
#
# ---------------------------------------
......@@ -27,6 +28,11 @@ edit: flist; vim $<
clean:
-/bin/rm *.o *.bak
tsfilt: tsfilt.o
$(CC) $(CFLAGS) $< -o $@ -lseife -ltf \
$(F2CLIB) -L$(LOCLIBDIR) -static
newprog $@
stufi: stufi.o
$(CC) $(CFLAGS) $< -o $@ -lseife -ltf -lsff \
$(F2CLIB) -L$(LOCLIBDIR) -static
......
c this is <tsfilt.f>
c ----------------------------------------------------------------------------
c ($Id: tsfilt.f,v 1.1 2002-05-24 19:37:41 forbrig Exp $)
c
c Copyright (c) 2002 by Thomas Forbriger (IMG Frankfurt)
c
c filter a time series given as a singal table
c
c REVISIONS and CHANGES
c 24/05/2002 V1.0 Thomas Forbriger
c
c ============================================================================
c
program tsfilt
c
character*(*) version
parameter(version=
& 'TSFILT V1.0 filter a time series given as a singal table')
character*(*) TSFILT_CVS_ID
parameter(TSFILT_CVS_ID=
& '$Id: tsfilt.f,v 1.1 2002-05-24 19:37:41 forbrig Exp $')
c
character*80 infile, outfile, filtfile
integer lui,luo,luf
parameter(lui=10,luo=11,luf=12)
integer msamp,nsamp,i
parameter(msamp=1000000)
real tmin,tsec,dt
integer tfstr_trimlen
character*120 par,msg
character*3 typ
double precision x(msamp),t(msamp)
c commandline
integer maxopt, lastarg, iargc
character*80 argument
parameter(maxopt=2)
character*2 optid(maxopt)
character*40 optarg(maxopt)
logical optset(maxopt), opthasarg(maxopt)
c debugging
logical debug, verbose
c here are the keys to our commandline options
data optid/2h-d, 2h-v/
data opthasarg/2*.FALSE./
data optarg/2*1h-/
c
c------------------------------------------------------------------------------
c basic information
c
c
argument=' '
if (iargc().eq.1) call getarg(1, argument)
if ((argument(1:5).eq.'-help').or.(iargc().lt.3)) then
print *,version
print *,'Usage: tsfilt infile outfile filtfile'
print *,' or: tsfilt -help'
if (argument(1:5).ne.'-help')
& stop 'ERROR: wrong number of arguments'
print *,' '
print *,'j'
print *,' '
print *,TSFILT_CVS_ID
stop
endif
c
c------------------------------------------------------------------------------
c read command line arguments
call getarg(1,infile)
call getarg(2,outfile)
call getarg(3,filtfile)
c
call tf_cmdline(1, lastarg, maxopt, optid,
& optarg, optset, opthasarg)
debug=optset(1)
verbose=optset(2)
c
c------------------------------------------------------------------------------
c go
nsamp=1
open(lui,file=infile)
1 read(lui, *, err=99, end=2) t(nsamp),x(nsamp)
nsamp=nsamp+1
goto 1
2 close(lui)
nsamp=nsamp-1
c
dt=t(2)-t(1)
tsec=t(1)
tmin=int(tsec/60.)
tsec=tsec-60.*tmin
c
open(luf,file=filtfile)
3 read(luf, '(a120)') msg
if (msg(1:3).eq.'end') goto 4
typ=msg(1:3)
par=msg(4:)
call seife(typ, par, nsamp, dt, tmin, tsec, x, msg)
print *,msg(1:tfstr_trimlen(msg))
goto 3
4 close(luf)
c
open(luo,file=outfile)
do i=1,nsamp
write(luo, 50) tmin*60.+tsec+(i-1)*dt,x(i)
enddo
close(luo)
c
stop
50 format(2(2x,g20.14))
99 stop 'ERROR: reading data'
end
c
c ----- END OF tsfilt.f -----
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