summaryrefslogtreecommitdiffstats
path: root/dpd/src/Model_PM.py
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2017-12-29 08:32:58 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2017-12-29 08:32:58 +0100
commitbc25ed90fb34398f9fd3066b7237d1306628b16f (patch)
treede9c96d45728e96b6157e1554503e5d90f229495 /dpd/src/Model_PM.py
parent740d4815fda8737cc7f021999d30aeacd851b032 (diff)
downloaddabmod-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/Model_PM.py')
-rw-r--r--dpd/src/Model_PM.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/dpd/src/Model_PM.py b/dpd/src/Model_PM.py
index e721d1a..3aafea0 100644
--- a/dpd/src/Model_PM.py
+++ b/dpd/src/Model_PM.py
@@ -8,11 +8,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
@@ -43,12 +38,12 @@ class Model_PM:
self.plot = plot
def _plot(self, tx_dpd, phase_diff, coefs_pm, coefs_pm_new):
- if logging.getLogger().getEffectiveLevel() == logging.DEBUG and self.plot and logging_path is not None:
+ if self.plot and self.c.plot_location is not None:
tx_range, phase_diff_est = self.calc_line(coefs_pm, 0, 0.6)
tx_range_new, phase_diff_est_new = self.calc_line(coefs_pm_new, 0, 0.6)
dt = datetime.datetime.now().isoformat()
- fig_path = logging_path + "/" + dt + "_Model_PM.svg"
+ fig_path = self.c.plot_location + "/" + dt + "_Model_PM.png"
sub_rows = 1
sub_cols = 1
fig = plt.figure(figsize=(sub_cols * 6, sub_rows / 2. * 6))