From a7f37b014174d09ff3b5aaaf7a54acee84a29ff2 Mon Sep 17 00:00:00 2001 From: andreas128 Date: Thu, 14 Sep 2017 19:12:20 +0200 Subject: Add minimum tx value for analysis by Model_PM --- dpd/src/Model_PM.py | 7 ++++++- dpd/src/const.py | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'dpd') diff --git a/dpd/src/Model_PM.py b/dpd/src/Model_PM.py index 6639382..8d35051 100644 --- a/dpd/src/Model_PM.py +++ b/dpd/src/Model_PM.py @@ -66,7 +66,7 @@ class Model_PM: ax.scatter(tx_dpd, phase_diff, label="Binned Data", color="blue", - s=0.1) + s=1) ax.set_title("Model_PM") ax.set_xlabel("TX Amplitude") ax.set_ylabel("Phase DIff") @@ -76,6 +76,10 @@ class Model_PM: fig.savefig(fig_path) plt.close(fig) + def _discard_small_values(self, tx_dpd, phase_diff): + mask = tx_dpd > self.c.MPM_tx_min + return tx_dpd[mask], phase_diff[mask] + def poly(self, sig): return np.array([sig ** i for i in range(0, 5)]).T @@ -88,6 +92,7 @@ class Model_PM: return tx_range, phase_diff def get_next_coefs(self, tx_dpd, phase_diff, coefs_pm): + tx_dpd, phase_diff = self._discard_small_values(tx_dpd, phase_diff) check_input_get_next_coefs(tx_dpd, phase_diff) coefs_pm_new = self.fit_poly(tx_dpd, phase_diff) diff --git a/dpd/src/const.py b/dpd/src/const.py index 75ff819..2a7e64c 100644 --- a/dpd/src/const.py +++ b/dpd/src/const.py @@ -41,4 +41,7 @@ class const: self.ES_start = 0.0 self.ES_end = 1.0 self.ES_n_bins = 64 - self.ES_n_per_bin = 256 + self.ES_n_per_bin = 128 + + # Constants for Model_PM + self.MPM_tx_min = 0.1 -- cgit v1.2.3