aboutsummaryrefslogtreecommitdiffstats
path: root/dpd/src/MER.py
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2017-12-29 06:43:49 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2017-12-29 06:43:58 +0100
commita62e05c9564045044df734fd3723b3f665ad91ae (patch)
tree5a9e1570362fe9a47fe581c292f3bd84f6fd3e82 /dpd/src/MER.py
parentbf53849fba5796d1b98254a7eeab575a50ae7996 (diff)
downloaddabmod-a62e05c9564045044df734fd3723b3f665ad91ae.tar.gz
dabmod-a62e05c9564045044df734fd3723b3f665ad91ae.tar.bz2
dabmod-a62e05c9564045044df734fd3723b3f665ad91ae.zip
DPD: Make logging to file optional in all modules, simplify apply_adapt_dumps
Diffstat (limited to 'dpd/src/MER.py')
-rw-r--r--dpd/src/MER.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/dpd/src/MER.py b/dpd/src/MER.py
index f186261..a4c3591 100644
--- a/dpd/src/MER.py
+++ b/dpd/src/MER.py
@@ -11,7 +11,7 @@ import logging
try:
logging_path = os.path.dirname(logging.getLoggerClass().root.handlers[0].baseFilename)
except:
- logging_path = "/tmp/"
+ logging_path = None
import numpy as np
import matplotlib
@@ -76,9 +76,11 @@ class MER:
spectrum = self._calc_spectrum(tx)
- if self.plot:
+ if self.plot and logging_path is not None:
dt = datetime.datetime.now().isoformat()
fig_path = logging_path + "/" + dt + "_MER" + debug_name + ".svg"
+ else:
+ fig_path = None
MERs = []
for i, (x, y) in enumerate(self._split_in_carrier(
@@ -103,7 +105,7 @@ class MER:
ylim = ax.get_ylim()
ax.set_ylim(ylim[0] - (ylim[1] - ylim[0]) * 0.1, ylim[1])
- if self.plot:
+ if fig_path is not None:
plt.tight_layout()
plt.savefig(fig_path)
plt.show()