diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2017-12-29 08:32:58 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2017-12-29 08:32:58 +0100 |
commit | bc25ed90fb34398f9fd3066b7237d1306628b16f (patch) | |
tree | de9c96d45728e96b6157e1554503e5d90f229495 /dpd/src/phase_align.py | |
parent | 740d4815fda8737cc7f021999d30aeacd851b032 (diff) | |
download | dabmod-bc25ed90fb34398f9fd3066b7237d1306628b16f.tar.gz dabmod-bc25ed90fb34398f9fd3066b7237d1306628b16f.tar.bz2 dabmod-bc25ed90fb34398f9fd3066b7237d1306628b16f.zip |
Transform Const into a global config structure, avoid depending on logging for plot location
Diffstat (limited to 'dpd/src/phase_align.py')
-rw-r--r-- | dpd/src/phase_align.py | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/dpd/src/phase_align.py b/dpd/src/phase_align.py index 21a210c..8654333 100644 --- a/dpd/src/phase_align.py +++ b/dpd/src/phase_align.py @@ -7,11 +7,6 @@ import datetime import os import logging -try: - logging_path = os.path.dirname(logging.getLoggerClass().root.handlers[0].baseFilename) -except AttributeError: - logging_path = None - import numpy as np import matplotlib.pyplot as plt @@ -27,9 +22,9 @@ def phase_align(sig, ref_sig, plot=False): real_diffs = np.cos(angle_diff) imag_diffs = np.sin(angle_diff) - if logging.getLogger().getEffectiveLevel() == logging.DEBUG and plot and logging_path is not None: + if plot and self.c.plot_location is not None: dt = datetime.datetime.now().isoformat() - fig_path = logging_path + "/" + dt + "_phase_align.svg" + fig_path = self.c.plot_location + "/" + dt + "_phase_align.png" plt.subplot(511) plt.hist(angle_diff, bins=60, label="Angle Diff") |