diff options
author | andreas128 <Andreas> | 2017-09-13 18:34:05 +0200 |
---|---|---|
committer | andreas128 <Andreas> | 2017-09-13 18:34:05 +0200 |
commit | 426671f4af2a5d1d5d01225194eb66b2edb8c059 (patch) | |
tree | 994a98618521afcec5e6d19c443ba85eaa8af51e /dpd/src | |
parent | a6ab5661fabc51aa1bdfc48c44bdef4b1f30e095 (diff) | |
download | dabmod-426671f4af2a5d1d5d01225194eb66b2edb8c059.tar.gz dabmod-426671f4af2a5d1d5d01225194eb66b2edb8c059.tar.bz2 dabmod-426671f4af2a5d1d5d01225194eb66b2edb8c059.zip |
Fix non closed figures
Diffstat (limited to 'dpd/src')
-rw-r--r-- | dpd/src/Agc.py | 2 | ||||
-rw-r--r-- | dpd/src/Dab_Util.py | 10 | ||||
-rw-r--r-- | dpd/src/ExtractStatistic.py | 2 | ||||
-rw-r--r-- | dpd/src/MER.py | 2 | ||||
-rw-r--r-- | dpd/src/Model.py | 4 | ||||
-rw-r--r-- | dpd/src/Model_AM.py | 2 | ||||
-rw-r--r-- | dpd/src/phase_align.py | 2 | ||||
-rwxr-xr-x | dpd/src/subsample_align.py | 2 |
8 files changed, 13 insertions, 13 deletions
diff --git a/dpd/src/Agc.py b/dpd/src/Agc.py index 978b607..b83c91e 100644 --- a/dpd/src/Agc.py +++ b/dpd/src/Agc.py @@ -139,7 +139,7 @@ class Agc: fig.tight_layout() fig.savefig(fig_path) - fig.clf() + plt.close(fig) # The MIT License (MIT) diff --git a/dpd/src/Dab_Util.py b/dpd/src/Dab_Util.py index e3dbfe3..37be5db 100644 --- a/dpd/src/Dab_Util.py +++ b/dpd/src/Dab_Util.py @@ -49,7 +49,7 @@ class Dab_Util: plt.plot(c, label="corr") plt.legend() plt.savefig(corr_path) - plt.clf() + plt.close() return np.argmax(c) - off + 1 @@ -118,7 +118,7 @@ class Dab_Util: fig.tight_layout() fig.savefig(fig_path) - fig.clf() + plt.close(fig) off_meas = self.lag_upsampling(sig_rx, sig_tx, n_up=1) off = int(abs(off_meas)) @@ -161,7 +161,7 @@ class Dab_Util: fig.tight_layout() fig.savefig(fig_path) - fig.clf() + plt.close(fig) sig_rx = sa.subsample_align(sig_rx, sig_tx) @@ -185,7 +185,7 @@ class Dab_Util: fig.tight_layout() fig.savefig(fig_path) - fig.clf() + plt.close(fig) sig_rx = pa.phase_align(sig_rx, sig_tx) @@ -209,7 +209,7 @@ class Dab_Util: fig.tight_layout() fig.savefig(fig_path) - fig.clf() + plt.close(fig) logging.debug("Sig1_cut: %d %s, Sig2_cut: %d %s, off: %d" % (len(sig_tx), sig_tx.dtype, len(sig_rx), sig_rx.dtype, off)) return sig_tx, sig_rx diff --git a/dpd/src/ExtractStatistic.py b/dpd/src/ExtractStatistic.py index d2aeee4..6139e1d 100644 --- a/dpd/src/ExtractStatistic.py +++ b/dpd/src/ExtractStatistic.py @@ -118,7 +118,7 @@ class ExtractStatistic: fig.tight_layout() fig.savefig(fig_path) - fig.clf() + plt.close(fig) pickle.dump(self.rx_values_lists, open("/tmp/rx_values", "wb")) pickle.dump(self.tx_values, open("/tmp/tx_values", "wb")) diff --git a/dpd/src/MER.py b/dpd/src/MER.py index 00fcc23..4f2918e 100644 --- a/dpd/src/MER.py +++ b/dpd/src/MER.py @@ -106,7 +106,7 @@ class MER: plt.tight_layout() plt.savefig(fig_path) plt.show() - plt.clf() + plt.close() MER_res = 20 * np.log10(np.mean([10 ** (MER / 20) for MER in MERs])) return MER_res diff --git a/dpd/src/Model.py b/dpd/src/Model.py index a051927..fe9c56b 100644 --- a/dpd/src/Model.py +++ b/dpd/src/Model.py @@ -139,7 +139,7 @@ class Model: ) plt.hist(phase_diff_choice) plt.savefig('/tmp/hist_' + str(np.random.randint(0, 1000)) + '.svg') - plt.clf() + plt.close() phase_diff_est, phase_A = self.dpd_phase(rx_choice) err_phase = phase_diff_est - phase_diff_choice self.errs_pm.append(np.mean(np.abs(err_phase ** 2))) @@ -326,7 +326,7 @@ class Model: fig.tight_layout() fig.savefig(fig_path) - fig.clf() + plt.close(fig) self.coefs_am = new_coefs_am self.coefs_am_history.append(self.coefs_am) diff --git a/dpd/src/Model_AM.py b/dpd/src/Model_AM.py index 5281dde..bdf55c6 100644 --- a/dpd/src/Model_AM.py +++ b/dpd/src/Model_AM.py @@ -71,7 +71,7 @@ class Model_AM: fig.tight_layout() fig.savefig(fig_path) - fig.clf() + plt.close(fig) def poly(self, sig): return np.array([sig ** i for i in range(1, 6)]).T diff --git a/dpd/src/phase_align.py b/dpd/src/phase_align.py index 7f82392..7317d70 100644 --- a/dpd/src/phase_align.py +++ b/dpd/src/phase_align.py @@ -75,7 +75,7 @@ def phase_align(sig, ref_sig, plot=False): plt.legend(loc=4) plt.tight_layout() plt.savefig(fig_path) - plt.clf() + plt.close() return sig diff --git a/dpd/src/subsample_align.py b/dpd/src/subsample_align.py index 6d1cd2a..b0cbe88 100755 --- a/dpd/src/subsample_align.py +++ b/dpd/src/subsample_align.py @@ -78,7 +78,7 @@ def subsample_align(sig, ref_sig, plot=False): plt.plot(ixs, taus) plt.title("Subsample correlation, minimum is best: {}".format(best_tau)) plt.savefig(tau_path) - plt.clf() + plt.close() # Prepare rotate_vec = fft_sig with rotated phase rotate_vec = np.exp(1j * best_tau * omega) |