From 75ba4f064a65ebad77d130f160b9469418e49c9f Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Wed, 9 Jan 2019 12:21:21 +0100 Subject: GUI: Add ability to restore previous DPD settings --- python/dpd/Model_Poly.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'python/dpd/Model_Poly.py') diff --git a/python/dpd/Model_Poly.py b/python/dpd/Model_Poly.py index 7ab6aa1..ef3fed3 100644 --- a/python/dpd/Model_Poly.py +++ b/python/dpd/Model_Poly.py @@ -125,6 +125,11 @@ class Poly: def get_dpd_data(self): return "poly", self.coefs_am, self.coefs_pm + def set_dpd_data(self, dpddata): + if dpddata[0] != "poly" or len(dpddata) != 3: + raise ValueError("dpddata is not of 'poly' format") + _, self.coefs_am, self.coefs_pm = dpddata + def _am_calc_line(self, coefs, min_amp, max_amp): rx_range = np.linspace(min_amp, max_amp) tx_est = np.sum(self._am_poly(rx_range) * coefs, axis=1) -- cgit v1.2.3