diff options
Diffstat (limited to 'dpd/src')
-rw-r--r-- | dpd/src/MER.py | 10 | ||||
-rw-r--r-- | dpd/src/Measure_Shoulders.py | 2 | ||||
-rw-r--r-- | dpd/src/Model_Poly.py | 5 | ||||
-rw-r--r-- | dpd/src/const.py | 8 |
4 files changed, 17 insertions, 8 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() diff --git a/dpd/src/Measure_Shoulders.py b/dpd/src/Measure_Shoulders.py index 1417613..acb05b4 100644 --- a/dpd/src/Measure_Shoulders.py +++ b/dpd/src/Measure_Shoulders.py @@ -69,7 +69,7 @@ class Measure_Shoulder: c, plot=False): self.c = c - self.plot = plot + self.plot = c.MS_plot def _plot(self, signal): dt = datetime.datetime.now().isoformat() diff --git a/dpd/src/Model_Poly.py b/dpd/src/Model_Poly.py index f6c024c..e799f1e 100644 --- a/dpd/src/Model_Poly.py +++ b/dpd/src/Model_Poly.py @@ -44,8 +44,7 @@ class Poly: def __init__(self, c, learning_rate_am=1.0, - learning_rate_pm=1.0, - plot=False): + learning_rate_pm=1.0): self.c = c self.learning_rate_am = learning_rate_am @@ -56,7 +55,7 @@ class Poly: self.model_am = Model_AM.Model_AM(c, plot=True) self.model_pm = Model_PM.Model_PM(c, plot=True) - self.plot = plot + self.plot = c.MDL_plot def reset_coefs(self): self.coefs_am = np.zeros(5, dtype=np.float32) diff --git a/dpd/src/const.py b/dpd/src/const.py index cbef8af..d95d0bf 100644 --- a/dpd/src/const.py +++ b/dpd/src/const.py @@ -38,6 +38,7 @@ class const: self.phase_offset_per_sample = 1. / sample_rate * 2 * np.pi * 1000 # Constants for ExtractStatistic + self.ES_plot = True self.ES_start = 0.0 self.ES_end = 1.0 self.ES_n_bins = 64 @@ -53,10 +54,17 @@ class const: self.RAGC_min_rxgain = 25 self.RAGC_rx_median_target = self.TAGC_tx_median_target + # Constants for Model + self.MDL_plot = True + + # Constants for MER + self.MER_plot = True + # Constants for Model_PM self.MPM_tx_min = 0.1 # Constants for Measure_Shoulder + self.MS_plot = True assert sample_rate==8192000 meas_offset = 976 # Offset from center frequency to measure shoulder [kHz] meas_width = 100 # Size of frequency delta to measure shoulder [kHz] |