Commit 2e8e7613 authored by thomas.forbriger's avatar thomas.forbriger

croposp [FEATURE]: support exact reproduction of publication example

By setting the seed value for the random number generator explicitly we
can reproduce the random number time series. This lets us exactly
reproduce the value used for the publication on TCCA approximation
errors.
parent e0b323b1
......@@ -22,10 +22,16 @@
#
# run with pairwise noise signal:
#
# make all PAIRWISE=yes
# make all PAIRWISE=yes
#
# run with seed values of publication example
#
# make cleanseed; make all FIXEDSEED=yes
#
# REVISIONS and CHANGES
# 06/02/2019 V1.0 Thomas Forbriger
# 18/09/2019 V1.1 provide fixed seed value on request to reproduce
# publication example exactly
#
# ============================================================================
#
......@@ -57,11 +63,15 @@ npsd_compilation.pdf: $(addprefix SNPSD_,$(addsuffix .pdf,$(CPSD_SET)))
alldata: cpsd1.bin cpsd2.bin cpsd3.bin cpsd4.bin
.PHONY: clean
clean: ;
clean: cleanseed ;
-find . -name \*.bak | xargs --no-run-if-empty /bin/rm -v
-/bin/rm -vf flist *.bin *.o *.xxx *.ps *.pdf *~
-/bin/rm -vf *.asc
.PHONY: cleanseed
cleanseed: ;
-/bin/rm -vf *.seed
# ======================================================================
# create time series
# ==================
......@@ -132,31 +142,28 @@ RNGTYPE=ranlux
# Choose:
RNGTYPE=ranlxd2
cpsd1raw.bin:
/bin/bash -c 'export GSL_RNG_SEED=$$(date +"%N"); \
export GSL_RNG_TYPE=$(RNGTYPE); \
siggenx 14 $@ $(CPSD_SIGGENOPT); \
echo seed: $$GSL_RNG_SEED > $(patsubst %.bin,%seed.xxx,$@)'
cpsd2raw.bin:
/bin/bash -c 'export GSL_RNG_SEED=$$(date +"%N"); \
export GSL_RNG_TYPE=$(RNGTYPE); \
siggenx 14 $@ $(CPSD_SIGGENOPT); \
echo seed: $$GSL_RNG_SEED > $(patsubst %.bin,%seed.xxx,$@)'
cpsd3raw.bin:
/bin/bash -c 'export GSL_RNG_SEED=$$(date +"%N"); \
export GSL_RNG_TYPE=$(RNGTYPE); \
siggenx 14 $@ $(CPSD_SIGGENOPT); \
echo seed: $$GSL_RNG_SEED > $(patsubst %.bin,%seed.xxx,$@)'
cpsd4raw.bin:
/bin/bash -c 'export GSL_RNG_SEED=$$(date +"%N"); \
# allow to reproduce publication example exactly
ifdef FIXEDSEED
cpsd1raw.seed: ;printf "%s\n" 686293391 > $@
cpsd2raw.seed: ;printf "%s\n" 448546898 > $@
cpsd3raw.seed: ;printf "%s\n" 021371780 > $@
cpsd4raw.seed: ;printf "%s\n" 559720675 > $@
cpsdbgraw.seed: ;printf "%s\n" 137374844 > $@
else
cpsd1raw.seed: ;printf "%s\n" $$(date +"%N") > $@
cpsd2raw.seed: ;printf "%s\n" $$(date +"%N") > $@
cpsd3raw.seed: ;printf "%s\n" $$(date +"%N") > $@
cpsd4raw.seed: ;printf "%s\n" $$(date +"%N") > $@
cpsdbgraw.seed: ;printf "%s\n" $$(date +"%N") > $@
endif
cpsd1raw.bin cpsd2raw.bin cpsd3raw.bin cpsd4raw.bin cpsdbgraw.bin: \
%.bin: %.seed
/bin/bash -c 'export GSL_RNG_SEED=$$(cat $<); \
export GSL_RNG_TYPE=$(RNGTYPE); \
siggenx 14 $@ $(CPSD_SIGGENOPT); \
echo seed: $$GSL_RNG_SEED > $(patsubst %.bin,%seed.xxx,$@)'
# create time series for common noise signal
cpsdbgraw.bin:
/bin/bash -c 'export GSL_RNG_SEED=$$(date +"%N"); \
siggenx 14 $@ $(CPSD_SIGGENOPT); \
echo seed: $$GSL_RNG_SEED > $(patsubst %.bin,%seed.xxx,$@)'
# time series for common noise signal: cpsdbgraw.bin
# provide a time series plot to confirm incoherence
rawsig.ps: cpsd1raw.bin cpsd2raw.bin cpsd3raw.bin cpsd4raw.bin cpsdbgraw.bin
......
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