summaryrefslogtreecommitdiffstats
path: root/dpd/src/MER.py
diff options
context:
space:
mode:
authorandreas128 <Andreas>2017-09-26 17:47:51 +0200
committerandreas128 <Andreas>2017-09-26 17:47:51 +0200
commit80ae5c80144451706ba00b24046b31d89a7c0165 (patch)
treeab83a80569c1a0c2450349dba2e986dcc4babc26 /dpd/src/MER.py
parentdd757ee779fde3a2d2a9694675de117bde4d62b4 (diff)
downloaddabmod-80ae5c80144451706ba00b24046b31d89a7c0165.tar.gz
dabmod-80ae5c80144451706ba00b24046b31d89a7c0165.tar.bz2
dabmod-80ae5c80144451706ba00b24046b31d89a7c0165.zip
Move plot config in const.py
Diffstat (limited to 'dpd/src/MER.py')
-rw-r--r--dpd/src/MER.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/dpd/src/MER.py b/dpd/src/MER.py
index 7aea38f..393e55c 100644
--- a/dpd/src/MER.py
+++ b/dpd/src/MER.py
@@ -23,6 +23,8 @@ class MER:
def __init__(self, c):
self.c = c
+ self.plot = c.MER_plot
+
def _calc_spectrum(self, tx):
fft = np.fft.fftshift(np.fft.fft(tx))
return np.delete(fft[self.c.FFT_start:self.c.FFT_end],
@@ -69,13 +71,13 @@ class MER:
return x_mean, y_mean, U_RMS, U_ERR, MER
- def calc_mer(self, tx, debug=False, debug_name=""):
+ def calc_mer(self, tx, debug_name=""):
assert tx.shape[0] == self.c.T_U,\
"Wrong input length"
spectrum = self._calc_spectrum(tx)
- if debug:
+ if self.plot:
dt = datetime.datetime.now().isoformat()
fig_path = logging_path + "/" + dt + "_MER" + debug_name + ".svg"
@@ -91,7 +93,7 @@ class MER:
x_err = U_ERR * np.sin(tau) + x_mean
y_err = U_ERR * np.cos(tau) + y_mean
- if debug:
+ if self.plot:
ax = plt.subplot(221 + i)
ax.scatter(x, y, s=0.2, color='black')
ax.plot(x_mean, y_mean, 'p', color='red')
@@ -102,7 +104,7 @@ class MER:
ylim = ax.get_ylim()
ax.set_ylim(ylim[0] - (ylim[1] - ylim[0]) * 0.1, ylim[1])
- if debug:
+ if self.plot:
plt.tight_layout()
plt.savefig(fig_path)
plt.show()