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/ExtractStatistic.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/ExtractStatistic.py')
-rw-r--r-- | dpd/src/ExtractStatistic.py | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/dpd/src/ExtractStatistic.py b/dpd/src/ExtractStatistic.py index e917909..639513a 100644 --- a/dpd/src/ExtractStatistic.py +++ b/dpd/src/ExtractStatistic.py @@ -8,14 +8,9 @@ import numpy as np import matplotlib.pyplot as plt - import datetime import os import logging -try: - logging_path = os.path.dirname(logging.getLoggerClass().root.handlers[0].baseFilename) -except AttributeError: - logging_path = None def _check_input_extract(tx_dpd, rx_received): @@ -66,10 +61,9 @@ class ExtractStatistic: self.plot = c.ES_plot def _plot_and_log(self, tx_values, rx_values, phase_diffs_values, phase_diffs_values_lists): - 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: dt = datetime.datetime.now().isoformat() - fig_path = logging_path + "/" + dt + "_ExtractStatistic.png" + fig_path = self.c.plot_location + "/" + dt + "_ExtractStatistic.png" sub_rows = 3 sub_cols = 1 fig = plt.figure(figsize=(sub_cols * 6, sub_rows / 2. * 6)) |