From d7521876d7cb221860b0975b2a25eedca00206b7 Mon Sep 17 00:00:00 2001 From: andreas128 Date: Mon, 21 Aug 2017 20:23:17 +0200 Subject: Add logging directory creation for all log files --- dpd/src/phase_align.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'dpd/src/phase_align.py') diff --git a/dpd/src/phase_align.py b/dpd/src/phase_align.py index bea0b82..f03184b 100644 --- a/dpd/src/phase_align.py +++ b/dpd/src/phase_align.py @@ -1,9 +1,12 @@ +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 -import logging def phase_align(sig, ref_sig): @@ -19,7 +22,7 @@ def phase_align(sig, ref_sig): if logging.getLogger().getEffectiveLevel() == logging.DEBUG: dt = datetime.datetime.now().isoformat() - fig_path = "/tmp/" + dt + "_phase_align.pdf" + fig_path = logging_path + "/" + dt + "_phase_align.pdf" plt.subplot(511) plt.hist(angle_diff, bins=60, label="Angle Diff") -- cgit v1.2.3