Commit 61607047 authored by Daniel Armbruster's avatar Daniel Armbruster Committed by thomas.forbriger
Browse files

support different output file formats

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: 4716
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent bbbe5e2f
......@@ -21,6 +21,7 @@
# - use FFTW3
# 10/02/2011 V1.4 distinguish between compilation and installation
# 24/06/2011 V1.5 moved tests to distinguished Makefiles
# 25/05/2012 V1.6 link siggen against libfapidxx (damb)
#
# ============================================================================
......@@ -88,10 +89,14 @@ stufi: %: %.o
$(FC) $(FFLAGS) $(LDFLAGS) $< -o $@ -lseife -ltf -lsff
susei evelo tesiff teswf rotate coro xyz2uvw: %: %.o
$(FC) $(FFLAGS) $(LDFLAGS) $< -o $@ -ltf -lsff
phasedsignals hamres siggen smoos dise: %: %.o
phasedsignals hamres smoos dise: %: %.o
$(FC) $(FFLAGS) $(LDFLAGS) $< -o $@ \
-ltf -lsffu -ltime -lsff -lgsl -lm -lgslcblas
siggen: %: %.o
$(FC) $(FFLAGS) $(LDFLAGS) $< -o $@ -ltf -lsffu -lfapidxx -ldatrwxx -lsffxx \
-lgsexx -ltime++ -laff -lgsl -lm -lgslcblas
deconv foutra sigval: \
%: %.o
$(CXX) -o $@ $^ -I$(LOCINCLUDEDIR) -lfourierxx -lfftw3 -lm \
......@@ -140,6 +145,7 @@ soutifu: soutifu.o
geophone: %: %.o
$(LINK.cc) $^ -laff -lsffxx -lgsexx -ltime++ -ltfxx $(LDFLAGS) -o $@
#======================================================================
# documentation part
# ------------------
......
......@@ -33,14 +33,16 @@ c 01/07/2002 V1.5 added test triangle
c 12/09/2007 V1.6 provide GSL random numbers
c 05/04/2011 V1.7 provide logarithmic sweep
c 20/04/2011 V1.8 provide better control for sweep
c 16/02/2012 V1.9 added cosine function
c 16/02/2012 V1.9 added cosine function (damb)
c 25/05/2012 V2.0 Support different output file type (libfapidxx
c interface in use) (damb)
c
c==============================================================================
c
program siggen
c
character*(*) version
parameter(version='SIGGEN V1.8 SIGnal GENerator')
parameter(version='SIGGEN V2.0 SIGnal GENerator')
character*(*) SIGGEN_CVS_ID
parameter(SIGGEN_CVS_ID=
& '$Id$')
......@@ -67,8 +69,8 @@ c data space
double precision dseries(maxsamples)
c commandline
integer maxopt, lastarg, iargc
character*80 argument
parameter(maxopt=18)
character*80 argument, outformat
parameter(maxopt=19)
character*3 optid(maxopt)
character*40 optarg(maxopt)
logical optset(maxopt), opthasarg(maxopt)
......@@ -77,10 +79,10 @@ c debugging
c here are the keys to our commandline options
data optid/2h-D, 2h-v, 2h-o, 2h-f, 2h-T, 2h-a, 2h-d,
& 3h-Ta,3h-Te,2h-n,3h-Td,3h-Tm,3h-f1,3h-f2,2h-e,
& 2h-b,2h-c,2h-s/
data opthasarg/3*.FALSE.,15*.TRUE./
& 2h-b,2h-c,2h-s,'-ot'/
data opthasarg/3*.FALSE.,16*.TRUE./
data optarg/3*1h-,3h20.,2*2h1.,4h.001,2h0.,3h.02,1h5,5h1.e20,4h.005,
& 2*3h20.,4*1h1/
& 2*3h20.,4*1h1,'sff'/
c
c------------------------------------------------------------------------------
c basic information
......@@ -93,7 +95,7 @@ c
print *,'Usage: siggen type file [-v] [-o] [-f f] [-T T] [-a a] [-d d]'
print *,' [-Ta Ta] [-Te Te] [-Td Td] [-Tm Tm]'
print *,' [-n n] [-f1 f1] [-f2 f2] [-b b] [-c c]'
print *,' [-s s]'
print *,' [-s s] [-ot f]'
print *,' or: siggen -help'
if (argument(1:5).ne.'-help') stop 'ERROR: wrong number of arguments'
print *,' '
......@@ -101,7 +103,7 @@ c
print *,' '
c
print *,'type select signal type ''type'' (see list below)'
print *,'file SFF output file'
print *,'file output file'
print *,' '
print *,'-o overwrite existing output file'
print *,'-v be verbose'
......@@ -138,6 +140,7 @@ c
print *,' (default: ',optarg(13)(1:3),')'
print *,'-f2 f2 set frequency parameter f2 to ''f2''Hz'
print *,' (default: ',optarg(14)(1:3),')'
print *,'-ot f select output data file format f'
print *,' '
print *,'type signal'
print *,'-------------------------'
......@@ -266,6 +269,8 @@ c
print *,' f(t)=a*cos(2*pi*f*t)'
print *,' '
print *,SIGGEN_CVS_ID
print *,' '
call sff_help_formats
stop
endif
c
......@@ -296,6 +301,7 @@ c
read(optarg(16), *) b
read(optarg(17), *) c
read(optarg(18), *) s
if (optset(19)) outformat=optarg(19)
c
c------------------------------------------------------------------------------
......@@ -723,9 +729,15 @@ c slope
endif
if (overwrite) then
call sff_New(lu,filename,i)
call sff_new(lu,filename,i)
if (i.ne.0) stop 'ERROR: deleting output file'
endif
c open output file
call sff_select_output_format(outformat, ierr)
if (ierr.ne.0) stop 'ERROR: selecting output file format'
c call sff_wopens(lu,filename,'NSP',)
c call sff_close(lu,i)
c if (i.ne.0) stop 'ERROR: closing output file'
call sffu_simpleopen(lu,filename)
call sffu_simplewrite(lu, .true., series, nsamples, sngl(d), 0.)
......
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