Commit 05c777d5 authored by thomas.forbriger's avatar thomas.forbriger
Browse files

[WP] (stf_issue12): add to soutifu test cases

- provide detailed documentation
- add noise to synthetic test data
- provide control plots
parent fbb90ab5
Schicht ueber Halbraum Referenz Modell
Layer over halfspace - reference model
number of layers: 2
earth radius (km): 0.000 reference frequency (Hz): .000
......
Schicht ueber Halbraum Referenz Modell
Layer over halfspace - slightly different from reference model
number of layers: 2
earth radius (km): 0.000 reference frequency (Hz): .000
......@@ -6,8 +6,8 @@ Schicht ueber Halbraum Referenz Modell
Zb alpha beta rho Qalpha Qbeta Rb
-----------------------------------------------------------------------------
.000 .33180 .00000 .001300 1000.000 -1.000
0.0050000 0.3500 0.18000 1.500000 5.000 5.000
halfspace: 1.0000 0.55000 2.200000 20.000 20.000
0.0052000 0.4400 0.22000 1.500000 5.000 5.000
halfspace: 1.6000 0.57000 2.200000 20.000 20.000
par units description
----------------------------------------------------------------------------
......
......@@ -34,7 +34,8 @@ all:
TESTCASEMAKE=$(filter-out %.bak,$(wildcard Makefile*))
READMEFILES=$(filter-out %.bak,$(wildcard README*))
flist: $(TESTCASEMAKE) $(READMEFILES) $(wildcard *.par) $(wildcard *.tpl)
flist: $(TESTCASEMAKE) $(READMEFILES) $(wildcard *.par) $(wildcard *.tpl) \
$(wildcard *.gpt)
echo $(TESTCASEMAKE) | tr ' ' '\n' | sort > $@
echo '----' >> $@
echo $(filter-out $(TESTCASEMAKE) $(READMEFILES),$^) \
......
# this is <Makefile.soutifu>
# ----------------------------------------------------------------------------
#
# Copyright (c) 2011 by Thomas Forbriger (BFO Schiltach)
# Copyright (c) 2011, 2016 by Thomas Forbriger (BFO Schiltach)
#
# testcases for soutifu
# Testcases for soutifu
#
# See also README.soutifu
#
# ----
# This program is free software; you can redistribute it and/or modify
......@@ -21,14 +23,19 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# ----
#
# Rules defined in this file require a complete installation of Seitosh along
# with Linux tools like ps2pdf, gnuplot, gs, gv, evince, sed, and a2ps
#
# REVISIONS and CHANGES
# 24/06/2011 V1.0 Thomas Forbriger
# 30/09/2011 V1.1 test convolution of additional traces
# 19/03/2016 V1.2 - provide detailed documentation
# - add noise to synthetic test data
# - provide control plots
#
# ============================================================================
#
SOUTIFUCASES=1 1_add 2a 2b 3a 3b 3c
SOUTIFUCASES=1 1_add 2a 2b 2c 3a 3b 3c
SOUTIFURESULTS=$(addprefix soutifu,$(addsuffix _report,$(SOUTIFUCASES)))
.PHONY: all
......@@ -42,42 +49,63 @@ clean:
#
# ======================================================================
# produce synthetic shot gathers, using refmet
# ============================================
#
# 1. Produce synthetic shot gathers by using refmet
# =================================================
# This section provides synthetic seismograms. Model files defined in variable
# MODELS are supported. Waveforms are simulated by the reflectivity method as
# implemented in refmet.
#
# 1a. Prepare control files
# -------------------------
# refmet control files are created from templates such that some parameters
# can be controlled from the command line through make variables.
#
# Basic model files are:
MODELS=2lay.par 2layb.par
# source configuration
# --------------------
# duration of source wavelet
SRCDUR=0.01
# depth of source
SRCDEPTH=0.0005
# control file for single vertical force
zforce.xxx: zforce.tpl
sed -e 's/<SDUR>/$(SRCDUR)/' \
-e 's/<SDEPTH>/$(SRCDEPTH)/' $< > $@
# main file
# ---------
# Create main control file
# ------------------------
# Three main control files are provided
REFMETSRC=zforce.xxx
REFMETMOD=2lay.par
REFMETRCV=linrcv.par
.PRECIOUS: $(REFMETSRC)
#
# a) Allows all templates to be replaced
# This is not used for the testcases below
refmetmain.xxx: refmetmain.tpl $(REFMETMOD) $(REFMETSRC) $(REFMETRCV)
sed -e 's/<MODEL>/$(REFMETMOD)/' \
-e 's/<SOURCE>/$(REFMETSRC)/' \
-e 's/<RECEIVERS>/$(REFMETRCV)/' $< > $@
#
# b) Control file with standard vertical force an reference model
2laymain.xxx: refmetmain.tpl 2lay.par $(REFMETSRC) $(REFMETRCV)
sed -e 's/<MODEL>/2lay.par/' \
-e 's/<SOURCE>/$(REFMETSRC)/' \
-e 's/<RECEIVERS>/$(REFMETRCV)/' $< > $@
#
# c) Control file with standard vertical force an modified reference model
2laybmain.xxx: refmetmain.tpl 2layb.par $(REFMETSRC) $(REFMETRCV)
sed -e 's/<MODEL>/2layb.par/' \
-e 's/<SOURCE>/$(REFMETSRC)/' \
-e 's/<RECEIVERS>/$(REFMETRCV)/' $< > $@
# Simulate seismograms
# --------------------
# Based on the control files defined above, waveform data is computed by
# refmet. The files 2lay.TZ and 2layb.TZ are used as a basis for testcases
# defined below.
.PRECIOUS: seismo.TZ seismo.TR
seismo.TZ seismo.TR: refmetmain.xxx
refmet -v -4 -o seismo -c $<
......@@ -88,10 +116,66 @@ seismo.TZ seismo.TR: refmetmain.xxx
2layb.TZ 2layb.TR: 2laybmain.xxx
refmet -v -4 -o 2layb -c $<
#----------------------------------------------------------------------
# Plot waveform data
# ------------------
# Create a graphical display of waveform data used for testcases.
basewaveform.ps: 2lay.TZ 2layb.TZ
refract -d $@/cps -C -Tt "Basic synthetic time series" \
-Sm 2 -Se 2.3 -Sc 5. -Sa 3.5 -Eg -St 0.,1. $^
# ======================================================================
# 2. Fourier Bessel control operation
# ===================================
# This section provide Fourier-Bessel expansion coefficients for the suburface
# models and the vertical single force defined above. This is provided as an
# alternative display of wave propagation properties as resulting from the
# subsurface structure defined by refmet models.
#
# Use the following commands to create Postscript files:
#
# Fourier-Bessel expansion coefficients for models 2lay and 2layb:
#
# make -f Makefile.soutifu 2laysyggrn.ps 2laybsyggrn.ps
#
# Difference in Fourier-Bessel expansion coeffcients for both models:
#
# make -f Makefile.soutifu diffgrn.ps
# syg
# ---
# Calculate Fourier-Bessel expansion coefficients
$(patsubst %.par,%syg.grn,$(MODELS)): %syg.grn: %.par zforce.xxx
syg $^ $@ -P 100,100,100.,10.
# Calculate difference between coefficients for both basic models
diff.grn: 2laysyg.grn 2laybsyg.grn; rm -fv $@; gredi $^ $@
# grepg
# -----
# Create Postscript plot of Fourier-Bessel coefficients
%grn.ps: %.grn
grepg $< -W -d $@/ps -p 0.8 -s -f 10 -i -g
# produce seismogram file by windowing such that backpropagating
# cut-off phase is removed
# ======================================================================
# 3. Preprocess waveform data
# ===========================
#
# This section provides preprocessed waveform data as a basis for tests to be
# applied to soutifu.
#
# 3a. Remove numerical cut-off phase
# ----------------------------------
# The reflectivity code produces a backpropagating cut-off as a numerical
# artefact. This is removed by selecting a given number of samples at the
# beginning of the seismograms. As a result the following waveform data files
# are provided:
#
# synthetic2lay.sff
# synthetic2layb.sff
# syntheticseismo.sff
#
# The number of samples to be used is defined by make variable WINLIM
#
WINLIM=2000
win.fil.xxx: ; printf "win 1,$(WINLIM)\nend\n" > $@
newsynthetic%.sff: %.TZ win.fil.xxx
......@@ -102,52 +186,89 @@ synthetic2lay.sff synthetic2layb.sff syntheticseismo.sff:
$(MAKE) new$@ -f Makefile.soutifu
/bin/cp -vpd new$@ $@
# add noise
# 3b. Add noise
# -------------
# As a first step to simulate recorded data, white Gaussian noise can be added
# to the synthetic waveforms.
#
# The rms-amplitude of noise is specified by variable NOISEAMP
# a reasonable value to start with is NOISEAMP=1.e-5
NOISEAMP=0.
noisy%.sff: synthetic%.sff
printf "noi $(NOISEAMP)\nend\n" | tidofi -v -o -cs $@ $<
# apply a filter, simulating a source time function
# 3c. Apply a filter, simulating a source time function
# -----------------------------------------------------
# As a second step to simulate recorded data, a filter is applied to the
# waveform data, which simulates a source time function or the response of a
# recording system or both. The filter control file is later used as a
# reference to study the capability to reproduce the filter characteristic by
# soutifu. The filter characteristic can be controlled by make variables.
#
# Low-pass period
STFPER=0.04
STFFAC=0.1
stf.fil.xxx: ; printf "lpb $(STFPER),4\ndel 0.03\nfac $(STFFAC)\nend\n" > $@
# Scaling factor
STFFAC=2.5
# Trigger advance
STFDELAY=0.03
stf.fil.xxx: ; printf "lpb $(STFPER),4\ndel $(STFDELAY)\nfac $(STFFAC)\nend\n" > $@
data%.sff: noisy%.sff stf.fil.xxx
tidofi -v -o -cf $(word 2,$^) $@ $<
# Display waveforms
# -----------------
# Display waveform data as provided for tests. This way different settings for
# the source time function simulation and data noise can be tested.
#
# syntheticplot.ps
# noisyplot.ps
# dataplot.ps
%plot.ps: %2lay.sff %2layb.sff
refract -d $@/cps -C -Tt "Synthetic time series" \
-Sm 2 -Se 2.3 -Sc 5. -Sa 3.5 -Eg -St 0.,1. $^
# Display waveform amplitudes
# ---------------------------
# Outputs rms and peak-to-peak amplitudes. This is used to provide a reference
# to adjust the noise amplitude parameter.
%.amp.xxx: %.sff
sigval -format "%F (trace #%NT at %OFF): rms= %RMS P-P= %PPA" \
$< > $@
%.ampdat.xxx: %.sff
sigval -format "%NT %RMS %PPA" $< > $@
%.amp: %.amp.xxx; cat $<
soutifuamp.ps: soutifuamp.gpt \
synthetic2lay.ampdat.xxx synthetic2layb.ampdat.xxx \
data2lay.ampdat.xxx data2layb.ampdat.xxx
gnuplot $<
# ======================================================================
# additional series to be convolved
# =================================
# 4. Additional series to be convolved
# ====================================
# Create additional test time series which will be used to test soutifus
# ability to reproduce the actual source time function.
additional.sff: win.fil.xxx
/bin/rm -fv $@
tesiff -r 1000. -n $(WINLIM) $@
# Apply the source time function filter as defined above to the additional
# test waveform data. The filter result will be compared fo time series
# filtered by soutifu.
additionalfiltered.sff: additional.sff stf.fil.xxx
tidofi -v -o -cf $(word 2,$^) $@ $<
# ======================================================================
# operate on SeismicUn*x data
# ===========================
# 5. Operate on SeismicUn*x data
# ==============================
# In order to provide test data and test results in Seismic Un*x, such that
# they can be further processed by SU tools, we provide conversion rules.
%.su: %.sff; any2any --verbose --itype sff --otype su --overwrite $@ $<
%_conv.sff: %.su; any2any --verbose --otype sff --itype su --overwrite $@ $<
# ======================================================================
# Fourier Bessel control operation
# ================================
# syg
# ---
$(patsubst %.par,%syg.grn,$(MODELS)): %syg.grn: %.par zforce.xxx
syg $^ $@ -P 100,100,100.,10.
# grepg
# -----
%grn.ps: %.grn
grepg $< -W -d $@/ps -p 0.8 -s -f 10 -i
# ============================================================================
# test cases
# ----------
# 6. Test cases
# =============
# test case 1
# -----------
......@@ -334,8 +455,8 @@ soutifu3c_report.pdf:
/bin/mv -fv soutifu3x_report.pdf $@
#======================================================================
# compile reports
# ===============
# 7. Compile reports
# ==================
#
%_description.ps: %_description.xxx
a2ps -o $@ -r --center-title=$(patsubst %_description.xxx,%,$<) \
......@@ -347,10 +468,12 @@ soutifu3c_report.pdf:
gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -sOutputFile=$@ $^
# ======================================================================
# previewer
# =========
# 8. Previewer
# ============
#
PDFPREVIEWER=evince
%.pdf: %.ps; ps2pdf $<
%.psp: %.ps; gv $<; /bin/rm -fv $<
%.pdp: %.pdf; acroread $<; /bin/rm -fv $<
%.pdp: %.pdf; $(PDFPREVIEWER) $<; /bin/rm -fv $<
# ----- END OF Makefile.soutifu -----
#!/usr/bin/gnuplot -persist
#
# This is a gnuplot script used by Makefile.soutifu
#
set terminal postscript color enhanced
set output "soutifuamp.ps"
set style line 1 lt 1 lw 2
set style line 2 lt 2 lw 2
set style line 3 lt 3 lw 2
set style line 4 lt 4 lw 2
set grid
set xlabel "trace"
set ylabel "amplitude"
set logscale y
plot "data2lay.ampdat.xxx" u 1:2 t "data2lay rms" w l ls 1, \
"data2layb.ampdat.xxx" u 1:2 t "data2layb rms" w l ls 2, \
"synthetic2lay.ampdat.xxx" u 1:2 t "synthetic2lay rms" w l ls 3, \
"synthetic2layb.ampdat.xxx" u 1:2 t "synthetic2layb rms" w l ls 4
plot "data2lay.ampdat.xxx" u 1:3 t "data2lay peak-to-peak" w l ls 1, \
"data2layb.ampdat.xxx" u 1:3 t "data2layb peak-to-peak" w l ls 2, \
"synthetic2lay.ampdat.xxx" u 1:3 t "synthetic2lay peak-to-peak" w l ls 3, \
"synthetic2layb.ampdat.xxx" u 1:3 t "synthetic2layb peak-to-peak" w l ls 4
# EOF
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