Commit 56040e0d authored by thomas.forbriger's avatar thomas.forbriger
Browse files

croposp [FEATURE]: provide compilation of test cases

parent 61ddd719
......@@ -26,6 +26,24 @@
# ============================================================================
#
all: compilation.pdf
# select sets to be analyzed
# four are available, three must be used at least
CPSD_SET=1 2 3 4
CPSD_SET=1 2 3
ALLPDF=PSD.pdf PSDraw.pdf \
$(addprefix coherency_,$(addsuffix .pdf,$(CPSD_SET))) \
$(addprefix transfer_,$(addsuffix .pdf,A B)) \
$(addprefix phase_,$(addsuffix .pdf,A B)) \
$(addprefix NPSD_,$(addsuffix .pdf,1 2 3 4))
compilation.pdf: $(ALLPDF)
pdfjam $^ \
--nup 2x2 --landscape --paper a4paper --scale 0.85 -o $@
alldata: cpsd1.bin cpsd2.bin cpsd3.bin cpsd4.bin
.PHONY: clean
......@@ -110,21 +128,21 @@ cpsd3mod.bin: cpsd3raw.bin
cpsd4mod.bin: cpsd4raw.bin
printf "fac $(CPSD_AMP4)\nend\n" \
| tidofi -type bin -Type bin -v -o -cs $@ $<
cpsdbgmod1.bin: cpsdbgraw.bin
cpsdbg1mod.bin: cpsdbgraw.bin
printf "fac $(CPSD_AMPBG)\nlp1 2.\navg 0\nhpb 100.,4\nend\n" \
| tidofi -type bin -Type bin -v -o -cs $@ $<
cpsdbgmod2.bin: cpsdbgmod1.bin
cpsdbg2mod.bin: cpsdbg1mod.bin
printf "dif 0.\nend\n" \
| tidofi -type bin -Type bin -v -o -cs $@ $<
# add common noise signal to channel specific noise floor
cpsd1add.bin: cpsd1mod.bin cpsdbgmod1.bin
cpsd1add.bin: cpsd1mod.bin cpsdbg1mod.bin
teseco -v -o -a -type bin -Type bin $@ $^
cpsd2add.bin: cpsd2mod.bin cpsdbgmod1.bin
cpsd2add.bin: cpsd2mod.bin cpsdbg1mod.bin
teseco -v -o -a -type bin -Type bin $@ $^
cpsd3add.bin: cpsd3mod.bin cpsdbgmod1.bin
cpsd3add.bin: cpsd3mod.bin cpsdbg1mod.bin
teseco -v -o -a -type bin -Type bin $@ $^
cpsd4add.bin: cpsd4mod.bin cpsdbgmod2.bin
cpsd4add.bin: cpsd4mod.bin cpsdbg2mod.bin
teseco -v -o -a -type bin -Type bin $@ $^
# ----------------------------------------------------------------------
......@@ -178,8 +196,9 @@ CPSD_NSEGMENTS=50
CPSD_OVERLAP=0.5
CPSD_DIVISOR=100
CPSD_PADFACTOR=1
CPSD_AVGOUT=--avgout
CPSD_NLOG=20
CPSD_LOG=--log $(CPSD_NLOG) --avgout
CPSD_LOG=--log $(CPSD_NLOG) $(CPSD_AVGOUT)
CPSD_OPT=--DEBUG
CPSD_OPT=
OUTPUTS=psd npsd coherency transfer phase
......@@ -189,24 +208,22 @@ OUTPUTS=psd npsd coherency transfer phase
CPSD_CROPOSP_OPT=--nsegments=$(CPSD_NSEGMENTS) \
--divisor=$(CPSD_DIVISOR) \
--padfactor=$(CPSD_PADFACTOR) \
--overlap=$(CPSD_OVERLAP) $(CPSD_LOG)
--overlap=$(CPSD_OVERLAP) \
$(CPSD_LOG)
# select sets to be analyzed
# four are available, three must be used at least
CPSD_SET=1 2 3
CPSD_SET=1 2 3 4
# set standard (non-processing options)
CPSD_CROPOSP_STDOPT=--verbose --overwrite --itype bin --trim \
--pattern="%I" --datetolerance 0.1
# compile list of file names as input to croposp
CPSD_BINFILES=$(addprefix cpsd,$(addsuffix .bin,$(CPSD_SET)))
# compile list of raw files (apparent instrumental noise and seismic
# background noise separately)
CPSD_RAWFILES=$(addprefix cpsd,$(addsuffix mod.bin,$(CPSD_SET) bg)) \
CPSD_RAWFILES=$(addprefix cpsd,$(addsuffix mod.bin,$(CPSD_SET) bg1 bg2)) \
# run complete analysis on the apparent seismometer output
$(addsuffix _out.xxx,$(OUTPUTS)): $(CPSD_BINFILES)
croposp $(CPSD_OPT) --verbose --overwrite --itype bin --trim \
--pattern="%I" \
croposp $(CPSD_OPT) $(CPSD_CROPOSP_STDOPT) \
$(CPSD_CROPOSP_OPT) \
--datetolerance 0.1 \
--psd psd_out.xxx \
--npsd npsd_out.xxx \
--coherency coherency_out.xxx \
......@@ -214,6 +231,13 @@ $(addsuffix _out.xxx,$(OUTPUTS)): $(CPSD_BINFILES)
--phase phase_out.xxx \
$^
# run npsd analysis for selected mode
$(addprefix npsd_,$(addsuffix _out.xxx,0 1 2 3)): \
npsd_%_out.xxx: $(CPSD_BINFILES)
croposp $(CPSD_OPT) $(CPSD_CROPOSP_STDOPT) \
$(CPSD_CROPOSP_OPT) --npsdmode=$(patsubst npsd_%_out.xxx,%,$@) \
--npsd $@ $^
# compute PSD for raw files (apparent instrumental noise and seismic
# background noise separately)
psdraw.xxx: $(CPSD_RAWFILES)
......@@ -256,13 +280,14 @@ CROPOSPLOT_OPT=--usemarkers --match='$(CROPOSPLOT_MATCH)'
CPSD_REFFILES=$(addprefix psd,$(addsuffix foutra.xxx,$(CPSD_SET)))
# compile list of raw files (apparent instrumental noise and seismic
# background noise separately) analyzed with foutra
CPSD_RAWREFFILES=$(addprefix psd,$(addsuffix modfoutra.xxx,$(CPSD_SET) bg))
CPSD_RAWREFFILES=$(addprefix psd,$(addsuffix modfoutra.xxx,$(CPSD_SET) bg1 bg2))
PSD_RANGE=1.e-14:100.
# display PSD of raw data (apparent instrumental noise and seismic
# background noise separately)
PSDraw.pdf: psdraw.xxx $(CPSD_RAWREFFILES)
$(CROPOSPLOT) --title="$@ \n $(CPSD_CROPOSP_OPT)" \
--ylim=1.e-14:100. \
--ylim=$(PSD_RANGE) \
$(CROPOSPLOT_OPT) \
--titfontsize='small' -v --grid -o $@ $^
......@@ -273,6 +298,47 @@ PSD.pdf: psd_out.xxx $(CPSD_REFFILES)
$(CROPOSPLOT_OPT) \
--titfontsize='small' -v --grid -o $@ $^
# display signal specific coherency
coherency_%.pdf: coherency_out.xxx
$(CROPOSPLOT) --title="$@ \n $(CPSD_CROPOSP_OPT)" \
$(CROPOSPLOT_OPT) --nology --ylabel="coherency" \
--match='SYN$(patsubst coherency_%.pdf,%,$@)' \
--titfontsize='small' -v --grid -o $@ $^
# display signal specific transfer factor
transfer_A.pdf: transfer_out.xxx
$(CROPOSPLOT) --title="$@ \n $(CPSD_CROPOSP_OPT)" \
$(CROPOSPLOT_OPT) --ylabel="ratio" \
--match='SYN(1|2|3)/SYN(1|2|3)' \
--titfontsize='small' -v --grid -o $@ $^
transfer_B.pdf: transfer_out.xxx
$(CROPOSPLOT) --title="$@ \n $(CPSD_CROPOSP_OPT)" \
$(CROPOSPLOT_OPT) --ylabel="ratio" \
--match='SYN4/|/SYN4' \
--titfontsize='small' -v --grid -o $@ $^
# display signal specific phase difference
phase_A.pdf: phase_out.xxx
$(CROPOSPLOT) --title="$@ \n $(CPSD_CROPOSP_OPT)" \
$(CROPOSPLOT_OPT) --nology --ylabel="difference / rad" \
--match='SYN(1|2|3)-SYN(1|2|3)' \
--titfontsize='small' -v --grid -o $@ $^
phase_B.pdf: phase_out.xxx
$(CROPOSPLOT) --title="$@ \n $(CPSD_CROPOSP_OPT)" \
$(CROPOSPLOT_OPT) --nology --ylabel="difference / rad" \
--match='SYN4-|-SYN4' \
--titfontsize='small' -v --grid -o $@ $^
# display signal specific npsd
NPSD_%.pdf: psdraw.xxx psd_out.xxx \
npsd_0_out.xxx npsd_1_out.xxx npsd_2_out.xxx npsd_3_out.xxx
/bin/bash -c 'SIG=$(patsubst NPSD_%.pdf,%,$@); \
echo signal: $$SIG; \
$(CROPOSPLOT) --title="$@ \n $(CPSD_CROPOSP_OPT)" \
$(CROPOSPLOT_OPT) --ylabel="PSD" --ylim=$(PSD_RANGE) \
--match="(cpsd$$SIG)|(^PSD SYN$$SIG)|(NPSD SYN$$SIG)" \
--titfontsize="small" -v --grid -o $@ $^'
# ----------------------------------------------------------------------
# pattern rules for quick plots
# -----------------------------
......
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