32 parameter(version=
'TISLI V1.0 write TIme SLIces')
34 integer maxsamples,nsamp,i, maxtraces, j, ntraces
35 parameter(maxsamples=4096,maxtraces=96)
37 real fdata(maxsamples, maxtraces)
38 integer idata(maxsamples, maxtraces)
39 equivalence(fdata,idata)
47 parameter(luin=10, luout=11)
51 real tanf,dt,rdt,minval,maxval
53 integer nstack,ierr,rnsamp
54 real c1(maxtraces), c2(maxtraces), c3(maxtraces)
56 character*14 timestamp
58 character*132 wid2line
60 integer maxopt, lastarg, iargc
63 character*2 optid(maxopt)
64 character*40 optarg(maxopt)
65 logical optset(maxopt), opthasarg(maxopt)
69 logical debug, verbose
71 data optid/2h-d, 2h-v, 2h-l/
72 data opthasarg/3*.false./
80 if (iargc().eq.1)
call getarg(1, argument)
81 if ((argument(1:5).eq.
'-help').or.(iargc().lt.1))
then 83 print *,
'Usage: tisli infile outbase [-l] [-v]' 84 print *,
' or: tisli -help' 85 if (iargc().lt.1) stop
'ERROR: missing arguments' 87 print *,
'write TIme SLIces' 89 print *,
'infile input file containing data from' 90 print *,
' array receivers' 91 print *,
'outbase basename for output files' 93 print *,
'-v be verbose' 94 print *,
'-l output logarithmic values' 96 print *,
'This program reads time series for receivers' 97 print *,
'at different spatial locations (expected to' 98 print *,
'cover an area in the manner of an array).' 99 print *,
'For each time sample a separate ASCII output file' 100 print *,
'is created (with basename ''outbase'') which' 101 print *,
'contains instantaneous signal amplitude at the' 102 print *,
'given location together with horizontal coordinates' 103 print *,
'in an ASCII table. These files are meant to be input' 104 print *,
'to further steps of processing (like graphical' 112 call tf_cmdline(1, lastarg, maxopt, optid,
113 & optarg, optset, opthasarg)
118 call getarg(1, infile)
119 call getarg(2, outbase)
124 call sff_ropen(luin, infile, readversion, timestamp, code, ierr)
125 if (ierr.ne.0) stop
'ERROR: opening input file' 129 do while(.not.(last))
131 if (i.gt.maxtraces) stop
'ERROR: too many traces' 133 call sff_rtracei(luin, tanf, dt,
134 & wid2line, nsamp, fdata(1,ntraces), idata(1,ntraces), code, last
136 if (ierr.ne.0) stop
'ERROR: reading input file' 137 if (cs.ne.
'C') stop
'ERROR: wrong coordinate system' 139 if (dt.ne.rdt) stop
'ERROR: inconsistent sampling rates' 140 if (nsamp.ne.rnsamp) stop
'ERROR: inconsistent number of samples' 151 write(outnum,
'(i4.4)') i
152 outfile=outbase(1:index(outbase,
' ')-1)//
'.'//outnum
153 open(luout, file=outfile, err=99)
155 if (logar) fdata(i,j)=log(abs(fdata(i,j)))
156 write(luout,
'(3(g15.8,2x))', err=97) c1(j), c2(j), fdata(i,j)
157 minval=min(minval,fdata(i,j))
158 maxval=max(maxval,fdata(i,j))
163 print 50,minval,maxval,(minval+maxval)*0.5,
164 & (maxval-minval)*0.1,10,(minval+maxval)*.5
167 50
format(
'minimum: ',g15.8,
' maximum: ',g15.8,
' mean: ',g15.8,/
168 &
'"-C',e15.10,
'" -S',i3.3,
' "-M',e15.10,
'"')
169 99 stop
'ERROR: opening input file' 170 98 stop
'ERROR: closing input file' 171 97 stop
'ERROR: writing input file'