diff options
author | andreas128 <Andreas> | 2017-08-24 19:26:47 +0200 |
---|---|---|
committer | andreas128 <Andreas> | 2017-08-24 19:26:47 +0200 |
commit | 3ca742663b6bf20a89c28a70668f50ceee6a23d0 (patch) | |
tree | d0c8fc956ca88a9ae49c8cf01c8e5fcb7e81ae95 /dpd/src/subsample_align.py | |
parent | 28462b9d8bb08609810ea9a9882c5fa9205b8b80 (diff) | |
parent | cedc4708cf73151c6b887198b14851c6adf8fc86 (diff) | |
download | dabmod-3ca742663b6bf20a89c28a70668f50ceee6a23d0.tar.gz dabmod-3ca742663b6bf20a89c28a70668f50ceee6a23d0.tar.bz2 dabmod-3ca742663b6bf20a89c28a70668f50ceee6a23d0.zip |
Remove polynom term without coefficient
Diffstat (limited to 'dpd/src/subsample_align.py')
-rwxr-xr-x | dpd/src/subsample_align.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/dpd/src/subsample_align.py b/dpd/src/subsample_align.py index 0dc78c1..0a51593 100755 --- a/dpd/src/subsample_align.py +++ b/dpd/src/subsample_align.py @@ -1,8 +1,11 @@ +import datetime +import os +import logging +logging_path = os.path.dirname(logging.getLoggerClass().root.handlers[0].baseFilename) + import numpy as np from scipy import signal, optimize -import sys import matplotlib.pyplot as plt -import datetime def gen_omega(length): if (length % 2) == 1: @@ -59,15 +62,13 @@ def subsample_align(sig, ref_sig): if optim_result.success: best_tau = optim_result.x - #print("Found subsample delay = {}".format(best_tau)) - if 1: corr = np.vectorize(correlate_for_delay) ixs = np.linspace(-1, 1, 100) taus = corr(ixs) dt = datetime.datetime.now().isoformat() - tau_path = ("/tmp/" + dt + "_tau.pdf") + tau_path = (logging_path + "/" + dt + "_tau.pdf") plt.plot(ixs, taus) plt.title("Subsample correlation, minimum is best: {}".format(best_tau)) plt.savefig(tau_path) |